Live data from Hacker News

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

news.ycombinator.com

571–580 of 688 posts

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

#571
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".

Have a competent team and team lead, both of which are rare in web programming.

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

#573

Earlier quoted context omitted.

It's added complexity because it's not std lib. Importing an entire module just to accomplish something you could easily do with 1 line of code. I'm not arguing that javascript shouldn't have `startsWith`, just saying there's a large overhead associated for a relatively minor performance increase. Thus going back to the debate about proper engineering. Just my 2 cents, feel free to ignore :)

But it's not "An entire module", it could be as simple as one line. I know people like to go on about how every module increases complexity by some massive amount, and how you are relying on X number of other developers and systems that can break now, but the NPM/javascript way is the unix philosophy taken to the extreme. Lots of small modules, extremely easy to use and install, that all do one thing and do it well.…

That's hardly true, because many modules have lots of unseen dependencies. For all I know, your tiny module could have refs to 3+ other modules to do its work.

Thus, getting leftpadded.

I reject the idea that the size of the module means it is not complex.

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

#574

Earlier quoted context omitted.

But it's not "An entire module", it could be as simple as one line. I know people like to go on about how every module increases complexity by some massive amount, and how you are relying on X number of other developers and systems that can break now, but the NPM/javascript way is the unix philosophy taken to the extreme. Lots of small modules, extremely easy to use and install, that all do one thing and do it well.…

That's hardly true, because many modules have lots of unseen dependencies. For all I know, your tiny module could have refs to 3+ other modules to do its work. Thus, getting leftpadded. I reject the idea that the size of the module means it is not complex.

That's easy to check, it not only shows you any dependencies of dependencies (of dependencies) when you install, but it also exists in a package.json which you can easily browse.

For example, the String.prototype.endsWith package referenced above relies on 0 other packages.

Another micro-module I've used, clean-stack[0] is one line, and has 0 dependencies. (it just removes mostly unhelpful node.js stack trace entries). This is great example for me because it's just a regex. But, it's a regex that was just updated 11 hours ago because a new version of node added a new stack trace line that's not exactly helpful, and by updating this package, it will pull in that update, and I need to do nothing besides do a quick sanity check that nothing massively changed, and check that my tests still pass.

Is-reachable on the other hand (a simple module to check if a hostname is reachable), has 6 direct dependencies, with 2 more dependencies of dependencies. Altogether that module adds up to about 300 lines of code (including it's 8 dependencies).

That's not massive, that's not even much at all for a server-side system. And if that module ever goes under, re-making it would be trivial. So there really isn't much of a downside to using it (especially if I vendor my dependencies, which anyone should be doing for a production application)

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

#575

I wonder if 50 years down the line, maybe when humanity is building spaceships to go to other planets, will the interstellar software be written in C++/Java or Assembly or be produced entirely by AI subsystems or what.

Machine learning algorithms written in Perl 7.

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

#576
post #455

Ah, yes. Another round of grumpy 'ol "why can't I pick/control every aspect of my application environment in the languages I love" developer whining. I swear some people just love saying "hacks on top of hacks". It's the new pejorative of our industry, despite the unparalleled success of what it's intended to dismiss. The hacky-ness we're observing is just an evolutionary byproduct of the "power vacuum" of software d…

Strange that you feel that's what I was saying given that my original post said that I've worked in a variety of different languages and environments.

I apologize if I'm being too harsh, but I see these arguments over and over again and I don't think they result in anything beneficial. The thing we should be fighting is not-invented-here syndrome and only re-invent things that which cannot be improved upon for one reason or another.

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

#577
post #460

Earlier quoted context omitted.

loathe ? I loathe public speaking and flossing, but these things are good for me, and I'm sure you wouldn't be doing frontend dev if there wasn't a big upside that it made possible. > teetering Jenga tower of hacks? How is any programming language not capable of being brittle?

This isn't about a language. It's about the whole stack. I've been programming since before the web was invented. The web, as a development platform, is the worst layer-cake of kludges I've ever seen.

Fine. Name a better stack then and suggest ways this one can improve.

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

#578

Earlier quoted context omitted.

This is exactly why I've always been puzzled by the urge to move more and more logic to the frontend. In backend development you have a choice of many mature languages, tools and frameworks which are fairly sane. I'll take that environment as the foundation of a web application any day and apply the mania of client-side javascript to it selectively in cases where we need to minimize server roundtrips.

> why I've always been puzzled by the urge to move more and more logic to the frontend. This is usually about a mix of scalability, responsiveness, and partition resilience; with the level of importance of those being dependent on the application. * Scale: if the client makes fewer request of the server(s) then you have reduced server and network requirements. As server resources get cheaper (and the cheap options mo…

I recently moved more logic out to the frontend for the one and only reason of Responsiveness. The experience was a lot better, with the sole exception of older android phones on wifi (all these new improvements to cellular data means we have a lot more bandwidth than we used to, but latency is often no better now than it was a decade ago).

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

#579
post #351

Earlier quoted context omitted.

Ironically Firefox was produced as a result of the code created from the Netscape rewrite he criticised.

Why is that "ironic?" I don't see how it disproves his point.

Firefox was a significant improvement over the status quo in browsers when it was released.

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

#580
post #126

" In Richard Feynman’s popular book “Surely You’re Joking, Mr. Feynman!” he tells how during his college years he “often liked to play tricks on people”. Most of these tricks were designed to show how dumb people are. For example, in a mechanical drawing class at MIT where the students were taught to use a drawing instrument called a French curve (a curly piece of plastic for drawing smooth curves), Feynman informed…

“I don’t know what’s the matter with people: they don’t learn by understanding; they learn by some other way – by rote or something. Their knowledge is so fragile!”

This is how we were able to build bridges that didn't fall over before Newton, or even Galileo.

Post reply on HN