Live data from Hacker News

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

news.ycombinator.com

51–60 of 688 posts

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

#51
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.prototype.endswith https://www.npmjs.com/package/ensure-string-endswith

str.slice, str.indexOf are standard lib. Adding another layer of complexity for basic string functions that could easily be done natively is very poor form. This kind of stuff happens all the time in the web world. There's a layer of "lack of competency" bootstrapped on top of what I would consider a non-intuitive base.

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

#53
post #14

I don't know what are you referring to as hack on top of hacks? There are tons of big open source and closed source web based project that are easy to follow what's going on and everything is well structured. Look at VSCode code base [1] or if you're a Googler look at Google Photos source code. People look at React and Webpack and all these small little modules that people put together to make something work and thin…

I think the question then becomes: How do I make my code more like VSCode and less like, well, everything else?

I'm not sure the answer is as simple as "use typescript".

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

#54
You can't really compare "web development" to "application development". I think it's more fair to compare a single web framework with a single native framework. The web ecosystem of frameworks is much larger, meaning there are far more options, much more to adapt to if changing projects. Switching from a well-written iOS codebase to a well-written Android codebase would be no different then switching to a well-written React codebase.

> I've been doing some web development on a fairly long-lived and large code-base

Perhaps it's just not a well written codebase. It's extremely easy to write bad code for web, where perhaps it's slightly harder to do for native development (although still very easily possible of course). It's also very possible to write good maintainable code for both as well.

> I'm not even talking about the fact that everything has to be stateless

It doesn't have to be stateless. Take a look at React.

> just the fact that it really feels like there's no consistent way to do anything

That's pretty much the same with application development. Perhaps not as much for Android/iOS themselves since there is basically only one option for each of those. Even within those there are many many ways of doing everything. It's up to everyone working on the codebase to keep things sane. That's no different with web development.

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

#55
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.

> Facebook, Google and Microsoft all use the web stack to run huge companies.

And they throw huge amounts of resources at the web stack to do it. It might work for them, but I'm not sure that makes it powerful, performant, and manageable for those of us who aren't huge companies.

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

#56
post #48
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…

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.

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

#57
post #3

I think it got particularly crazy around the creation of npm/node: https://www.commitstrip.com/en/2016/05/10/a-moment-of-nostal... . This was an enabler for complexity to spiral out of control.

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.

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

#58
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.

What's sad is the zillions of hours wasted by engineers on an inherently flawed stack. What's sad is how ridiculously complicated it is to create and manage relatively simple UIs. What's sad is an entire generations of programmers growing up and thinking this is normal.

Programming is supposed to be about creating platforms for each other so we can continue solving higher (and higher) level problems. This web crap has us stuck fighting in the mud going nowhere.

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

#59
Yes.

I got this realization during a study project where I investigated the use of secure cookies (was 2009, it's public [1]). It's just one example, but you can find similar things everywhere.

Sessions in Web applications are realized using cookies, which is not a very good way, because once someone manages to steal your cookie your session management is broken. And there are plenty of ways to do that, because there is no good separation of the session from the rest of the functionality. Because both cookies and sessions weren't in the design of http/html before, they were a later addon that. So was javascript. So were many other things.

The thing you have to realize though: Things work. It's been the most successful technology of the past decades. There is no point in moaning that things would be much nicer if we'd redesign them from scratch, because it isn't going to happen.

[1] https://blog.hboeck.de/archives/681-Study-research-project-a...

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

#60
I've done front end work for nearly a decade now. You're right and I think frameworks are a big part of the issue.

Looking at how to do something on the web there is a different way to do it in React, Ember, Angular, jQuery UI, Bootstrap, ExtJS, and about 50 more slightly lesser known frameworks. They don't interoperate well at all. Yes it all boils down to HTML / JavaScript in the end so there is always an integration point but try writing a component that integrates well in even 2-3 of frameworks.

Honestly if more people taught solid coding structures and the DOM API (which, yes it's awkward but with the features HTML 5 brought in plus well structured code it's not that bad) you could have a smaller, handful ways of doing something properly and you could even share components far easier.

Granted frameworks are not the only problem. But, in my opinion, they've severely splintered the way the web is developed.

Post reply on HN