PHP: A fractal of bad design
431–440 of 514 posts
Re: PHP: A fractal of bad design
#432Earlier quoted context omitted.
> PHP makes it extremely easy to write ANY code. No. PHP makes it easy to write bad code and between normal and challenging to write normal code. This is why Doctrine , the closest thing PHP developers have to SQLAlchemy, needs three ways to declare table and column metadata: a separate YAML file, a separate XML file, and in PHP comments. All three of those methods are awful, and only one allows you to keep the metad…
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…
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 underscore and str_rot13 has, oh noes!!! I can't use language with missing underscore!!!" is really stale by now and doesn't contribute anything new.
Now I think you're just being petty. Obviously an underscore isn't what we're talking about here. Take your straw man elsewhere, please.
Re: PHP: A fractal of bad design
#433If this one thing that annoys me on HN it's the pervasive anti-PHP snobbery. A selection from the OP: > Because of the @, the warning about the non-existent file won’t be printed. So your complaint is that when you use @ to suppress an error it... suppresses the error? > The language is full of global and implicit state. "Global" is one of those dogmatic points. Nothing is truly "global" in PHP. The "global" in PHP j…
* PHP is open source. If you don't like it, change it. Or submit patches. Or bug reports
* PHP does what is says on the can. It's a hypertext preprocessor, and it does this exceedingly well
* If you're having difficulty doing complex work in PHP, you're using it for the wrong problem
The anti-PHP stance on HN is almost meme like. The lack of silly memes is why I respect HN over other aggregators,
Re: PHP: A fractal of bad design
#434Earlier quoted context omitted.
You may be able to do some fancy (i.e. useful and profitable) stuff in another language and show it to your boss. Maybe do this in your spare time while learning another language for fun. It may impress them!
No, that's why he hired me in the first place. He knows I can do all this fancy stuff. He just won't let me.
Re: PHP: A fractal of bad design
#435If this one thing that annoys me on HN it's the pervasive anti-PHP snobbery. A selection from the OP: > Because of the @, the warning about the non-existent file won’t be printed. So your complaint is that when you use @ to suppress an error it... suppresses the error? > The language is full of global and implicit state. "Global" is one of those dogmatic points. Nothing is truly "global" in PHP. The "global" in PHP j…
Plus if you to take a step back, and look at the fundamentals of PHP: * PHP is open source. If you don't like it, change it. Or submit patches. Or bug reports * PHP does what is says on the can. It's a hypertext preprocessor, and it does this exceedingly well * If you're having difficulty doing complex work in PHP, you're using it for the wrong problem The anti-PHP stance on HN is almost meme like. The lack of silly…
That having been said, I agree PHP does what it was designed to do, but has been leveraged into pretending to be a general purpose language (much like what happened with perl)... which it is NOT really good for.
Re: PHP: A fractal of bad design
#436Re: PHP: A fractal of bad design
#437Earlier quoted context omitted.
The thing is we need to stop advising people to use it in the first place. That's what we're advocating. That is, we're not telling people to stop after they've gone into McDonalds, we're decrying the fact that so-called health experts are telling people that McDonalds is actually just fine for you. That's a better analogy.
> The thing is we need to stop advising people to use it in the first place. That's what we're advocating. Who are you to advocate that? Or to advocate anything? I despise people who presume to know what's in the best interest of others. You only know what's in your best interest. You have no idea what is good for anyone else. You want to share your experience? Great. Do it when it's asked for. Nobody asked for a hit…
Wow. Are you seriously advocating the equivalent of moral relativism in programming? You have no idea if, say, Brainfuck is good for anyone else?
Re: PHP: A fractal of bad design
#438Earlier quoted context omitted.
> I, for one, hate throwing an exception when an item isn't found. This sucks: You can always do: index = a_list.index(a_value) if a_value in a_list else -1
There is even a built-in for that: >>> "foo".find("a") -1
Re: PHP: A fractal of bad design
#439Re: PHP: A fractal of bad design
#440Earlier quoted context omitted.
Obviously, since millions of people are using it it is preferable for them. Of course, this is only because they are too stupid to agree with you and have the exactly the same criteria and preferences that you have. It can't be that intelligent people can disagree with you on what is important and what is not in a language. It's clearly either you didn't explain it to them or they're too stupid to understand. Let's w…
It's just that the people who disagree generally aren't really programmars, they're designers turned quasi-web-developers. The community does them a disservice by pointing them at a giant pile of crap and saying "Go use this. You'll be fine."