Live data from Hacker News

Ask HN: PHP for Python programmers

news.ycombinator.com

61–70 of 77 posts

Re: Ask HN: PHP for Python programmers

#61

Earlier quoted context omitted.

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…

I'm not sure if it's an oversight or intentional but you didn't mention Lisp, which is, for many "snobs", the language of choice.

Re: Ask HN: PHP for Python programmers

#62

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.

And will be available for use on BigNameCorp's RHEL servers in about eight years.

Re: Ask HN: PHP for Python programmers

#63
post #30

The Kohana PHP framework source ( http://github.com/kohana/core ) is a great example of well-written PHP code. You can definitely get a sense of the "good parts" of PHP from reading through the code.

Really? Perhaps I just looked at the wrong time, but I was looking at Kohana last year and ran far away. The issue wasn't the core, but everything else around it - the plugins, the dev attitudes picked up from mailing lists, the release process and more.

IIRC, I wanted to use Kohana because of some specific plugins recommended to me. However, they were marked as only working in 2.4. 2.3 was in beta, but the consensus I got from IRC people was 'just move to 3 - it'll be released soon and that's where attention is being focused'.

The core code might be well-written, but that doesn't mean it'd be a good project to build on. It might be, but code alone is not the only factor to consider.

Re: Ask HN: PHP for Python programmers

#64
I realize the question was about language specifically, but something that wasn't really addressed in all these comments is the totality of the environment PHP will be used in.

PHP using a decent framework with properly unit-tested and documented code, a team of mid-level and sr devs, version controlled, good comments, a build process, and reasonable development schedules would be a joy to work with vs hacked-up Python thrown together by various people who don't know what they're doing with no process, docs, version control, test, where everything was due 2 weeks ago and people just develop on live servers. That would, simply put, be a nightmare, regardless of the 'purity' of Python.

I recently took on a project based on Rails. I saw some code - there were tests - some of the models I inspected looked decent. My initial view was "it's Rails - how bad could it possibly be?". It was/is horrible. However, once we'd commenced, I realized a) it's Rails1 (and was still being developed in Rails1 as of March 2010), there's 0 version control, no external docs, few internal comments, and 95% of the tests are either auto-generated skeletons only, or at the level of "Add 1 to the inventory, save, then check the inventory has increased by 1" (not checking any logic, just db code).

Parts of the code are - yes - more expressive that they'd have been in PHP. But, overall, the project is an abysmal mess. It's painfully apparent the original dev(s) didn't understand how to build software. They could 'sling Rails stuff together', but that's about where it stopped.

We've made a not too painful decision to rebuild, just using the old code for reference as to how screens should look. Rebuilding is being done in Grails (fwiw), and we're using a bdd approach (easyb) to get started. I was on the fence about using Rails/cucumber, but my skills aren't very strong in that, and we've got a deadline to meet.

I understand PHP isn't perfect. Coming from other platforms, there can be many 'gotchas' which catch people off guard. I've found moving from PHP to other platforms you find similar gotchas. It doesn't make every 'gotcha' automatic proof that PHP is crappy (a few do, but not all!) But again, the language, while important, should not totally define your view of the job or the entire ecosystem.

Re: Ask HN: PHP for Python programmers

#65

Earlier quoted context omitted.

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…

I'm not sure if it's an oversight or intentional but you didn't mention Lisp, which is, for many "snobs", the language of choice.

He should have mentioned Lisp, along with some other languages. However, I don't know how intentional that was, but he only mentioned languages used by the first kind of snobs -- those who are not familiar with great number of tools. Of course, I'm oversimplifying, but I'm sure that average Lisp, Smalltalk or Haskell programmer have used more languages than average C++, Java or PHP.

Re: Ask HN: PHP for Python programmers

#66
post #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 surpr…

Your post suggests that the only people who care about what language they use are the ones who did not use any languages other than the one they like the most.

That's simply untrue.

Re: Ask HN: PHP for Python programmers

#67

I realize the question was about language specifically, but something that wasn't really addressed in all these comments is the totality of the environment PHP will be used in. PHP using a decent framework with properly unit-tested and documented code, a team of mid-level and sr devs, version controlled, good comments, a build process, and reasonable development schedules would be a joy to work with vs hacked-up Pyth…

In the same boat right now with a Django project and couldn't agree with you more. Django is a decent framework but no framework or language will prevent a crappy mess if you're determined enough.

Re: Ask HN: PHP for Python programmers

#68
post #2

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

It's basically the equivalent of Python, Perl, Ruby, etc. It completely fits into that same niche as an interpreted dynamic language with OO capabilities. It's nowhere near as elegant as Ruby or Python, but similar concepts can be expressed with +-35% lines of code. So no, it's not actually low level at all. You don't have to do memory management. You don't have to declare variables. Arrays are not fixed sizes. It is compiled to intermediate bytecode... etc.

Re: Ask HN: PHP for Python programmers

#69
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 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."

That was my point actually. :-)

Just because you don't want to use PHP doesn't make you a snob.

Re: Ask HN: PHP for Python programmers

#70

Earlier quoted context omitted.

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

And will be available for use on BigNameCorp's RHEL servers in about eight years.

If then. Look how many BigNameCorps are still using ASP classic.
Post reply on HN