Live data from Hacker News

PHP: A fractal of bad design

me.veekun.com

491–500 of 514 posts

Re: PHP: A fractal of bad design

#491
post #299

What's worse than PHP, people that complain about it. It's like a plumber complaining about copper in lieu of plastic, no one gives a shit, just get the job done. Sitting in your little complaint hole , no matter how well thought out, doesn't really help you does it?

Other plumbers might give a shit.

Besides, I enjoy analysis of programming languages, the good and the bad parts.

Re: PHP: A fractal of bad design

#492

300+ comments... seriously? PHP is a language with problems like all others (c, java, python, etc). It can be used for good or for bad like any other programing language. All the problems on the article are well known by decent programmers. PHP is out there, use if you want. Go write decent code... stop nagging.

What a useless parade of hand-waving.

If you actually read the article, you knew that one of the author's point was that PHP's problems are magnitudes of magnitudes worse than other languages in the wild.

That's more or less a matter of fact and that there are still people deny it just shows the sad state of PHP "programming" in general.

Re: PHP: A fractal of bad design

#493
post #332
post #280

Earlier quoted context omitted.

More programmers===better programs. How can this be a bad thing? I'm not sure this is true. Going with the articles example, that's like saying "the more people who know how to use a hammer, the better houses we will have".

It's true in the sense that giving everyone desktop publishing software in the early 90s led to lots of beautiful typography and well thought-out layouts.

I assume that you are being ironic, and you’re right: there was a lot of ugly graphic design in the 90s. This is partially due to the whole grunge-trend…

However: I think today we have more beautiful design that we would have had if the design tools had not become democratized, maybe not in percentage, but certainly in amount.

My speculation: programming --> more programs. Both crap and great ones.

Re: PHP: A fractal of bad design

#494
post #425
post #298

Earlier quoted context omitted.

I agree with the general point but this seems more of an indictment of other languages than a plus for PHP: with PHP, it's easy to get started with the most simple features - and then it takes years to learn how to cope with the language quirks and inconsistencies, deal with outright bugs, and learn a number of non-obvious ways in which your “working” site might be hacked due to a hidden language feature. There are t…

Maybe I'm missing something in your comment here, but - Python and Ruby already have smooth dev server installs. In fact, much smoother than PHP, as you don't need apache or fancy permissions to just run something local. Ruby, rails: "rails server" Ruby, sinatra: "ruby " Python, django: "python manage.py runserver" All of these spin up an app server on some port > 1024. I'm honestly not sure how it can get much easie…

Yeah, sorry I was unclear. In this case I was trying to get it working on a VPS.

The local stuff was indeed nice and simple.

Re: PHP: A fractal of bad design

#495
post #379
post #210

Earlier quoted context omitted.

Instead of automatically throwing a 500 on a random, unimportant, uncaught exception, PHP makes a best effort, and most of the time the result is fine. And how precisely does PHP "know" which exceptions are important and which are not? In my experience of 6 years as a web developer, the faster and the more explicitly something fails the better. If the user gets a 500, that's a pretty clear sign of a problem, I get an…

I understand fail fast, and errors do still get logged and made visible (New Relic is great like that). I would rather fail a bit slower, silently, though. It's much less jarring to users, and therefore you lose fewer.

It's less jarring for the users that you have to tell them weeks after they entered some important data that all this data has been lost? Is it less jarring if they order something and the order confirmation does not arrive and they don't know whether to try again or not?

If there's an issue that affects business logic I'd like my app to display "Sorry, something blew up. Please leave a message and we'll get back to you." instead of chugging along quietly. If the error is not critical (some external feed gone, whatever) _I_ as a developer can decide to catch the error and handle, log or even ignore it. But it's not PHP that can decide to do so.

Re: PHP: A fractal of bad design

#496

Earlier quoted context omitted.

As someone who goes to PHP when he needs to program for the web, and has been doing so for some 13 years now, seeing the horse beaten again didn't move me. I can't say I spent much time on your article, mostly because at this stage of my life, focusing on the negative doesn't earn you anything. I say that because, while it's clear you spent a lot of time on this, it's not really useful precisely because you don't pro…

PHP doesn't really have any strengths any more. The last one was ease of use and setup, but nginx and FastCGI seem to have beaten that too. The only things keeping it around as far as I can see are: * the huge lock-in with existing code + knowledge * network effects (aka. "Facebook and my mate Ken use PHP, therefore it must be good") * Most PHP devs don't know/want to know anything else. Like the post above says, lea…

First, do not assume that I only know PHP. I enjoy Python, and in fact, Erlang as well. =) Erlang is an especially nefarious little devil in that it almost makes me giddy with how it forces you to think.

I'll make the assumption you weren't talking to me, but rather, the general audience instead.

> Like the post above says, learn anything other than PHP.

