Live data from Hacker News

Ask HN: Is web programming a series of hacks on hacks?

news.ycombinator.com

61–70 of 688 posts

Re: Ask HN: Is web programming a series of hacks on hacks?

#61
>Can you recommend any good resources to help me orient my mind to this new way of thinking?

The thing about web frontend development is that it suffered from the browser wars and having to appeal to amateur developers. Amateur developers love "Worse is Better"[1]. Basically sacrifice all consistency in favor of simplicity and getting started quickly. "Worse is Better" makes things simple to the point of making ugly hacks for certain situations that don't fit that extreme focus on simplicity.

The browser wars made everything horribly inconsistent. Microsoft's strategy was to make the most broken non-standard code possible automatically work and everyone had to emulate that.

The most clean frontend development I've worked with was Angular with ScalaJS. Typescript in Angular 2 should be really clean. The underlying web browser stuff will never be cleaned up since it has to be backwards compatible.

[1] https://en.wikipedia.org/wiki/Worse_is_better

Edit: Replaced the JWZ URL with wikipedia. Apparently JWZ has some anti-hacker news redirect code on his site.

Re: Ask HN: Is web programming a series of hacks on hacks?

#62
post #37

It is scary how most commenters here are missing the point. No, not all programming sucks. Yes, web programming sucks more than other things. No, it doesn't have to be like this. Yes, even web programming was better 10 years ago. No, I don't know how to fix it. Neither do I know exactly where we took the wrong turn. One of my theories is this: had Sun not sued Microsoft over their extensions in JVM, MS would have kep…

Java had another big problem. It couldn't interact with DOM properly.

I mean, it could. But it was terribly hackish and anyways involved Javascript.

So you had one of two options:

1. Write an HTML webpage or

2. Write an empty webpage with a large Java applet in the center, which would be function as a "virtual terminal".

Both are ugly. That's why Sun created Java Web Start (IIRC), for complicated Java applications which could be loaded from the Internet.

Perhaps Google Docs could have done something like that, but I like the current UI more than the "potential Java Google Docs". The only thing Google Docs now can't do is Cntrl-S or something like that.

Also, don't forget the real reason (existing) Java Applets died - security.

Re: Ask HN: Is web programming a series of hacks on hacks?

#63
I'd love to know too, are there any frameworks that are at least more straightforward than React and Angular? One where you're not passing anonymous functions into functions with all sorts of confusing syntaxes, where you can just express what you want to do without having balance three types of punctuation that require the shift key to type.

Re: Ask HN: Is web programming a series of hacks on hacks?

#64
post #57

Earlier quoted context omitted.

I give it to you: npm is a Gran Bazaar mostly selling crap....but Node is brilliant.

I have been waiting for the dust to settle on the "Node is the worst idea of mankind" vs "Node is brilliant" before taking a look into it.

While you're waiting, there's always Golang...

Re: Ask HN: Is web programming a series of hacks on hacks?

#65

While I hate css, sort of like js and hate html layout, a lot of the problems come from accessibility. In that, it's so accessible anyone can do "web". This means you get non-engineers with no engineering background put into situations where thinking about things from an engineering perspective would really help and might produce actual workable solutions. Like wtf is this: https://www.npmjs.com/package/string.protot…

Errm...

- "test".indexOf("st") == "test".length - "st".length

- "test".enddWith("st")

Am I the only one who thinks the second one is WAAAY more readable? And that's a COMMON function. Using the former is bringing complexity UP.

Not to mention, endsWith is part of es2016 I believe. So this package is just a simple polyfill.

Re: Ask HN: Is web programming a series of hacks on hacks?

#66
post #24

Yes. I feel like we're in the dark ages right now. JavaScript - Dynamically typed, does not scale what so ever. Code written in it becomes 'read only' very quickly. Impossible to refactor. CSS - Also becomes impossible to manage. Who knows if the class you wrote is or isn't being used in HTML or JavaScript somewhere. Same problem, read-only, it only gets bigger and more unmanageable. HTML - At the heart of it, the fo…

