Live data from Hacker News

PHP Addiction

marco.org

41–50 of 320 posts

Re: PHP Addiction

#41
"...next language choice was clear: Python, which seems to fit my style better than Ruby"

Just out of curiosity, why would someone believe this? The syntax of python and ruby are nearly identical, but ruby has more tools and support for web-based projects. For someone looking to develop for the web, ruby is pretty clearly a better choice. And this is not knocking python at all, I really enjoy them both and there are many other things python has more community support for - don't get me wrong.

To support what I'm saying about the syntax, check out this comparison: http://hyperpolyglot.org/scripting - they are super similar, if anything ruby is a tiiiny bit more elegant.

Re: PHP Addiction

#42

Yeah, I wrote Tumblr in PHP, but I'm eager to abandon it. You know, it's just an easy to use, broken language that you can scale a site to 15 billion page views per month with. I'm sure my next project will need a better language, because it's going to scale to 400 billion page views per month, and PHP just isn't going to cut it. Hilarious suggestions contained throughout his post.

Where did he say anything about scaling in the article?

Re: PHP Addiction

#43
post #7

I'll sound like a broken record, but I'm convinced Flask is the perfect transition. It's built for smaller web apps, and rapid prototyping. The system of mapping endpoints to functions is incredibly intuitive -- if you've used Python before, learning Flask is incredibly easy.

The problem is, not all PHP apps are small rapid prototypes. If I'm going to migrate away from PHP, might as well go all in. Does that mean something like Django?

Most people recommend Django over Flask for larger projects. Personally, I've used Flask in bigger applications as well, and its a trade off -- Django saves you time with its app system, bundled ORM and MVC architecture, and the omnipotent admin interface, so you spend very little time reinventing the wheel. On the other hand, my raw speed of development is better with Flask (and I prefer Flask's debugging tools as well).

That being said, for a 'big' project I'd recommend Django over Flask, if for no other reason than googleability -- if you run into a particular error or question, Django's community (due to size) is probably going to be more helpful than Flask's.

Re: PHP Addiction

#44
"Whichever language I choose to replace PHP will have its own problems that will take me years to master, but by the time I know whether I chose the “right” language, I’ll have invested far too much time in it to practically switch any meaningfully sized project to another language: exactly the situation I’m in now with PHP."

Something that I'm not seeing people take into account generally when they decide to develop in a "new" language or complain about any established language additionally is how far along that new language is and how many people know it well. Choosing the best thing also involves how easy it is to get the help of others. An analogy might be an automobile purchase. If you are located in the middle of nowhere it might be a better idea to buy the Honda where there are multiple local dealers rather than the NewGreatAuto (pick any car with less market share that is better price and feature wise) where you have to travel 50 miles each way for warranty service.

I went through this with hardware back in the 90's choosing SGI servers that were better price and performance wise than Sun, only to find that many open source software ready to run was not available for SGI. And that there were less people that knew IRIX than Solaris.

Re: PHP Addiction

#45
I've had a similar issue and have even come up with some suggestions myself[1], but really I think there is only one company in the right place to produce a serious PHP competitor. Facebook.

They have the man-power required to displace it, as well as the serious need... although the only potential solution they have come up with HipHop / HPHPi is really lacking in community support. Its open source but rather undocumented, and took an entire day to get set up.

If they could produce a viable alternative to PHP... something that fixes the clear fuckups but doesn't try to fix everything I think it would have a real shot.

[1] http://davelang.github.com/

Re: PHP Addiction

#46
post #27

Earlier quoted context omitted.

Do you want to provide an application that anyone can run and easily deploy on their own server with as little configuration as possible? Oh. I hate PHP as much as anyone (of course), but that's what it does.

I wonder if the better course of action would be to lobby the major hosting providers to include Ruby and/or Python with their base plans. Really, isn't that one thing that keeps PHP chugging along? In the consulting work I've done, my clients already have hosting plans for their website, so if I'm adding a sub-app, or even a new app, trying to convince them (and their IT staff) to manage multiple hosts/plans/etc is…

I think the problem is that the virtual hosting model doesn't work well for platforms where every site is a running app instance. Who starts the processes? How do you restart them when the code changes (some platforms don't do this)? Who assigns port numbers? etc etc etc.. With PHP, whose execution model was kind of built with this in mind, this works out of the box very easily.

Re: PHP Addiction

#47

>the first question that comes up is what to use instead, and they’re met with a barrage of difficult choices and wildly different opinions and recommendations. The real answer is "it doesn't matter". Of course python people will try to convince you to use python, and ruby people will try to convince you to use ruby. But both groups will agree that either language is far better than PHP. And as someone who likes neit…

There's no "wrong choice" to worry about. Famous last words ;)

Re: PHP Addiction

#48
post #29

How do PHP people handle templating simply? Edit: Perhaps I worded my question wrong. How do PHP programmers try and keep to DRY (ala layouts and view templates)?

Smarty is the default choice, but of course you can simply require("tmpl/$LANG/index.php") - PHP's short tags like are almost as simple as Handlebar's.

Re: PHP Addiction

#49
post #13

That's one of the problems with the now-famous Fractal blog, I think: It was a joy to read in the sense that being a Python programmer, it only heightened my appreciation of the achievement that languages like Python and Ruby represent. It's what conscious, determined design gets you and what mistakes they managed to avoid. But it's preaching to the choir. If you've never seen anything other than PHP, you won't under…

> How do we communicate effectively what makes other languages better to someone with no reference frame other than PHP itself?

You're trying to convince yourself that you made the right choice, the right investment.

That's sad.

Have confidence in yourself. You made the right choice for yourself and let others choose for themselves.

There is no universal proper language or platform to use.

PHP works and it works extremely well for many companies. Its commercial success is not debatable.

Python on the other hand ... aside from Google, who's using it at a massive scale? Even Google has been shifting to Java for a long time.

See how that works?

Let's stick to the old parable. A proper tool for every job. If you're convinced that there is no proper application for PHP, then you're not even trying to be objective ... you're just trying to make yourself feel better about the choices you made.

Re: PHP Addiction

#50
post #41

"...next language choice was clear: Python, which seems to fit my style better than Ruby" Just out of curiosity, why would someone believe this? The syntax of python and ruby are nearly identical, but ruby has more tools and support for web-based projects. For someone looking to develop for the web, ruby is pretty clearly a better choice. And this is not knocking python at all, I really enjoy them both and there are…

Having done substantive work in both, the most significant difference that for me favours Python is that every module explicitly imports the names that are accessible within its namespace (barring use of 'from X import *' which is generally discouraged). In comparison I found it a real pain to track down definitions of specific names in a complex chain of 'require'd Ruby code.
Post reply on HN