Most active commenters
  • vezzy-fnord(5)

←back to thread

276 points chei0aiV | 27 comments | | HN request time: 1.303s | source | bottom
Show context
n0us ◴[] No.10458463[source]
I really could do without "considered harmful" titles. x86 has been one of the most influential technologies of all time and a clickbait title doesn't do it justice imo.
replies(7): >>10458515 #>>10458617 #>>10458692 #>>10458787 #>>10458861 #>>10459018 #>>10459478 #
1. wyager ◴[] No.10458692[source]
So were PHP and goto statements.

How influential something is has nothing to do with how good it is.

replies(2): >>10458720 #>>10459089 #
2. vezzy-fnord ◴[] No.10458720[source]
goto is just a mnemonic for jmp. It's the primitive from which all higher level control flow is ultimately derived. It isn't harmful, and it's used a lot even in C.
replies(4): >>10458822 #>>10459151 #>>10459176 #>>10459619 #
3. duskwuff ◴[] No.10458822[source]
You're missing the reference - Dijkstra wrote a famous letter on GOTO in 1968 which was published as "Go To Statement Considered Harmful":

https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF

In context, it was a piece advocating against the use of GOTO to the exclusion of all other control structures (e.g, 'for' or 'while' loops, etc).

replies(1): >>10458914 #
4. vezzy-fnord ◴[] No.10458914{3}[source]
I appreciate you thinking I'm a buffoon who was born yesterday and hasn't heard of EWD215, but it appears your reading comprehension is, to be charitable, iffy.

wyager's statement, involving PHP (for which there is not a famous "considered harmful" essay to the best of my knowledge, though there is "A Fractal of Bad Design") and goto statements, was a rather clear implication that both constructs are innately harmful in an attempt to counter n0us' assertion that influential/popular technologies imply a high quality. There was nothing said about using goto statements in presence of structured programming, but merely goto as an intrinsic badness. This is a common belief cargo culted by a many naive commentators and XKCD readers who do not realize that all control flow is derived from goto, and moreover that even in some languages with structured control flow it is still useful, e.g. for resource cleanup and breaking out of nested loops.

replies(2): >>10458994 #>>10459406 #
5. garrettgrimsley ◴[] No.10458994{4}[source]
>Be civil. Don't say things you wouldn't say in a face-to-face conversation. Avoid gratuitous negativity.

https://news.ycombinator.com/newsguidelines.html

replies(2): >>10459051 #>>10462951 #
6. vezzy-fnord ◴[] No.10459051{5}[source]
My statement was neither something I wouldn't say face-to-face, nor gratuitously negative.
replies(1): >>10459516 #
7. jrcii ◴[] No.10459089[source]
The PHP bashing on this site is untenable. PHP has no intrinsic properties which stop a good programmer from writing elegant code for web applications. It's a tired discussion, I know, but the most you can say is that it's frequently abused. The oft cited "Spectacle of bad design" essay has been credibly rebutted point-by-point by other authors.
replies(4): >>10459463 #>>10459537 #>>10460258 #>>10461205 #
8. mortehu ◴[] No.10459151[source]
> [goto] is the primitive from which all higher level control flow is ultimately derived

I'm pretty sure you cannot implement conditional branches using unconditional branches as a building block. Unless you count indirect branches, which goto usually doesn't support.

