Live data from Hacker News

Ask HN: Bet the farm. Python or PHP?

news.ycombinator.com

21–30 of 106 posts

Re: Ask HN: Bet the farm. Python or PHP?

#21
post #10

Go with Python. PHP is probably the worst language I've had to use (Single namespace, poor unicode...) Python on the other hand is pretty cool. It can be OO, functional, or procedural depending on how you want to look at it. It also has a lot baked into the standard interpreter and has some really awesome frameworks (Django, Pylons)

Single namespace in PHP - Ouch. You can gracefully get around this with classes perhaps?

Any thoughts on PHP frameworks?

On Python, I've heard that TurboGears is a pretty good framework as well.

I remember reading somewhere that you don't run Django, it runs you. Any fiction in that?

Re: Ask HN: Bet the farm. Python or PHP?

#23
Python. For a lot of reasons. It's easy. It has a lot of libraries. The Python based CMSs are better. And most importantly it's easier to find decent python programmers. The vast majority of PHP guys I have interviewed ONLY know one language: PHP. The python guys tend to be much more well rounded. Of course the PHP guys are usually cheaper. You get what you pay for in this case. I would also have to recommend against perl. I did perl for 10 years before I switched to python 4 years ago. I think their philosophies say it all: Perl: There's more than one way to do it. Python: There's one obviously right way to do it. Sure, that's a huge generalization but I find it true in a lot of cases. Perl really is line noise compared to Python. And reading someone else's Perl is a real challenge.

Re: Ask HN: Bet the farm. Python or PHP?

#24
calendar/scheduling/notifications with some social networking and people matching/search functionality. The site will be highly configurable/maintainable by its community from establishing/interacting within groups to tweeking page layouts.

How much of your app can be built by hooking together existing Drupal modules?

If the answer is "lots" -- and because your brief description sounds like a long list of stock parts from the Social Network aisle at Costco, I wouldn't be surprised if it is -- perhaps you should consider Drupal. Which means PHP, alas, but that's a small price to pay for avoiding the annoyance of building every single one of your site's 120,000 proposed features yourself, from scratch.

If the answer is "a lot, except for features X and Y, and I hate Drupal's existing, buggy options for Z" the Drupal community will be really happy to see you develop and contribute open-source code that can do X and Y. And we probably all hate Z, so fix it and you'll be our hero. You'll have plenty of time to work on Z because you won't be spending time redeveloping things like "basic user logins with emailed password reminders", or "users can create and join groups which have their own subsites" from scratch -- yet again -- in a language whose idioms you haven't learned yet.

If the answer is "not much"... may I suggest that you seriously reduce the scope of your first project?

Of course, if the proposed app is less of an actual future product than it is an excuse to broaden your mind by learning a language that's not Perl or Java, you should probably grab onto Python or Ruby with both hands. PHP has many practical features, but it doesn't have much to teach a Perl programmer.

Re: Ask HN: Bet the farm. Python or PHP?

#25
post #21
post #10

Go with Python. PHP is probably the worst language I've had to use (Single namespace, poor unicode...) Python on the other hand is pretty cool. It can be OO, functional, or procedural depending on how you want to look at it. It also has a lot baked into the standard interpreter and has some really awesome frameworks (Django, Pylons)

Single namespace in PHP - Ouch. You can gracefully get around this with classes perhaps? Any thoughts on PHP frameworks? On Python, I've heard that TurboGears is a pretty good framework as well. I remember reading somewhere that you don't run Django, it runs you. Any fiction in that?

you don't run Django, it runs you

I use Django (GeoDjango actually) at my full-time job, and love it. My progression was PHP -> Python -> TurboGears -> Pylons -> Django. I can say with confidence that it is the best of them all. Yes, many choices have been made for you, but they have been made in an elegant, Pythonic way, and you retain the ability to get under the hood to a healthy extent.

Re: Ask HN: Bet the farm. Python or PHP?

