Live data from Hacker News

Ask HN: PHP for Python programmers

news.ycombinator.com

41–50 of 77 posts

Re: Ask HN: PHP for Python programmers

#41
post #7
post #3

The team that makes PHP makes quality a higher priority than just about any other language; if something is built into PHP, it's pretty likely to work correctly. (For example, PHP and Python have the exact same problems with threads, and the PHP team says "don't use PHP in a threaded environment" and the the Python people say "come jump in the water is fine") It's true that everything gets shoveled into one big names…

Seriously? Don't get me wrong, I could imagine valid reasons to use PHP. But the quality of the language itself is at the very bottom of that list. I don't usually hear PHP advocates making that case. Usually it's a combination of "the language isn't that bad" and "there are a lot of libraries for PHP".

To be fair, most languages don't start out as a hacked up bunch of perl scripts like PHP did. They have the benefit of a design process, versus PHP's history of I need it to do X .. hack hack hack .. there it now does X. Remember, PHP started out as one dude's quest to have a dynamic webpage. It's not like Ruby or Python where someone sat down and tried to think things all the way through.

So yeah, I don't think any sane PHP advocate is going to get in your face about PHP as a superior language. Because it's obviously not true and it really doesn't matter all that much.

Re: Ask HN: PHP for Python programmers

#42
I'm also a huge fan of Python, and I do believe that it (or other higher level languages like Ruby and Lisp) spoils you. I once took a well-paying job, but the main language used was ColdFusion - and not just ColdFusion, but a huge, complex, disgusting ColdFusion framework that the company had written themselves and was riddled with bugs. I figured I'd be fine because of the paycheck and the prestige of the job. Switching to a new language wasn't hard or anything, but I ended up only lasting a few months, then quit, taking a significant pay cut to get away from ColdFusion. I found that I just couldn't stand the stupid language.

I guess my point is, when deciding whether this is the right job for you, language is a very important factor. After a little time writing in a language you don't enjoy or respect, if you're like me, you're going to start to feel creatively and intellectually unfulfilled.

Re: Ask HN: PHP for Python programmers

#43

Don't worry about it. I was in a similar position a few months ago when I, a python programmer, was offered a perl position. Eventually you just get used to it, and you might even find things you like. I've stopped being as much of a language snob. Some features and most syntax are just decorative, and you'll adjust. The whole giant namespace thing would bother me a lot, but hey its worked for other people before.

This is pretty much the best advice. I began programming in PHP, and 95% of my web dev still uses it. (Though my latest project is using Python's Flask microframework.) I don't consider using it for anything else, even though PHP-GTK isn't too bad. My favorite language is Python, I've drunk heavily from the Scheme and Lisp koolaid, learning about programming games in C/C++ along with embedded systems that also use assembly here and there.

And yet, for my own anecdote, at the start of the summer I got a job where the main part of my work is creating a Flex front-end application with Java services running on Tomcat/Jetty for the backend, using SOAP (though we do have REST hooks too generated automatically) as a data transfer protocol. It's kind of ugly at first, since hey, it's Java, but really it's not bad and my "I wish this was PHP/Python" moments grow more and more infrequent.

Re: Ask HN: PHP for Python programmers

#44
post #3

The team that makes PHP makes quality a higher priority than just about any other language; if something is built into PHP, it's pretty likely to work correctly. (For example, PHP and Python have the exact same problems with threads, and the PHP team says "don't use PHP in a threaded environment" and the the Python people say "come jump in the water is fine") It's true that everything gets shoveled into one big names…

This particular conversation follows the PHP conversation template uncannily well:

http://www.reddit.com/r/web_design/comments/bxfok/9_useful_p...

Re: Ask HN: PHP for Python programmers

#45
post #23

Don't worry about it. I was in a similar position a few months ago when I, a python programmer, was offered a perl position. Eventually you just get used to it, and you might even find things you like. I've stopped being as much of a language snob. Some features and most syntax are just decorative, and you'll adjust. The whole giant namespace thing would bother me a lot, but hey its worked for other people before.

Just because you don't want to work with a language (especially PHP, dunno about Perl) doesn't make you a language snob. If you're closed off to any languages other than your preferred language, you're a language snob. That said, there's nothing wrong with programmers being picky about languages. Not only are languages what we're forced to think in day in and day out, but they affect what tools we can use, how we str…

Snobbery is defined as looking down on anything you consider inferior - for example in social classes, you can have middle class snobs without them thinking that every other class (including the upper class) are worse than them.

So no, I'd disagree with your definition of 'snob'.

Re: Ask HN: PHP for Python programmers

#46
post #16

Earlier quoted context omitted.

Magic quotes is also worth a mention. It's bound to throw anyone coming from another language for a loop.

Magic quotes has been disabled by default for several years. All you need to know about them are: disable them if enabled.

And if you can't guarantee they're disabled (e.g, if you're writing code to be used by other people), undo them at runtime as early as possible.

Re: Ask HN: PHP for Python programmers

#47
post #29
post #6

You'll be be fine. I've found it very easy to switch from/between C/C++/PHP/Python. Perl on the other hand...

C++? Strange. It took me time to learn seriously. I used to reread "Effective .* " every few months. Python/Perl/Ruby/PHP fill such a similar niche that I try not to go between them, because it would be boring. My personal plan is to next go Erlang, Perl 6 or some Lisp variant. Edit: Job offers for 2011 or so would be appreciated. :-)

Depends what order he learned them in. Maybe he already knew syntax from C and classes from Python before learning C++.

Re: Ask HN: PHP for Python programmers

#49
post #45
post #23

Earlier quoted context omitted.

Just because you don't want to work with a language (especially PHP, dunno about Perl) doesn't make you a language snob. If you're closed off to any languages other than your preferred language, you're a language snob. That said, there's nothing wrong with programmers being picky about languages. Not only are languages what we're forced to think in day in and day out, but they affect what tools we can use, how we str…

Snobbery is defined as looking down on anything you consider inferior - for example in social classes, you can have middle class snobs without them thinking that every other class (including the upper class) are worse than them. So no, I'd disagree with your definition of 'snob'.

Dictionary.com seems to see my point of view as being valid:

"a person who believes himself or herself an expert or connoisseur in a given field and is condescending toward or disdainful of those who hold other opinions or have different tastes regarding this field: a musical snob."

Regardless, if avoiding languages I consider inferior make me a snob then I'm happy to proclaim myself a snob.

Re: Ask HN: PHP for Python programmers

#50
You are going to have to learn what the shifted '4' and the unshifted ':' keys on your keyboard do. You might start practicing to build up those muscles.

(I just learned Python to give App Engine a spin. All my usual languages use semicolons, I finally stuck a little clay on the key to alert my brain when I pressed the semicolon.)

Post reply on HN