I've just started learning, please tell me If it's best to learn python (I'm not looking for an easy language, but for a powerful and versatile one :) Something to develop some ideas I have..
First post on HN!! :D From the center of Spain!
I've just started learning, please tell me If it's best to learn python (I'm not looking for an easy language, but for a powerful and versatile one :) Something to develop some ideas I have..
First post on HN!! :D From the center of Spain!
While Python has a healthy web dev ecosystem, Ruby's feels much larger to me. That's almost certainly because Rails is so wildly popular. And Rails is an excellent, mature framework. So for web dev, I would consider Ruby the winner.
Python is the clear winner for scientific computing. That's not really due to anything inherent in the language. It's an ecosystem thing. If you were using Fortran before, you might be working in a problem domain where Python dominates.
Both are excellent for miscellaneous scripting work. E.g. reading in a CSV file and doing something with each row; batch-processing a bunch of images; renaming 1000 files according to some ruleset; gathering some system data and sending nightly status emails.
In terms of syntax and features, they're very very similar. Python has meaningful whitespace, which you may like or dislike. (I think it's good for enforcing proper formatting, but you're free to disagree.) Ruby has multiple ways of expressing the mathematical concept of a function (methods, blocks, and procs), which has its pros and cons. Both have metaprogramming facilities, though I find Ruby's more pleasant. If I remember correctly, it was in large part the metaprogramming that made DHH pick Ruby for Rails.
What is there in, say, rails that would not be available for django?
I much prefer Python/Django, but when I get stuck, it always lasts longer.
The difference is in the size of the ecosystem as a whole. The Ruby web dev world appears to have more (or more visible) participants. Which affects things like Stack Overflow, web-specific packages on Github, blog posts, etc.
It's not an order-of-magnitude difference, as far as I can tell. But still significant.
These things would make a huge difference to productivity if one platform had more (and better) of these things, but I haven't noticed that to be the case.
It's funny because I actually feel the opposite: Ruby is mostly a niche language for the web community, whereas Python is now mainstream in so many different areas (graphics, scientific, sysadmin, financial...).
I've yet to see a non-webdev tool embedding Ruby as a scripting language, while Python is now featured in office suites, spreadsheets and enterprise software. Anywhere simple and clear syntax is more valued than metaprogramming features, Python is likely to appear at some point.
But many other readings and the fact twitter and groupon were coded in ruby, made the choice! I've read that twitter now is moving to scala, but as there are a lot more resources out there for learning ruby/python, I kicked it out of the list.
I like ruby, sometimes it seems a bit confusing when there are many ways to express the same thing, but it's approach to natural language is helpful.
Thank you all for your quick responses! It's a pleasure to join the HN community!!
Which is more future proof: Python v2 or Python v3?
I figured that I was least likely to regret Ruby for a green-field data analysis project. So far it's been a delightful experience.
As a compromise, you might want to start people on edwin (https://www.gnu.org/software/mit-scheme/documentation/mit-sc...) instead, if you want to teach them programming. But that's probably even less useful in practice.
After learning those picking up Python will be fairly easy. Again, you'll be comparing with what you know, finding differences and similarities.
Don't worry too much about finding the perfect language, it doesn't exist. Spend your time building nice things in languages and frameworks that are good at at what they do. Be ready to try new things, you might like them, they might work well for a particular task or have a great ecosystem to accomplish specific things.
One reason is that Python is used for system programming (e.g: the Linux apt system), desktop applications, big data (thanks to numpy) so you might find it a better investment for general purpose software development.
Another reason, which maybe explains the first one, is that Python looks more similar to C++/Java. Basically it's a simplification of those languages (the {} pair traded for a single colon, no type declarations, etc) plus some handy shortcuts. Ruby is from a somewhat different lineage (Smalltalk) and it shows in many places (e.g. the do |variable| ... end blocks). It can be used to write more natural language looking programs and combining that with some metaprogramming sometimes both amazes and unsettles programmers that come close to the language for the first time.
I suggest that you learn a little of both of them, working on the problem you want to solve, and decide by gut feeling what you would like to work with. I went the Ruby way because I can't stand some of the syntax of Python, not that Ruby is perfect.
(a) already know HTML/CSS/JS and now want to learn a server side language, or that (b) you are going from no experience straight to server side programming?
Regardless of whether you learn Python or Ruby, there is practically no way around having to learn HTML, CSS, and JavaScript for building web applications. You will be reading/writing HTML/CSS/JS in your Python or Ruby projects.
So if you have no prior HTML/CSS/JS experience, I would prioritize those skills first. Otherwise you will learn Ruby or Python then be disappointed to discover that browser technology is a giant hole in your skillset, impeding you from doing the useful things that got you to start learning in the first place.
You can do great things with just HTML/CSS/JS, especially since the browser environment supporting dynamic client-side applications in JavaScript has become so powerful.
Then when you're finally doing something that genuinely requires that logic and/or data be hosted on a server, managed by server-side tools, your knowledge of browser technologies will provide a solid foundation for stepping into that ecosystem.
If you already know HTML/CSS/JS, Ruby vs Python comes down largely to personal taste and whimsy. There are indeed differences, but the differences don't matter till much later, if ever. The greater danger is not that you will learn a language that isn't future-proofed, but that you could waste far more time picking what to learn than you ever might have wasted by picking the wrong language, especially since there isn't truly a wrong choice between two great languages. The debate between them is largely a religious war.
Since you seem focused on web apps, and have already started learning Rails, stick w/ROR. You're on a great path and your current choices won't hold you back. Good luck.
PS If you're interested in learning HTML/CSS/JS, I am thinking of teaching these subjects to beginners (no charge of course). PM me with a contact if interested.
I've started with the ruby course on codecademy, it seems it's just like a fun introduction to the ruby syntax. When I finish the codecademy course I'm thinking about going into "onemonth.com" for learning rails, and codeschool after that..
Thank you! I'll get started with those languages as well :) I'm focusing on web apps, but I'll have to use JS to take the idea to phone app (using Titan from appcelerator)
By the way! Thanks for the invite to the course! I'll contact you as soon as I find out how to send a PM haha
By the way, since it happened to me: if you find Rails to be too complex for what you need, there are more lightweight alternatives. Don't get me wrong, Rails will get you up and running fast; but when I was a beginner, it left me with the sensation that I didn't really know what I was doing. Using more lightweight frameworks, like Cuba or Sinatra, can help with that.