Python is an excellent language to learn! I agree. However, people aren't interested in learning a language. Consider the context of my post, and the article, mind you. If you really want to help people choose a language, focus on the the accomplishment.

Case in point: Learn anything other than PHP.

That's the wrong approach. That's not good advice. In fact, that's horrible advice... for someone who wants to build a dynamic website.

And, frankly, if someone is looking to build a dynamic website, PHP makes that insanely easy. Much easier than anything else, especially when their hosting probably already has it up and ready to go.

So the challenge, as I see it, isn't to focus on "Not learning PHP", but simply saying "This is how you create dynamic websites" and use Python to do it.

You know the difference between most PHP tutorials and Python tutorials for beginners? PHP starts you out creating a dynamic website. Python starts you out using the REPL. 1+1 isn't going to inspire anyone. It isn't going to excite anyone.

But getting a form in place that displays the results? That's awesome!

That's the difference. I'm generalizing here, but I think it's a fair conclusion. I know their are articles for Python that focus on that, but they are far fewer then the ones you find for PHP.

And, with regards to this post we are discussing, the author really does just leave it at that.

Learn any language other than PHP is the worst advice you can give to someone who has an idea. They want to be focusing on the idea, not the installation or language. At that stage, they are focused on building, not the tools. You might argue (rightly) that the tools and material matter, but that isn't going to win you people choosing Python.

PHP being easy for beginners isn't just about the setup. It's the entire scope of the project, from the community, to the tutorials, to the software they are already using. If the only thing you focus on is installation, you won't succeed.

Sorry, this is a bit long. Hopefully my point is made.

Re: PHP: A fractal of bad design

#497
post #489

Earlier quoted context omitted.

>> Here where I live, about 80% of webdev jobs are PHP. I'm getting the impression that this is why a lot of people hate PHP - Money. People don't like that the market is full of money wasted on an inferior language. Perhaps there's a bit of envy in that, perhaps not. The winners in the marketplace aren't always the best, and it's not easy to change minds. People get religious about the things that make their living,…

No, it's not the money. It's comfort, and the opportunity for less compromises when picking jobs. I want to be able to choose between three Ruby/Python/whatever shops and pick one with the coolest people and coolest projects, rather than having one Ruby/Python and two PHP shops to choose from. And, unlike you, I don't think these articles are pointless. I hope they help PHP get more bad reputation among coders, and p…

To paraphrase something Neil DeGrasse Tyson said to Richard Dawkins: If you want to change someone's opinion about something, you need to be sensitive to the state of mind of the person you're trying to convince.

Bashing and negativity is not the way to do it.

You'll get much farther showing a PHP person something more interesting (whether it be Rails, Django, or whatever) and highlighting all the cool things about it. Because that person will not be on the defensive, his/her mind will be way more likely to have that 'Wow, that's so cool I should try it' moment.

Re: PHP: A fractal of bad design

#498
If we really need neat, clean implementations, why not avoid scripting languages altogether and go for structured, type safe languages? The developer needs to be much more learned and experienced, but in the end would the code will be high quality. But the fact is web needs cheap, fast implementation. No time to crib about warts and all. All web languages are results of duct tape mentality!

Re: PHP: A fractal of bad design

#499

Earlier quoted context omitted.

Sorry but that is quite hard to swallow. How are any of these not fit for building an MVP in 2012? http://silex.sensiolabs.org/ http://twig.sensiolabs.org https://github.com/nrk/predis There are also modern libraries for a plethora of other RDBMS and NoSQL systems (I think PHP is even going to support mongodb natively soon i.e. no third party client library required).

Please, the PHP industry is stuck on Wordpress and CodeIgniter which are amateur software. Yes, you can enjoy these wonderful modern tools for PHP at home meanwhile you suffer with old-tier libraries at work because everyone refuses to move forward.

Change where you work...

Re: PHP: A fractal of bad design

#500
post #432
post #365

Earlier quoted context omitted.

And again you make the same mistake. You take one solution, you say it doesn't work like your favorite solution (while obviously all proper solutions should be done exactly like the one you prefer, since there's only one right way to do anything and it's, not surprisingly, exactly the way you prefer) and you make it the fault of the language used for it's implementation. How that even makes sense? I write code in a n…

> How that even makes sense? Maybe my point wasn't clear. It's not a difference in how those two ORMs accomplish their goal; it's that PHP doesn't let you do what SQLAlchemy does, even if you wanted to . Want to write an ORM that uses YAML, XML, or comment annotation in Python? Great! Want to write an ORM that uses classes or objects as column declaration in PHP? Too bad. > Rehashing old tired "strpos doesn't have un…

So PHP does not have the same power as Python, just like Java. Yet I don't see people saying Java encourage writing bad code.

Different language has different limitation. Just because you can not have SQLAlchemy in C, does not mean C encourage bad code.

Post reply on HN