ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm a statistician; at our lab we produce similar tables for almost every statistical analysis. I wrote a program that makes LaTeX tables out of simple input files. I manage my projects with make. It's a simple project. For some reason, it was never clear to me that Python could be applied to that problem; but the Llama Book made it clear right away. I said "Oh, I get it" and I got it. it was just a strike-out for Python with me pitching. It was a huge breakthrough for me. I've since considered re-doing it in Python, or Ruby, but practicality is winning out.
Quote:
So is python books
I agree, there are great books for Python, however from my perspective -- having never studied programming itself -- I found them confusing. Many things were assumed, like that I knew what a "stack" was. I know those things now, but only thanks to reading about and programming in Scheme, Perl and C.
Quote:
what's wrong with "everything is object"?
The problem with "everything's an object" is that it has no significance to me -- someone who is not an experienced programmer. For someone who's studied C since high school, C++, Java, gotten a computer science degree, been a system administrator for five years and tried every scripting language in the known universe, I'm sure that's significant. For me, even though I've done plenty of programming now, the value of object-oriented programming still escapes me because I have no direct need for it. My friend over in the next building who programs in Java every day completely understands it because her whole programming paradigm is object-oriented. Everything I need to do right now can be elegantly implemented procedurally.
Joel
Last edited by trashbird1240; 05-30-2007 at 08:12 AM.
If I knew a better tool, I wouldn't have said that PHP/Perl/etc are still the way to get the job done... I said that we need better tools! :-)
well, the fact that you said "we need better tools" means that somehow you already knew that something is "wrong" with them? So what is wrong with them? Is it because their syntax look ugly to you? or something else?
Nothing is perfect. I think Perl does a good job for what it was designed to do. Some languages (like Ruby) were designed to clean up what the designers perceived as Perl's faults. But syntactically, it gets into aesthetics at some point. If you don't like Perl, don't use it. I'm not worried that the majority of the jobs out there don't use Haskell.
Many things were assumed, like that I knew what a "stack" was. I know those things now, but only thanks to reading about and programming in Scheme, Perl and C.
You can associate stacks in Python as lists, equivalent to Perl arrays...
Quote:
My friend over in the next building who programs in Java every day completely understands it because her whole programming paradigm is object-oriented. Everything I need to do right now can be elegantly implemented procedurally.
Joel
Although Python is built with OO from the start, it doesn't mean you need to use classes or OO all the time. It can also be used for procedural programming.
you make a perl program hello world
Code:
#!/usr/bin/perl
print "hello world";
the equivalent in Python:
Code:
#!/usr/bin/python
print "hello world"
so where's the 00? You associate Python with Java, and thats where it went wrong. Java is Java. Python is Python. you need to declare a class in Java even to run a simple hello world, and that is pure OO.
I know that python is very useful. That's why I studied it for three months.
I'm not using Perl directly for statistics, and I wouldn't use Python. I'm using these languages to help with stuff that is outside of the statistical realm; we have software specifically designed for that purpose -- though I understand that Python has great applications in numerical analysis (that was one of the reasons I was interested in it). Furthermore, none of those things you suggested do what I need, which in my mind is why people are still writing programs. It is, in particular, why I am writing programs.
The main point of my post is I (as in me, not you, not anybody else) don't get object-oriented programming. When I was reading about Python, that's all I seemed to be reading: how great it was that it was thoroughly object-oriented. Maybe I was reading the wrong books. Again that's me. That means a lot to somebody who cut his teeth on C++, it's meaningless to me. Some career programmers also feel like OOP is a tired idea and it's not that great after all.
I understand that Python can be procedural, as Perl can be object-oriented. It's irrelevant. The point is that as long as I read about Python, I had trouble understanding what it was good for -- my job is not directly computer-oriented (I'm not making "software for real people" as rms says), I'm just a heavy user who can benefit from some programming. When I read about Perl, I understood the application right away. For me to learn a language, I have to have a project to apply it to.
Joel
Last edited by trashbird1240; 05-31-2007 at 09:09 AM.
I know that python is very useful. That's why I studied it for three months.
I'm not using Perl directly for statistics, and I wouldn't use Python. I'm using these languages to help with stuff that is outside of the statistical realm; we have software specifically designed for that purpose -- though I understand that Python has great applications in numerical analysis (that was one of the reasons I was interested in it). Furthermore, none of those things you suggested do what I need, which in my mind is why people are still writing programs. It is, in particular, why I am writing programs.
The main point of my post is I (as in me, not you, not anybody else) don't get object-oriented programming. When I was reading about Python, that's all I seemed to be reading: how great it was that it was thoroughly object-oriented. Maybe I was reading the wrong books. Again that's me. That means a lot to somebody who cut his teeth on C++, it's meaningless to me. Some career programmers also feel like OOP is a tired idea and it's not that great after all.
I understand that Python can be procedural, as Perl can be object-oriented. It's irrelevant. The point is that as long as I read about Python, I had trouble understanding what it was good for -- my job is not directly computer-oriented (I'm not making "software for real people" as rms says), I'm just a heavy user who can benefit from some programming. When I read about Perl, I understood the application right away. For me to learn a language, I have to have a project to apply it to.
Joel
For statistics, in perl if you have a text file containing anything you can easily find patterns through perl.
just do (in dos for example):
type file.txt|perl -ane"print if /put pattern/"
this can extract any kind of pattern. for example a sequence of 3 numbers would be
/\d\d\d/ or a sequence of any set of characters
a, G, f, d would be /[aGfd]+/ etc.
the point is the regular expression syntax can help alot. to extract just a part you can use $1 from /df(ww)uu/ gets "ww" or the entire pattern $&.
So you can learn at least a small subset of the language perl and do quite alot. Actually just learn a small useful subset of any language, learning it all doesn't even make sense, I have been using perl for a few years and just use 10 or 15 key concepts. Especially languages like java and C++ are true overkill and uselessly complicated .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.