#26
post #20
post #16

Why are you determined to use either Python or PHP in this latest project? I would make sure you have a good answer to that question before using something besides Perl.

I actually know Perl and Java pretty darn well. I wish to constantly expand my understanding of computing in general, and learning a new language is a great way to go. I hope to not only learn a new syntax or two but also learn to think in different ways. This works with human languages, too. Yosh!

Ah. Ok, then that makes things easier.

For your case, don't use Python, nor PHP. Both are pretty much just like Perl and Java with only minor syntax changes.

If you want to expand your understanding of computing in general, while also learning a new language, and while doing a webapp, if I were you I'd learn Common Lisp and try out Hunchentoot. There's even some screencasts for that setup floating around.

Going with Python or PHP after Perl and Java is not going to be terribly enlightening for you.

Re: Ask HN: Bet the farm. Python or PHP?

#27
Python. It is more powerful with an extremely flat learning curve. In other words, you don't hit many walls with it. When you want to do something more powerful, the answer is 'right there'--it fits the brain.

This is a bit dated but may help: http://www.artima.com/intv/prodperfP.html

Re: Ask HN: Bet the farm. Python or PHP?

#28
I loooove Python. But if asked to "bet the farm" on a web app, I'd go with PHP because it's been successfully demonstrated again in again in every form of web app you can imagine. In a year, I'd recommend Python, but I still find Django and the other web frameworks a bit too immature and clunky to do things that PHP has been hacking with for years and years. As much as I hate to say it, for the Python community the web server has been an afterthought until the past two years. PHP was bred there.

I probably would say it's a closer call if we hadn't found a great MVC framework for PHP called Code Igniter that just makes PHP (of all things) much more pleasurable to hack in than it used to be.

All this being said, you're not risking much by going with Python/Django. But if the farm is on the line, I'd personally have to go with LAMPhp.

Re: Ask HN: Bet the farm. Python or PHP?

#29
post #11

Earlier quoted context omitted.

Neither PHP nor Python have anything approaching CPAN. Ruby is slightly closer with Gems, but even that's a joke compared to the might of Perl libraries. Seriously, that's the big thing that's missing. Other than that both PHP and Python are prefectly servicable, although you're going to have an easier time finding smart Python developers than smart PHP developers (Blub hiring paradox).

And perl has nothing approaching Python's readability. Perl may be easier to start with now but in 6 months, it will become a major headache. Read http://www.linuxjournal.com/article/3882 . Using Python would be an excellent choice imo.

Python being readable is FUD. I've seen tons of horrible Python. Of course, I've also seen tons of horrible Perl (and PHP, and even Lisp).

Basically, in the hands of incompetent programmers, everything is unreadable. If you are disciplined, you can write easily-readable Perl. I (and my coworkers) do it every day.

Oh, one other thing... the linked article is from 2000. In the last 8 years, the Perl community has figured out how to program... so most of his points aren't relevant anymore. Nobody writes 2000-style Perl anymore.

Re: Ask HN: Bet the farm. Python or PHP?

#30
post #17
post #8

Python... both languages are along far enough that they will meet all four of your points, but people that program in python are on average better programmers than PHP programmers. So it makes hiring good hackers easier by eliminating many of the bad hackers. Other than that, if you like the syntax of PHP, it is as good as python as long as you program using the MVC paradigm. Personally I like the syntax of python a…

I guess, for a lot of people, PHP would be easier to dive into than Python? I get your point; without any other knowledge, you'd be better off selecting from a pool of Python developers than PHP developers when looking for good hackers. Correct? Although I would be able to somehow separate the good hackers from bad by initially chosing Python, would you say that good hackers would also stay clear of opportunities whe…

You won't find any PHP hackers. The good PHP developers realized that PHP was a waste of their time a long time ago. All the novices have significantly lowered the average PHP developer's salary compared to other languages. Basically, there's no skill and no money in PHP, so the good people don't use it.
Post reply on HN