Live data from Hacker News

Ask HN: PHP for Python programmers

news.ycombinator.com

51–60 of 77 posts

Re: Ask HN: PHP for Python programmers

#51
When I started programming I was using Visual Basic and Pascal. I miss those days because I was focused only on building things and was not aware about "Which is the best language" blog posts.

My suggestion is to not pay too much attention to those blogs and focus more on building things.

I'm sure PHP is a good language to build very good websites.

Re: Ask HN: PHP for Python programmers

#52
Think of PHP as a really amazing shell scripting language. Just as shell scripts can be glue for all the powerful UNIX utilities, PHP gives you APIs for just about any useful library you might need for web work. You won't be able to use your fancy Python chops for things like generators or itertools, but with luck instead you'll be running a bunch of powerful well-designed existing C code with a few function calls. Of course, a significant project will require a bunch of data & logic in PHP...

Also, the PHP source code is quite readable, for those times when the good online reference manual doesn't help.

Re: Ask HN: PHP for Python programmers

#53
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…

That is good advice, but what will PHP teach someone exactly? I don't believe it has anything interesting to offer someone who has learnt a number of languages.

All it has going for it is that it has low barrier to entry and is a commodity in terms of it's developer and low-end hosting. I consider these as good selling points for PHP but that is all I think it has going for it.

I think the social ecosystem of a language is very important, and I think there's more information and quality libraries in Ruby at the moment, so the popularity vote for PHP is a bit moot nowadays for web application development.

I try not to be a snob, I try to use 'the best tool for the job' but I don't think PHP is a very good tool. And I'm sorry but as someone who uses these tools all day I do not consider it a good tool.

Re: Ask HN: PHP for Python programmers

#54
I'm a Pythonista who had to deal with a client's legacy PHP codebase earlier this year. One tactic I used was to try to write all new stuff, where I could, in Python. Tasks that could be separate processes from their existing PHP stuff. For example, command-line tools, automation, supplementary web apps, etc.

Re: Ask HN: PHP for Python programmers

#55
post #2

not that I've written any python, but is PHP that much low level?

It feels a little bit lower-level than Python, in terms of the runtime, rather than the language. It also struck me as being lower quality in terms of their runtime, and their docs, than Python and several other languages I've used in recent years. Closest to amateur hour of all the languages in widespread use on the web, in my judgment.

Re: Ask HN: PHP for Python programmers

#56
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…

That is good advice, but what will PHP teach someone exactly? I don't believe it has anything interesting to offer someone who has learnt a number of languages. All it has going for it is that it has low barrier to entry and is a commodity in terms of it's developer and low-end hosting. I consider these as good selling points for PHP but that is all I think it has going for it. I think the social ecosystem of a langu…

I agree with this strongly. I was a PHP programmer for quite some time, a good one at that. I started itching to move away from PHP beacause I knew of its weaknesses and the expressive beauty of python. Long story short, I am now a web application programmer that solely uses python.

The argument that language choice doesn't matter, it's the engineer that matters, is very valid. I'm an excellent engineer in both and produce high quality working code in both. But python is clearer, more fun, and right.

Re: Ask HN: PHP for Python programmers

#57
post #22

Earlier quoted context omitted.

On the contrary. Language snobs have programmed in multiple languages. That's why they can clearly recognize a flaw when they see it. If you've always used a tool with the same flaw you likely don't recognize it as a flaw and just think that that's the way it works. Or you do kinda recognize it as a flaw but don't realize how much it slows you down.

I think there's more than one kind of language snob out there. Some of them have never programmed in more than one language, and so naturally think that language is the best. Some don't regularly program in any language, and take whatever fad du jour is on Reddit as gospel. But others have programmed in lots of languages, and have tried the languages in question, and that's why they think it sucks. It can be difficul…

Well put. I've seen many people who will be quick to jump and say Java|C++|PHP|Ruby|Python|C# is the BEST AT EVERYTHING EVER because the Internet tutorial they took told them so. These people are so common that having opinions on a language is something that you actually need to be careful what remarks casually about, lest you be branded an uninformed idiotic language bigot. Most languages in wide use are there for a reason, but that doesn't mean any and all opinions on them are invalid.

Re: Ask HN: PHP for Python programmers

#58

If `BigNameCorp` writes a lot of PHP seriously, you won't notice that many problems. It's not going to be PHP anymore. It's going to be Symfony, Zend, Cake, or something else (maybe even some proprietary, internally used framework). It isn't that easy to find pure-PHP code these days - it just takes too much time to write. If you do however see an old-style "let's just include everything", "global variables are cool"…

Array dereferencing in is the trunk and will be available in 5.4.

Re: Ask HN: PHP for Python programmers

#59
PHP is an okay language. I'd never choose it by myself, but most of the time it is bearable. The language is not the problem though - it's the people.

PHP breeds mediocrity in such a superb way, it's rivaled only by Visual Basic. It attracts many dumb people and, chances are, you will meet many of them on your new job.I won't go as far as telling you to stay clear of the job - just have that in mind when deciding.

Re: Ask HN: PHP for Python programmers

#60
Programming languages are tools of the trade and no different than tools in any other field. If it's a good job then it is a good job. If the job requires you to work with PHP, then that is a lesser consideration that is barely worth mentioning. Good coding can be done in any language even crusty COBOL or LISP. After you learn the PHP syntax, then you won't think about it anymore. In a few weeks time, you'll be surprised that you were worried about something so trivial as the programming language used.
Post reply on HN