4 ms·
Ask HN: PHP, Python or Ruby?
Could you please help me decide which of these three languages to learn? (I already have hobbyist level experience with HTML and CSS)
I am a programming novice but I want to move forward and learn to code and build webapps/web services. Maybe down the road I could parlay the experience into a programming job, or build something to make a living on. I know there are a lot of bridges to cross before then. But first I have 2 projects that I want to learn how to build from scratch and launch successfully. One would be just another Google bookmarks-like web service (scratch my own itch) and another is basically a lost-and-found database, but with a bit of a twist. Right now I just want to do them as accomplishments and then reassess on where it will go from there.
Brief thoughts on each of the three:
1. PHP - It is common so there are lots of resources and lots of jobs. Also it seems like I know more people using it and that translates into it being easier to get help.
2. Ruby (RoR) - It is good and works very well like the others but honestly part of why I want to use Ruby and learn Rails is because it is so hot and trendy and cool and I am a victim of marketing.
3. Python - Marco Arment (of Instapaper) made a statement in an interview that I understood to say he uses PHP because it just works and he knows it inside and out but if he was going to start over he would use Python.
One factor in consideration would be which of the 3 languages makes you the most "hireable" in the North East US, even though I am not sure I would ever even get to that level.
I'd also love to hear from anyone who uses one of the three above but wishes they had chosen and become proficient in one of the other two instead.
Finally, does it really matter that much? Am I over analyzing? Should I just randomly pick a number 1 - 3 and go with that language, or just pick Ruby because I think Rails is cool and just start building and releasing already?
Thanks in advance!
- webholics 16y agoIn general I would say the more experience in programming you gain the less it matters what language you are using. Learn the basics first. And learn language types like OOP and functional programming. As a professional web developer you should try to learn several frameworks as well (Zend Framework, RoR, Django, etc.). But I would say that's the second step and not the most important one. Frameworks and API come and go, they change all the time. Try to get the big picture. I'm currently using PHP and Python. I like Python more because of it's simple style and it's clean APIs. But still most of my professional projects are done in PHP because my customers want it that way.
- thekevan 16y agoGreat, thank you!
- code 16y agoAs a previous PHP developer for years, I'm now moving over to Python. I agree with Marco if that was the statement he made. PHP can get the job done but Python overall is just a more powerful and cleaner syntax language. There are lots of companies that are built in Python big and small. Some examples are Dropbox, Slide, Youtube, Quora, Yelp, etc... It's definitely a scalable language and something I'd highly recommend. As a disclaimer, I don't have any knowledge in Ruby/Rails but I'd definitely still recommend Python. You'll come across between choosing 2 and 3 if this is the path you're heading down, stick with 2 and move onto 3 later. This will make much more senes once you look into Python.
- thekevan 16y agoThanks so much, I appreciate the insight!
- dutchrapley 16y agoTo add to this comment, I'd recommend taking a look at Learn Python The Hard Way (http://learnpythonthehardway.org/index http://learnpythonthehardway.org/index) to get started. I'm not a Python programmer, but I recommended this to a friend who's in the same boat as you and heading down the PHP path. He worked his way through 1/3 of the exercises his first day. The important part isn't what you read, but what you put into practice. You learn by doing. Learn Python The Hard Way gets you up and running fairly quickly. While Rails is a fantastic framework, don't start there. It may be hard to understand how it helps you if you don't understand the context of the problems it solves. Right now, focus on a specific language.
- thekevan 16y agoIf I went the Ruby/RoR route, I would learn Ruby then Rails. As well as LPTHW, another great resource is the MIT OCW course which teaches fundamentals using Python. Thanks for the help! http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/ http://ocw.mit.edu/courses/electrical-engineering-and-comput...
- 16y ago
- For_Iconoclasm 16y agoThere tends to be a lot confusion, with newcomers to any field, over which tools should be used. The truth is that 95% (made-up statistic... I mean a large majority) of the effectiveness of a tool comes from the user's proficiency, not the tool's intrinsic value. If you've heard of the language being used before being experienced and versed in the subject matter, it's probably good enough for your uses. I touched PHP in some college classes based on web programming, and one of the projects that I made actually got me my current job as a Python programmer at a very small company. The key here is that I was able to demonstrate what I was able to do with given tools; I wasn't given a quiz on the finer details of Python iterators or Tornado (the web server we use). Even if I had told them that I was interested in learning Python, but I wasn't great at it yet, I think they may still have hired me. As it was, I already knew Python. I really like Python. The syntax is wonderful; it's just a pleasure to work in. I once saw somebody post "If Python were any easier, it'd write itself." It's a general-purpose programming language, while PHP is mostly a domain-specific language (the domain being the web). Does that mean it's more powerful? Maybe. You probably won't get to a place in web programming where a single language will hold you back for a long time. Look at Facebook; it's written in PHP, but it's moderately complicated. Meanwhile, Hipmunk uses Python (with Tornado) on their backend. I can't think of any examples that use Ruby/On Rails because I don't really follow the language, but I know it's also wildly popular. Your evaluation of PHP hit the nail on the head. It's really popular in the job market, along with ASP.NET. I think Ruby on Rails and Python (Django) are becoming more popular. If the job market aspect is really important to you, maybe you can try looking up local jobs to see what your area offers.
- thekevan 16y agoThanks I appreciate your help. In my area, it seemed like more than half the jobs that mentioned one of the three were for PHP, followed by Python taking a little more than half of the remainder and Ruby taking the rest. (So loosely, out of 20 it would be about: 12:5:3). However that was on the common job sites that do not focus on tech and I suspect there may be more need for Python and Ruby is the hidden market than I am seeing. Just for reference here are some example of who uses Ruby and RoR: http://www.ruby-lang.org/en/documentation/success-stories/ http://www.ruby-lang.org/en/documentation/success-stories/ http://rubyonrails.org/applications http://rubyonrails.org/applications
- JCB_K 16y agoYour argument for PHP isn't really great. Both RoR and Python have a huge community, with more than enough people who are willing to help. If you want to be future-proof, I would skip PHP. It's getting used less and less, and also, RoR and Python are both much cleaner. Take a look at the 2 and pick one, actually it doesn't really matter, because once you're good at one of em, it'll be a lot easier to learn something else. RE: your remark about being hireable, I think it doesn't make a big difference either. Clients might be asking for PHP, but unless they want to use Wordpress, try to convince them you can build them the same in another language, in less time and with a better result. If they're still clinging to PHP you might want to ask yourself if it's really gonna be much fun working for them. Oh and if you want to be really trendy, ignore all of this and look into node.js ;)
- thekevan 16y agoMy argument for PHP may not be great, which is why I am asking the knowledgeable folks here on HN such as yourself. Thanks for taking the time to answer.
- MatthewPhillips 16y agoPHP is a C-like language so I'd go with that, even though I personally don't like PHP or ever use it. It will make it easier to learn other mainstream languages. Ruby, as great as it is, won't lead to understanding of other languages, too many abstractions (great for productivity though).
- thekevan 16y agoThank you!
- gexla 16y agoThis is an exaggeration but as a PHP developer the biggest problem I have with wrapping my head around Ruby is the Perl-ish "more than one way to do it" design. PHP seems to be more straightforward with relatively fewer paths to my destination. I haven't messed with Python, but I hear Python is more like PHP in that regard. If true, then it would make sense for a PHP developer to select Python over Ruby. The only major reason you might pick PHP over the other options is if you are interested in working with the major content management systems on the market. A huge percentage of business portals (brick and mortar as opposed to web based) are running on PHP based content management systems and of course there is also a lot of work in those areas. If you are more interested in custom application development, then Ruby and Python might be a more interesting choice (though PHP is plenty sufficient.) That's not to say that market size should be your only consideration. If you are strong player in a small pond, then you can do as well or better than you could do in a much larger market.
- thekevan 16y agoThanks very much. You raise some interesting points to ponder and investigate.
- madhouse 16y agoThere's a market for all three. Personally, I'd advise you to look at a few code examples, and pick the one that 'looks' best. If you need to, have a quick glance at a few tutorials, and decide which one you like best. You can't misfire all that much. (Though, I would advise against PHP, but that's just my personal hatred towards the php language and its interpreter, and is a very subjective opinion)
- thekevan 16y agoI did a little bit of the Rails for Zombies tutorial--knowing I was not ready for it. I got stuck pretty early. tryruby.org was much easier, but I did not finish because I had troubles with the site. I'll try it again. After all this input, I am leaning toward Python, but am still researching and gathering info. Both opinions from friends and I will try a few tutorials as you suggest. Thanks for your help!