Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

The best thing Python has going for it is that it's an exceptionally good learning language. It's very easy to go from zero coding experience at all to making a simple hangman type game, and from there introduce OO concepts and so on.

And if you stick with it, unlike with most 'proper' educational languages, by the end you've learned a language that's actually useful for all kinds of stuff.

I don't think there's any other language out there with such a nice, even learning curve, with that kind of payoff. Javascript is, let's be honest, a bit weird. PHP is enough rope for anyone to hang themselves. Ruby is quick to get started on, but gets conceptually dense pretty quickly. (Sure, we all complain about having to write 'self' everywhere in Python, but compared with the way 'self' dances around in a Ruby class definition, it's much easier to learn.)

I note, on topic, that most newer beginner's Python books etc target 3.x nowadays - maybe the RPi generation will force things along. Maybe not.



sort by: page size:

The key thing about Python is that it's really plain. It's a straightforward procedural language - values, functions, names, calls, and that's about it. It has a simple object system, and some simple functional features. The whitespace business is superficially kooky, and there is a scary amount of metaprogramming and other craziness available, but people tend not to use it.

As such, it's a really useful preparation for learning other languages.

If you have the basic concepts from Python, then when you learn Ruby, you just learn some syntax and the special things that make Ruby distinctive (metaprogramming, monkeypatching, ubiquitous gemmery, Rails). When you learn JavaScript, you just learn some syntax and the special things that make JavaScript distinctive (callbacks, artisanal object systems, the interplay of JS and the DOM). You never have to learn to do without some special thing you've learned to depend on, because Python has no special things.

Well, that and it's incredibly easy. And it has a really strong batteries-included standard library. And it has a really friendly, helpful community. But mostly the plainness.


As a programmer who was a beginner not very long ago, I agree that Python is great for beginners and experts alike. Ruby is another decent candidate, for mostly the same reasons.

Java and C++, the languages you usually see in university courses and the work place, are just god-awful for beginners.

When I first started learning programming, I didn't really know what language I should study, so I flip-flopped between studying Java, C++, Python, and PHP, and learned them to widely varying degrees of proficiency. Then I picked up Javascript, then Ruby, then Objective-C, and now I think that's about all the OO languages I would have any reason to learn, and am now just starting to dabble in functional programming.

I think the only reason I didn't just stick with Python throughout the beginner phase, is that I didn't really get what Python was "for." I thought it was just for desktop scripting. I didn't know about its GUI toolkits, or that you could write web applications in it. I learned PHP because I could immediately see the end use of it in my browser, and had no idea I could have used Python for the same thing.

If I had to do it over, instead of studying such a smattering of languages, I probably would have started off with a crash-course in C and then quickly moved on to doing everything in Python (and Javascript).


Python may be the best language to learn if you've never done any coding before. Clean syntax, straight to the point, etc.

However, I'd say Ruby fills the RAD a bit better than Python, and Python is is not a language that scales, so aside from little scripts it's not exactly a language that's conquered a niche.

Go with Ruby or Java if you plan on making something useful right away.


I found Ruby a bit easier to read and much easier to learn than Python as a beginner. In fact, I'd say it's the most beginner-friendly language I've seen, especially with great resources like Chris Pine's Learn to Program.

If I had to rank learning difficulty I've found various languages, I'd say Ruby was the easiest one I've ever encountered. It's very consistent, everything is an object, it's flexible and you don't need to learn anywhere near all of it to become productive with it.

Python is fairly beginner-friendly too, but it's less consistent, significant whitespace leads to a certain class of mistakes that are maddening for a beginner and at least when I used it pip was nowhere near as nice to work with as gems and bundler.

Both are much easier than JavaScript or anything where you manage your own memory, though!


Sure, and Ruby squeezes out Python as a starter language because it's closer to English and the identation doesn't have to be strict.

That said, I find both Ruby and Python considerably user-friendly and extremely powerful. JS of course is today's hot stuff and if you want to be on-top of the game, you have to know and understand JS. But once you've become comfortable with any other OO language JS is easy.


I love Ruby, but Python is super simple to learn. I haven't spent enough time with Python to do anything super cool with it, but it does seem to be more consistent in terms of the code you will read.

I also think that once you learn Python, a lot of other languages' syntax (such as Go and C# for me) becomes more approachable.


I agree. I am a PHP developer and just started learning Python a few days ago and must say, for now, it is indeed easy to learn and is very readable. Though I never tried Ruby so I can't tell you if I would find that easy also.

Python isn't too bad (unless you're calling the script in a lot of separate instances), but python is fairly neat compared to ruby/javascript/whatever trendy language of the week as it doesn't need a huge pile of worthless dependencies itself.

python is easy to learn like php and ruby have sometimes strange looking syntax like perl for newbies. A good programmer doesn't have this problem and will love the goodies and syntactic sugar from ruby.

As a guy who uses a lot of languages and having started on C-like languages I appreciate Python in that it doesn't make me work terribly hard to get what I need to get done. I'm far from a Python expert cause I don't use it exclusively.

In spite of all that, it's pretty intuitive, reads like pseudo code. Plenty of data types and packages to get the job done.

The few times that I've touched Ruby, however, even though it's succinct and beautiful language, I always have to find myself relearning its super object oriented centric paradigm.

Everything takes 2-3 times as long to achieve and, not arguably, not that fast a language either.