This post makes me sad. Javascript, CSS and HTML can all be used powerfully, performantly and in a managed way where anyone can come on board and contribute. Facebook, Google and Microsoft all use the web stack to run huge companies. To broadly paint this web stack that so many people poured countless hours into making, as 'impossible' to use is doing it a great disservice. But hey man, that's just like your opinion.

People used COBOL to run large companies too. (Hell, they still do.) Doesn't mean it was particularly good for any definition of good.

Even the big companies can't do pretty basic things on the web, like justify text beautifully. It's not hard to imagine another world with much better typography on the internet. Ditto for better languages and a better layout system.

Most importantly, just because something has broad support and took a lot of effort does not put it beyond sharp criticism. That's no way to make progress and a perfect way to make entrenched worse-is-better technologies that managed to get popular even more entrenched.

Re: Ask HN: Is web programming a series of hacks on hacks?

#67
post #56
post #48

Earlier quoted context omitted.

Or it would have turned into ActiveX. Great on Windows, not so great (if extant) on anything else. If anything, Flash was multi-platform. You got the same flash on Linux, Mac and Windows. "Microsoft Java" would be anything but.

Sure, that's possible, but not necessary. Devs might have been smart enough to stay away from extensions. Microsoft might have been smart enough to not push it too hard. Your example of ActiveX actual supports that -- ActiveX never became super widespread, remaining a niche thing. Also keep in mind that this was only few years before OS X was released bringing the 2nd consumer desktop OS back onto the market.

Microsoft then had a near complete monopoly on anything computers.

If you remember how Mozilla had to include all the IE6 mistakes all web programmers assumed were standard?

And yes, back then definitely Microsoft was in EEE mode. They would do anything they possibly could do to keep the internet Windows only

Re: Ask HN: Is web programming a series of hacks on hacks?

#69

While I hate css, sort of like js and hate html layout, a lot of the problems come from accessibility. In that, it's so accessible anyone can do "web". This means you get non-engineers with no engineering background put into situations where thinking about things from an engineering perspective would really help and might produce actual workable solutions. Like wtf is this: https://www.npmjs.com/package/string.protot…

I don't understand the problem with those modules. Just because you can do something one way, doesn't mean you shouldn't add an easier and better to understand way. The intention of `string.endsWith('Blah')` is easier to understand then `string.indexOf('Blah') === string.length - 4`. Java String has both `indexOf` and `startsWith`, do you think that is also problematic?

Re: Ask HN: Is web programming a series of hacks on hacks?

#70
Yes, the web is a very messy place. Maybe a kind of wild west of programming practices?

But it's also a place where you can do a lot of things that no one has thought before. There are not many rules and a wide diversity of approaches. The web platform never had many of those approaches (e.g. complex web applications) in mind when it was created. It works somehow, anyhow. It's chaotic, yes, but also flexible and full of freedom.

To stay sane in this world, you have to voluntarily and deliberatly (!) reduce this freedom and create yourself some small sane pockets that you understand well enough and feel comfortable with. This can be done by increasing the abstraction level and restricting feature sets (e.g. ESlint), using Frameworks (React, Bootstrap, ...) and transpilers (TypeScript, Babel, Sass). Note that you're loosing freedom here and you're buing into other peoples understanding how a sane place of web programming should look like. In the Web there are a lot of ways to do things, there's no monoculture! And if you don't like the existing ways, roll out your own (though I wish people would be more careful / sceptical with this attitude).

And there's the backend. You've got all choices of programming languages and frameworks there. If you're making a mess of you're backend, you really can't blame the web for it.

For someone without much web experience, this process of choosing frameworks, workflows, toolsets just to get to one (of many!) sane programming experience is surely daunting. You have to choose and configure your envirionment yourself first, just to get started. You really need someone experienced to set this up and understand most of its implications. If you're having so bad experiences with your current web project, maybe some bad decisions were made regarding this. Or too much freedom (and therefore chaos) was left in place and got out of hand.

If you don't have the experience to make those decisions, you could just start with one approach that is pupular right now. I guess on hacker news this would be something like React, Babel, etc.. There are a lot of tutorials out there to put this all together.

Post reply on HN