replies(1): >>10459382 #
9. ska ◴[] No.10459176[source]
That largely misses (Dijkstra's, originally) point. How control flow is implemented at a low level (e.g. jmp/lngjmp) is a completely separable from how it should be exposed in a language.

Wearing a c programmers' hat you may say "absolutely", a scheme programmers' hat, perhaps "no way". Horses for courses after all.

replies(1): >>10459238 #
10. vezzy-fnord ◴[] No.10459238{3}[source]
That's a more nuanced position than the one that is commonly understood, however. Though, you are always bound to your architectural model, so exploiting it more directly is not innately bad. Layers tend to be leaky.

Wearing a Scheme programmers' hat, call/cc isn't any less of a landmine.

11. taeric ◴[] No.10459382{3}[source]
Not that I'd recommend it, but sure you can. Just allow modification of the code to include where you want to jump to. :)

Scarily enough, I think this used to actually be somewhat common place and is why many functions were not reentrant.

12. hyperpape ◴[] No.10459406{4}[source]
Isn't that more aptly stated as "implemented with" not "derived from"?
replies(1): >>10459469 #
13. mamcx ◴[] No.10459463[source]
When some insist to use C++/JavaScript/PHP/MySql/Mongo/etc (tools with bad design/complexity/bug-prone/etc flaws) with the excuse that is possible to use them "well" if only we are more "disciplined" and "pay attention"?

When bad tools are bad, discipline is not the answer. Is fix the tool, or get rid of them.

Why developers understand that if a end-user have a high-error rate in one program is a problem with the program but when that happend with a language/tool for developers... not think the same???

"Good programmer" is almost a keyword in this context as "someone with the experience with for workaround and avoid the pitfalls that a tool is giving to him, plus also do his job" when is better if "someone that can concentrate in do his job".

Of course, workaround the pitfalls of tools is unavoidable in a world where "worse is better" have win. But why persist on this?

replies(1): >>10461252 #
14. vezzy-fnord ◴[] No.10459469{5}[source]
Assuming a von Neumann or modified Harvard architecture where execution advances from an incremented program counter, I'd say derived from, though it may be that the former is more appropriate. It is certainly not universal, I do not make that claim.
replies(1): >>10459562 #
15. hderms ◴[] No.10459516{6}[source]
It comes off as unpalatable, to say the least. You were assuming malice in the other poster and then went on a minor tirade without sufficient prompting.
16. pizza234 ◴[] No.10459537[source]
It's hard to take seriously a statement about an article, where even the referenced title is wrong.

It's not nit picking - it shows how one didn't even took them time to read and understand the article; it's "fractal" of bad design, and it's named so for a specific reason.

17. hyperpape ◴[] No.10459562{6}[source]
The program counter doesn't typically appear in the programming languages that have (or don't have) goto. You're talking about implementation, but I think people typically criticize goto in terms of semantics (iirc, I can include Djikstra in that camp, but I never made a super-careful study of that paper).
18. Retra ◴[] No.10459619[source]
It's a matter of scale. If you're trying to compute absurdly large numbers, you'd be a fool to use addition, even if it is fundamental to some other operation you want to use. Goto is problematic not because it can't be used effectively, but because it won't be. Because it doesn't encapsulate a powerful enough abstraction to make computers smarter or programs easier to write and understand.

If you have to write a goto, you can drop into assembly. Don't add it to your high-level language, because it doesn't add anything there, it just gets in the way.

"It's the primitive from which all higher level control flow is ultimately derived."

There are a billion alternative primitives from which you could derive all the same things. Goto is not special. And it is so primitive, it is not hard to write something else and have a compiler translate it. You shouldn't need goto anymore than you should need access to registers.

19. wyager ◴[] No.10460258[source]
>PHP has no intrinsic properties which stop a good programmer from writing elegant code for web applications.

Nor does x86 assembly. What is your point?

20. nickpsecurity ◴[] No.10461205[source]
Actually, if you start with good measurements, many clear reasons appear that PHP is a terrible language. A nice write-up is here:

http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

It's amazing how much has been done in what was essentially a pile of hacks on top of a pre-processor making it pretend to be an application language. That pro's avoid it and its wiser users almost always leave it eventually further corroborates the author that it's fundamentally bad. If anything, it's one option among better ones (Python, Ruby) for non-programmers to get started in web apps. Little reason to use it at this point with all the 3rd party components and communities around better languages.

replies(2): >>10462133 #>>10469376 #
21. AnthonyMouse ◴[] No.10461252{3}[source]
> Of course, workaround the pitfalls of tools is unavoidable in a world where "worse is better" have win. But why persist on this?

Because the unstated alternative is a false choice. It would be nice if all of the code written in poorly designed languages would disappear and be replaced with code in better designed languages, but that isn't realistic. Migrating a large codebase to a different language is very expensive and introduces fresh bugs, less popular languages aren't supported by all platforms and libraries, and large numbers of people have made significant time investments in learning languages that are popular even if they aren't very good. So the old languages aren't going away.

Given that, it's better that we teach people the pitfalls of the things we're stuck with, and improve them with things like std::unique_ptr in C++ or safer SQL APIs that discourage manual parsing of SQL statements, than to pretend that there is no middle ground between continuing the tradition of bad code and the fantasy of rewriting essentially all existing code from scratch overnight.

