Earlier quoted context omitted.
The web lets you reach a large audience in a way nothing else can. You have to get over yourself about the tools not being elegant, and make sure the thing you're using the flawed tools for is worth the aggravation.
That's why it's so successful. There has to be a reason something so terrible could possibly be this successful and you hit the nail on the head.
Ask HN: Is web programming a series of hacks on hacks?
361–370 of 688 posts
Re: Ask HN: Is web programming a series of hacks on hacks?
#362Re: Ask HN: Is web programming a series of hacks on hacks?
#363You're entering a time where ES6 is mostly implemented and should be feature-complete in most platforms soon. I cannot explain how big of an improvement this language is. Javascript used to be a language that other people worked in and I refused to understand. I wrote some thing in it and dabbled when necessary but I was always amazed at how primitive it was for such a high-level language. It was usable though with a bunch of libraries to support you. ES6 makes most of that legacy obsolete.
However ES6 is a bit of a kitchen-sink language now. There are multiple means to iterate over a collection, there are classes, monads and functors... did I just say monads? I meant Promises. And did I say functors? I meant sequence types with a useful prototype. The point is that if you choose the right subset for you it's a decent language now.
HTML5 kills the notion that, "the web is only for documents!" The acronym has aged a bit and is not really descriptive of what HTML5 is anymore. Most GUI libraries and systems I've seen implement the interface in terms of a tree of "objects" with the root node being the Window itself. That is essentially what the DOM is now with the browser providing the run-time loop, input, etc. We have a rather rich array of elements to work with... buttons, input boxes, a rich layout model, 2D canvases, WebGL contexts...
Where it does still suck and where I think you might be getting frustrated is in the tooling. There isn't much of a standard library in Javascript save for the objects you're given. They all loosely fit together with little cohesion. It is quite frustrating to get a program started and take it all the way to something on the level of Gmail, Facebook, or Twitter. It's even more frustrating if your expectation is an environment such as Qt where you have standard tools, libraries, and all of that.
However with some effort and determination you can tame the beast. The part of the kitchen I find most effective is the functional programming side. I use Fantasyland compatible libraries and wrap other libraries with them. I've devised my own configuration of build tools based on Webpack, npm, that I can spin up with Yeoman. It's not great but it's tolerable.
... but now I'm looking into Bucklescript since I'm a closet OCaml fan... and that seems to be another popular angle for building "large" applications in Javascript: compile down from a more familiar language with the tooling you need.
Nothing is straight-forward. Not immediate-mode custom UIs; not big, fancy frameworks like Qt; and certainly not the web... but the web as a platform is awfully powerful, flexible, and open.
Re: Ask HN: Is web programming a series of hacks on hacks?
#364Some people have already mentioned GWT. I think this is the best evidence that yes, web programming is extremely hackish. GWT is an entire framework to write web applications in a strongly typed language - it compiles Java down to JavaScript. GWT was made in an era that we're just now escaping: the era of browser quirks. IMHO, GWT didn't take off because of one reason: Its target demographic, web developers, do not h…
Re: Ask HN: Is web programming a series of hacks on hacks?
#365Yes. 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…
Re: Ask HN: Is web programming a series of hacks on hacks?
#366I think it's worth noting that back-end web development is an usually pleasant place. In most other types of programming, many technical decisions are made by the platform and working with tons of legacy cruft is the norm, not the exception. For example, where else can you so freely choose the programming language? Linux Driver? Use C. Mobile App? Java or Swift/Objective-C for Android or iPhone, respectively. GUI App…
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.
Re: Ask HN: Is web programming a series of hacks on hacks?
#367Earlier quoted context omitted.
The really funny thing is that the OS runs a simple event + render loop, then the browser implements a wildly complex stateful/declarative structure on top of that (the DOM), then React apps create a simple event + render loop again, this time with special diffing logic to update the underlying DOM as little as possible
And no doubt this layering will continue... "Look how I easily render this document decription into react primitives".
Re: Ask HN: Is web programming a series of hacks on hacks?
#368Earlier quoted context omitted.
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 ha…
Complicated to create UIs? Win32 was complicated. MFC was complicated. GTK is hard HTML and CSS aren't as complex as those. Not even close
The problem now is nobody can rationally understand the complexity. At least that was known before.
Perhaps the language may have been a barrier to some back in the day, but complexity vastly transcends that small issue.
Re: Ask HN: Is web programming a series of hacks on hacks?
#369Earlier quoted context omitted.
I still count three frameworks :) (React, Node, sequelize, I'm not counting webpack but I probably would if it's anything like as much of a pain as Grunt or Gulp or... And as you say, this is the lightweight version.)
Ah I wouldn't count Node as a framework as I'd equate it to the JVM in Java world. But you are right, I'd probably lump webpack in there as it does have a fair bit of depth to it if you want to get the most out of it.
Re: Ask HN: Is web programming a series of hacks on hacks?
#370Earlier quoted context omitted.
The web was conceived for hypertext and doesn't do a bad job of it. The actual problem is that people took something that was always intended for displaying (illustrated but mainly text) documents that happened to have clickable words that would display other documents, and tried to make it do desktop-style applications too. We've been hammering square pegs into round holes ever since. And the infuriating thing is we…
Is it really square pegs for round holes? I don't think that the web as a mechanism for distributing applications would look much different even if it hadn't gone through the HTML stage. If not JS, it would have been Java applets. If not HTML, then some weird XML layout schema. There might have been a time where the web as a platform for applications was beyond silly, but this is not htat time. The platform is decide…