I suppose if i worked on web app project exclusively, maybe Ruby might be my language of choice, but I don't.

I'm sort of a jack of all trades master of none position (but that's ok cause in my particular situation I get paid pretty well for it).

So that's why I prefer Python at the moment.


Python and Ruby are great first languages; they'll let you do all kinds of things, from quick scripts to web programming to GUI's. There are some things for which they're not ideal, but they're still probably 'good enough'.

Python is almost as good as Ruby. They have slightly different takes on a few things (taaaaabs) but you can easily jump from one to the other.

Python is a nice language because of the everything and the kitchen sink approach to the built-in libraries. It also has a clean look because of the significant whitespace. Ruby is another nice language. It seems to be a bit more esoteric as far as some of the more advanced language features but for the beginner the language lets you accomplish it in more than one way. C is a fine language too but you will spend your time working on memory protection instead of getting things accomplished fast. It is more useful on memory constrained systems.

Every language is useful in a different way and each have a domain or two in which they excel at.

The real takeaway is that the shift from knowing one language to another is fairly easy. The real trick is knowing the idioms of the particular language and how to use them.

http://www.pythonchallenge.com or http://rubyquiz.com/


I’d say that Ruby and even Perl are a lot nicer for scripting than Python (due to the extremely low-effort unix interop). Python can do it but it’s a while lot more verbose and difficult for a beginner to learn than “anything inside a pair of backticks is run as a system command and you can interpolate variables”.

Python was friendlier for beginners than Ruby the first time I took a real stab at learning to code during a CNY holiday in 2008, but it wasn’t about the language itself. Ruby was harder then because many of the popular libraries and many of the tutorials were written by people who considered Windows support as an afterthought. It’s hard to express how frustrating it was to have my vacation days ticking down, hitting issues in one tutorial after another and having people suggest I install linux on a VM (a process where I hit still more snags).

People learning Python and PHP didn’t hit that hurdle. I ended up learning Flash on my Asus laptop a couple of years later and getting my start that way and not coming back to Ruby until six years later when I was a much more experienced dev.


On the higher level languages I've used (PHP, JS, Ruby, JS, Python, Basic, Bash, Perl), Ruby and Python are clear winners : easier to read, organize and promote more solid code.

But Python provided me with a better experience than ruby because:

- it's very useful outside of the Web as well. Ruby is still very much tied to RoR.

- the Python community value documentation, tests and dislike too much magic, like monkey patching.

- as a trainer, making people setup Python + venv and make them use it is wayyyy easier than rvm.

Then second to them would be JS. It's a terrible language, but it's the only one on the browser platform which is amazing. Having code that natively manipulate GUI, sound and video in a few line is the most motivating experience you can get when you start coding.


I think JS is actually a radically simpler language than either Python or Ruby. Lua is a much closer comparison, and its certainly got a nice interpreter and JIT available.

Preferred: Python. clean, elegant, pure, simple, easy.

Just fine: Ruby. good, but less simple and elegant than Python.

Good if you want to deeply understand the principles of being a programmer but don't care about being very practical at the start: Lisp (yes, Lisp can be practical, but it's trouble for a newbie)

Avoid: Perl, PHP, BASIC variants. These cause brain damage.


It's funny. As a Rubyist, I still recommend Python for getting started in programming.

The docs are better, the code is probably easier to read for someone new to programming (there isn't a requirement to understand OOP to be productive), the community isn't alarmingly dysfunctional, and the conventions are more traditional. You can port a lot of Python concepts over to other languages easier than you could Ruby, I would think.

Python is classical music. Ruby is jazz. Choose the least subjective/nuanced approach first and build from there. But that's just me.


You are just arguing that a simple language is good for beginners, and I agree with that.

We want a beginner language which has easy (and consistent) syntax, no requirement to specify datatypes (implicit), and can be interpreted (no compiling required).

In its most basic use, namely just writing procedural code with basic built-in data structures, Python is pretty ok. But it has some warts and gotchas, not the least of which is mutable default parameters in functions.

Now maybe the ultimate beginner doesn't use defaults for parameters, so it's not a problem (yet) for them. Same goes for the OO features. While the beginner may not write OO Python, using modules written by other people probably will require them to step into the Python version of OO. Now it gets messier.

Ruby is superior in the simple beginner case and the complex (OOP) case. It is superior and more consistent for functional cases as well, despite it not being designed as a functional language (it still has mutability risks all over the place as does Python, except for that default parameter razorblade).

The only beginner-unfriendly thing I can think of for Ruby is the optional parenthesis on function calls. I still think optional parens is a bad design choice, and I encourage people to always use them. It's usually a style choice (but not always, because sometimes it matters for how code is parsed), and I think it's better to know as a reader that foo.bar() is a function being called. foo.bar is unclear.

One small but significant feature Ruby provides is the ability to write more expressive function names with ? and !. A common pattern is to use foo? to indicate that the function will return a boolean. The alternative, without ?, is is_foo(). Likewise, ! usually (at least for standard libraries) indicates mutation.

Back to the point though, Python used simply in isolation is not terrible for a beginner. But inevitably outside modules will get used, and the misfeatures of Python will appear more frequently. And then a further eventuality is that this new programmer will now be a "python programmer", choosing Python for future bigger work because that's what they know. Why not start with a language that is also beginner friendly but also better for large, long-lived projects?

next

Legal | privacy