Sponsored by FUNimation Enertainment
I Think I’m A Clone Now view!
funimation.com - Watch the First 8 Minutes of Evangelion 1.01 You Are (Not) Alone anime movie -- Available Now DVD.
56 Comments
- cypher35, on 10/12/2007, -3/+24Python > Ruby > Perl
there i said it... - lumnar, on 10/12/2007, -4/+24War is begun!
Perl is fastest.
Perl has the largest archive of prefab libraries.
Perl has a more intuitive grammar (for C and Unix programmers at least).
Perl is not _constricted_ by the OO paradigm.
Perl makes you feel like a big man once you understand its arcane subtlies.
Perl is wine (nuanced and aged).
Python is beer (a workin' man's language). If you want a job, Python is probably best to learn.
Ruby is... I don't know. A martini. Hip. Expensive (computationally). Exclusive. Sexy.
(Don't digg drunk) - JelloZ, on 10/12/2007, -0/+16Get the book "Python Programming for the Absolute Beginner, Second Edition" by Dawson. It is excellent.
- inactive, on 10/12/2007, -1/+10no you ***** ignoramus INDENTATION IS SIGNIFICANT
there is a huge difference between indentation and all white space.
put simply functions etc are held by indentation levels, not {}, which produces code xxxxxxx times easier to read. you know, how they ***** taught you to, and for very good reasons - jhuebel, on 10/12/2007, -1/+10Python > Ruby because python is faster than Ruby. Python is much more efficient for larger codebases.
As for why Ruby > Perl, I don't know. I've only used Perl a little. And from the little bit I've seen, I hate it. - inactive, on 10/12/2007, -1/+10PHP is like saying "*****" in church when your around programmers.
- sembetu, on 10/12/2007, -1/+10I am actually going through that book right now, and let me tell you... as a beginner to the sport, I am truly impressed. No, seriously, I have attempted to find a beginning programming book before, and I tried C, C++, Ruby, PHP, and JavaScript. Over and again, I have found that although the languages are always presented to be "easy to learn", I always seem to miss something intangible. However, this author, with this language it is like eating Caprini (goat cheese medallion in the center of a saucer, drizzled generously with extra-virgin olive oil, and topped with a touch of Italian pepper... eaten with lightly toasted, sliced baguette) but I digress. The point is the book is as flawless as this lovely dish, and I am enjoying as much.
- garg, on 10/12/2007, -0/+8Why and how is Python better than Ruby? I'm just starting out Ruby and I want to know if I should learn python first or not.
- inactive, on 10/12/2007, -0/+7To everyone that's trying to decide whether to learn python or ruby... why not try learning BOTH. You have a brain, fill it with knowledge. You don't just have 1 type/size screwdriver in your toolbox, do you?
- oGMo, on 10/12/2007, -1/+8"Despite what assembly code and C coders might tell us, high-level languages do have their place in every programmer's toolbox"
What is this, 1995? Do people really still have an issue with "high level languages"? Is anyone really writing hand-crafted C and assembly for those quad-core 4GHz opterons with 8GB of RAM? Because the performance of a lot of modern applications doesn't seem to indicate it.
I'm pretty sure no one really has a problem with high level languages anymore.
But anyway, a beginning tutorial is nice, it's always good to introduce people to the field. (Let's try to not turn this into a language flamefest though.) - jesusphreak, on 10/12/2007, -1/+7garg, I've been using both languages over the past few months. I started out with Ruby, took a look at Python, kept using Ruby, and now for the time-being have switched to Python for as long as I can see.
Ruby and Python are very similar languages; they have more in common than they have that isn't similar. Each brings certain things to the table, though overall I'd say that Python is a better language.
It is faster, has more libraries available to it (never underestimate how important this is), and just has more important features likea module system and Unicode support.
And during this time I've never thought more than 5 minutes about seriously using Perl. It is slowly fading even further and further into unimportance.
Here's my own writeup on why I chose Python over Ruby:
http://jesusphreak.infogami.com/blog/why_py
If you like it, digg it, please:
http://www.digg.com/programming/Of_snakes_and_rubies_Or_why_I_chose_Python_over_Ruby - inactive, on 10/12/2007, -1/+6obviously you're not someone who has even touched a python interpreter, and I bet your code looks like *****...
- PigThief, on 10/12/2007, -0/+5Yeah, I'm deciding between Python and Ruby right now, and any insight would be great.
- inactive, on 10/12/2007, -1/+6I won't say that ruby is better than python or vice versa, but for me, ruby just felt right. I'd say you should do through some tutorials for both of them and then choose which one you feel most at ease with.
- commandar!, on 10/12/2007, -0/+5PHP is a great language to start with if you don't care about actually learning to program. It handles what it's designed for okay, but from a language standpoint, it's pretty well broken because it's a huge patchwork conglomeration.
Far better to start with a language that's had some serious thought put into its actual design, syntax and style first rather than pick up bad habbits from PHP. - OrangeTide, on 10/12/2007, -1/+6I think there is value in learning both high level langauges and medium(C) to low level languages(assembly, forth).
These sites have competitions in assembly to write very small programs.
256byte demo archive - http://www.256b.com/
Hugi Size Coding Competition - http://www.frontiernet.net/~fys/hugi/hcompo.htm
You don't have to be a genius to understand assembly, and it often makes it easier if you aim for writing these small 256 byte "demos". Your demo might not be the best, but I think anyone can learn enough assembly to have it do something in 256 bytes. The restriction makes it easier because it reduces the scope of the problem to something anyone can try. - oGMo, on 10/12/2007, -0/+5Um no, either way. PHP is like BASIC: it ruins potential programmers. This is not from a *language* perspective (as PHP supports most of the major constructs, OOP, etc), but from an overall design perspective. Doing "real" design in PHP is next to impossible: i.e., having a real application layer that is abstracted from presentation. This applies *especially* for web applications.
PHP is easy for beginners because it emphasizes "laundry list" programming, which is the first natural inclination. "Laundry list" programming is "first do this, then do this, then do this." Unfortunately, that's *not* the way good code is written, and early exposure to this tends to warp the perspective of potential programmers. Same with anything that's essentially scripting (like shell scripts). - Schpariel, on 10/12/2007, -1/+5@lumnar:
"Perl is fastest."
That's true, but don't forget that python has a JIT specializer (psyco) which can be used to speed up python code up to 2x
"Perl has the largest archive of prefab libraries."
True.
"Perl has a more intuitive grammar (for C and Unix programmers at least)."
Intuitive?, as in "cryptic" ... You gotta love the tabs of python.
"Perl is not _constricted_ by the OO paradigm."
Perl's OO is hackish and not worth mentioning, it's better not to use it in some cases.
"Perl makes you feel like a big man once you understand its arcane subtlies."
Proves my 3rd point. You can be a big man in python instantly after putting it's grammar and feature set in your head.
"Perl is wine (nuanced and aged)."
Old languages get replaced by better ones in time. That's why BCPL and COBOL aren't in use anymore. Old Language != [Doesn't have to be] Good languge - nofxjunkee, on 10/12/2007, -0/+4I like both languages. I like Ruby more because of some cool features that Python will propably gain soon anyway (blocks/closures), and the syntax. It goes the other way as well, Ruby has some features in development that Python has already (named arguments, unicode support).
You can't go wrong just reading a book about each of them and deciding yourself. Like the summary says: it's always good to add another tool to your toolchest.
You'll probably like both of them, just for different reasons.
ex. http://twistedmatrix.com/trac/wiki/TwistedProjects is some useful MIT-licensed Python code.
lumnar: perl is damn useful and there is a TON of perl code out there you might have to read or want to use, but OO is good stuff. I just saw a company dump perl like that *snap* because it lacks decent and real OO. - sembetu, on 10/12/2007, -0/+4@PigThief
I would also say it is a matter of preference. My personal choice for the moment is Python, but I am not stuck on it. I am open to Ruby, but since I found an excellent Python book, I am sticking with it until I feel comfortable. From my understanding, Ruby was built by taking some of the best attributes of some of the best languages and making them better. It looks pretty exciting to me, but the books I have been able to find thus far are a bit stuffy for me. After I get a firmer grasp on Python, I think I will definitely give it a run. Hope this helps. - rodrigo74, on 10/12/2007, -0/+3For those who want a good book for free, google for "Dive into Python".
It's for people who know some programming already, and very well written. - deity, on 10/12/2007, -0/+3Haskel is a great functional language but it has absolutely nothing to do with the way a computer works. One of the reasons that functional languages have not caught on is that they are hard to optimize because they are not easy to translate into the Von Neumann model architecture that modern computers use.
- ramsinks.com, on 10/12/2007, -0/+2http://www.amazon.com/Python-Programming-Absolute-Beginner/dp/1592000738
Best book
http://www.ibiblio.org/obp/thinkCSpy/
Second best book.
;) - inactive, on 10/12/2007, -0/+2Not quite as old as 1995, but the post date is 2000... not the freshest of guides out there.
- Manhigh, on 10/12/2007, -0/+2Python isnt constrained by OO, at least not to a noticably annoying level. I always thought Java was rediculously constrained by OO principles. In python, its as OO as you want it to be. If you just want a calculator, something fortran-esque (in syntax, not in speed) it can be that. If you want first class functions, it can do that. If you want to go all out and encapsulate everything in a class, you can do that too.
Plus I'm really excited about the ctypes module because it means even more legacy C and Fortran libraries will be available via python. - Aninhumer, on 10/12/2007, -0/+2The transition from Python to C/C++ is a lot easier than BASIC to C/C++, I wish I'd done Python first.
However, at the same time, the transition from BASIC to Python is reasonably easy. - inactive, on 10/12/2007, -0/+2Blame the creators of zope, not GvR.
- deity, on 10/12/2007, -0/+2Actually this argument has been going on much longer then since 1995. If you ever get a chance take a look at programming language history. Here's a good place to start(chart http://www.levenez.com/lang/history.html#05, site http://www.levenez.com/lang/). Fortran 1954, List 1958, and Basic 1964.
Yes C and assembly language are still used regularly. Anyone that writes a compiler has to both know and be able to use the assembly language for the processor. Game developers will often optimize inner loops on games, in assembly, to make the as fast as possible. People who write device drivers must often work in either C or assembly language. All of the linux kernel is written in C, although you might not call all of it highly optimized. :)
For a begginer any high level language that can teach both the logic and math concepts behind programming is good. I would recommend an object oriented language Python or another scripting language and possibly a functional language. After that one should learn more about the architecture of modern computers before learning lower level languages, if one wants to get the most benifit from the experiance.
If I were to recommend a language to an absolute beginner I might recommend any of the following. In no particular order it would depend on the person.
Java, Groovy, Ruby, Python, BASIC of some flavor. - OrangeTide, on 10/12/2007, -0/+2Pure functional languages are a bit too mystical for me. I think they are amazing, yet I really can't seem to grok them. But I suspect math majors find pure functional languages just wonderful.
- nepawoods, on 10/12/2007, -0/+2Java just tarted up Basic? Java doesn't even have a goto. Basic (real Basic) relies on it.
- posure, on 10/12/2007, -0/+2If I'm going to use a scripting language, I'd use Ruby because its so elegant. If I need special libraries I'd probably look at Perl or Python though.
- bradallen, on 10/12/2007, -0/+1That's a valid point about the meaning getting lost in IM (I usually have to resize my chat window a bit), but I've never had that problem with email. As long as you indent using spaces (not tabs), it's no big deal.
Anyway, it's a small price to pay for the benefits when working in primary source code files, such as uncluttered readability, no worries about balancing braces, and no need to spend effort actually typing the darn things. Most coders use indentation in conjunction with the braces anyway, so why do we need them, anyway? Their primary purpose seems to be to slow down the programmer. - OrangeTide, on 10/12/2007, -0/+1indentation being syntactically meaningful is annoying. Makes it hard to put source code in emails, IMs and IRC without the meaning getting lost. I like using {} or begin/end and just insert my own indentation, if needed.
stuffing everything on one line isn't really that evil. here's a common one you find in switch statements:
case 'h': usage(); break;
or these:
if(x=width) x=width-1; - bradallen, on 10/12/2007, -0/+1+1 on Dive into Python -- it's an incredibly engaging tutorial book that wastes no time, and it has a free downloadable version as well at http://www.diveintopython.org .
There are a lot of other great books, too. For reference, I like "Python in a Nutshell" 2nd edition, as well as "Python Essential Reference" third edition. For examples, "Python Cookbook 2nd" edition rules. For scientific computing stuff, Python Programming for Computational Science. For building cross-platform desktop GUI applications, see "wxPython in Action". For Python as a CompSci teaching language, see "Python Programming: An Introduction to Computer Science".
A quick way to see all the Python books is to go to http://nerdbooks.com and search for Python (sorry, I can't resist plugging my favorite technical bookseller -- their prices consistently cheaper than Amazon, and the service is terrific. Full disclosure: I don't work for Nerdbooks, but benefit from their generous hosting of local user group meetings and PyCon parties). - ramsinks.com, on 10/12/2007, -1/+2Um ya, if your doing web development.
- nicolasfr, on 10/12/2007, -0/+1If you are intereted in Python you might check my collaborative documentation project here: http://www.pythondocs.info.
- nofxjunkee, on 10/12/2007, -1/+2Everyone should have to learn C without exception. If not in high school, college - first year. Some assembly is good too, it builds character and really it's fun. It helps to know what goes on after the compiler eats your code.
Learning C will give you a chance to learn PHP, Perl, Java, C++, C#, Obj-C, (whatever else is C-like in syntax) with relatively little change to most syntax. - inactive, on 10/12/2007, -1/+2wahhhh.... sounds like someone misses his fortran...
- sembetu, on 10/12/2007, -1/+2Piss off, Django is also written in Python, and if you are looking for an easy to learn, but powerful language, Python is your bet, or maybe Ruby. I mean, look at the simplicity.
- RevMark, on 10/12/2007, -0/+1What are, really, the advantages and disadvantages of each?
I did some light COBOL maintenance, and currently light PHP and XML. If I wanted to build a web based DB accessible with PC/Mac based applications, what would I use? What would be best to use? - bradallen, on 10/12/2007, -0/+1There are a lot of choices for Python web development, with over 50 web frameworks, ranging from minimalist to serious enterprise applications servers like Zope/Plone.
I haven't tried them all, but have found Django http://www.djangoproject.com/ to be a good choice for getting a database-driven website up and running quickly. It can be run from Apache mod_python or fastcgi, has excellent well-maintained tutorials and documentation, and has most of the features you'll need: flexible url-dispatching, support for sessions, a ORM to map database tables and fields to classes and attributes, a system for user authentication, and a really nice customizeable admin web interface for editing the database.
Other popular Python web frameworks include Zope 2, Zope 3 (completely overhauled from Zope 2), Plone (runs on top of Zope), Turbogears (runs on top of CherryPy), Quixote, Spyce, CherryPy, Twisted Web, Webware, and the ever-popular "I don't need no steeenking framework! I'll build it from scratch!" - inactive, on 10/12/2007, -0/+1(a) PHP *is* for web development, but I have a command-line interpretter installed too. Hence, concievably, it could also be used for application scripting, though Python is what would be used in that place.
(b) PHP syntax is actually closer to C or Java than Basic. - sirsteveh, on 10/12/2007, -0/+1If you already know a few other languages, Python - Essential Reference can get you up to speed in a few hours (at least as far as language constructs go). Learning to be Pythonic, though, takes a bit longer.
- inactive, on 10/12/2007, -1/+2"actively oppose learning how a computer really works"
so why are you using haskell? ***** it why aren't you writing everything in asm ? - OrangeTide, on 10/12/2007, -0/+1I'm not saying spend years on learning assembly. I think it could be a chapter/unit in an intermediate computer engineering course. Like you spend 2 weeks on it, tops. Not that I find much value in learning in a structured environment, I'd recommend people just crack open a book at home and find some forum or irc channel to bug with their n00b questions. (just ignore all the rude people)
It makes a huge difference to people who do C and C++ to realize that a pointer is just a number. And to understand something basic about a Turing Machine, that numbers can represent more than just values, they can represent operations(machine code) and memory addresses(pointers) too. - tzarak, on 10/12/2007, -0/+0jmcantrell: "WWW::Mechanize (perl)... have not met its equal yet.."
How about the Python Mechanize module at http://wwwsearch.sourceforge.net/mechanize/ ? It's based on WWW::Mechanize.
One of the major strengths of Python, in my opinion, is the very complete standard library and the excellent, easy to use third-party modules available. - hunchback, on 10/12/2007, -1/+1yeah lumnar act like you are on acid and people will follow
- deity, on 10/12/2007, -0/+0Just to add to that. One of the things that I enjoyed while learning programming was the instant gratification of being able to enter one or two lines of code in a text editor and seeing instant results.
Any interpreted language is going to give you that instant gratification. Any web programming language will also give you similiar instant gratification if done properly but those are normally semi-complex(for a begginer) to setup and use.
For instant gratification TCL/TK for those GUI lovers. It's one of the easiest to write something like a simple hello world window in. - feraldrinker, on 10/12/2007, -1/+0Well if adding functions and loops isn't tarting it up, what is? ;)
Seriously, the OP has a point: None of those languages really deviate from the fortran model, they just add features, as nice as those features are. Even OO is just a bunch of features that provide a workaround to partially alleviate some of the problems of that model. Haskell _is_ actually a different (superior!) model. But one of the nice things about it is that you are much _less_ constrained by the way the machine works, so I can see why he's been buried.
BTW, performance isn't really a significant problem for functional languages these days. There are niches where it would be, but in the scheme of things, a very small fraction of programming is done in those niches. I'd estimate the performance arguments against functional languages for general purpose programming are about where they were against garbage collection 5 years ago, but may recede slower since they see less commercial research dollars. - gaoshan, on 10/12/2007, -4/+2I do web development and gotta say that if you are just starting out PHP would be better than both Python and Ruby. I found it easier to learn. After getting PHP down (and I mean object oriented PHP5, not spaghetti code PHP4) Ruby and Python will be much easier to learn.
That said, Ruby on Rails does seem sluggish. Additionally, there are not that many hosts that offer it (compared to PHP) and of those that do, it seems that there is often some noob RoR programmer who is taking down the server because of runaway fcgi processes. The whole setup needed to get RoR up and running is also quite a bit more involved than what PHP requires.
Right now, I'd say that if you want to find web based work easily and quickly, learn PHP (and learn it well... as in PHP5 and object oriented coding). If you want a powerful tool for quick and potent not necessarily web based projects, learn Python. Learning Ruby will also benefit you but you won't find employers clamoring for your services because of it (and as for Ruby on Rails... not my cup of koolaid.) -
Show 51 - 56 of 56 discussions



What is Digg?