replies(1): >>10462399 #
22. ◴[] No.10462133{3}[source]
23. mamcx ◴[] No.10462399{4}[source]
Yeah, short term is the right thing. But I'm talking about why stay in the same loop DECADES? Because the pile of mud is bigger with each iteration. Eventually, I think, the cost of a clean start will be far less that push ahead.

I don't underestimate the problem (I work in the LESS progressive area of programming: Internal Business apps / apps for non-startups, non-sexy-games-chat-scalable-apps!) so I'm full aware...

But what drive me crazy is that is developers that defend their tools as "them are good! why bother!", not because them use the business/cost defense...

So, yeah... let's not rewrite everything that is working right now. But also, a lot of time we can choose what to use, special for new projects... at least pick well next time...

replies(1): >>10462617 #
24. AnthonyMouse ◴[] No.10462617{5}[source]
> Yeah, short term is the right thing. But I'm talking about why stay in the same loop DECADES? Because the pile of mud is bigger with each iteration. Eventually, I think, the cost of a clean start will be far less that push ahead.

The pile of mud has network effects. Even when you're starting from scratch, you're not really starting from scratch. The world is built around the things that are popular. Everything is better supported and better tested for those things. If you create a new language, it not only needs to be better, it needs to be so much better that it can overcome the advantages of incumbency. Which is made even harder when the advantageous characteristics of new languages also get bolted onto existing languages in a way that isn't optimal but is generally good enough that the difference ends up smaller than the incumbency advantage.

Which is why change happens very, very slowly. We're lucky to be essentially past the transition from Fortran and COBOL to C, Java and C++.

25. asveikau ◴[] No.10462951{5}[source]
The comment being replied to was also rather uncivil by a certain definition, assuming the commenter was unfamiliar with what is by now very cliched literature and explaining it in a somewhat condescending tone, as if to a child, when in truth there was a very substantive point being made.
26. jrcii ◴[] No.10469376{3}[source]
I don't think it's a nice write up, in fact it arguably miscalculates every point it makes. It's exactly the article I was referring to in my original comment as having been thoroughly refuted, in (correct) anticipation that someone would bring it up, since it seems to be the only go-to source for PHP bashers.
replies(1): >>10473334 #
27. nickpsecurity ◴[] No.10473334{4}[source]
That's a troll comment if I've ever seen one with even less information than what was in the linked article. Your comment actually has no information: a mere dismissal.

On opposite end, my link was at least clear on attributes of a good language. These were specifically mentioned: predictable, consistent, concise, reliable, debuggable. The author gave specific examples showing PHP lacks these traits. An analysis of Python or Ruby show them to embody these traits much more while also possessing the supposed advantages PHP fans tell me including easy learning, many libraries, huge community, tools, etc. So, the evidence indicates PHP is a poorly designed language (or not designed at all) while some competitors are well-designed languages with most of same benefits.

Other authors say about the same about both philosophy and specific details showing why PHP is a pain to work with if you want robust software along with building skills a good developer should have.

https://www.quora.com/Why-is-PHP-hated-by-so-many-developers

http://phpsadness.com/

https://blog.codinghorror.com/php-sucks-but-it-doesnt-matter...

Truth be told, though, the burden of proof is on you PHP supporters to show why PHP is a good language and people should use it. I claim it was a mere pre-processor that had all kinds of programming language features bolted onto it over time to let it handle certain situations. That's not design at all. Python and Ruby are designed languages with consistency, core functionality for many situations, extensions/libraries, and optionally the ability to pre-process web pages. World of difference in both language attributes and quality of what people produce with them. So, not only have you presented no evidence of PHP's alleged good design, I've presented evidence against it and for two competitors have better designs.

Feel free to back up your claims with some actual data rather than dismiss whatever data anyone else brings up. I mean, you want to dismiss the guys ranting feel free. Can even edit all that crap out to leave just the data and arguments. Same for other links. Resulting text still supports our claims against PHP. So, status quo among professionals should be "PHP Is Garbage" that leads to buggy, hard to maintain, insecure, slow software. It will remain until PHP's community proves otherwise and demonstrates their counter-claim in practice with apps possessing the opposite of those negative traits.