Live data from Hacker News

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

news.ycombinator.com

481–490 of 688 posts

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

#481

Earlier quoted context omitted.

it's not, because Mongo has huge issues [0] and angular is generally a giant mess and a pain in the ass [1] [0] http://blog.runnable.com/post/149000201856/think-before-you-... [1] if you haven't used angular, ask someone who has

I work on a large (500000+ lines) of Angular daily. Maybe this represents some sort of Stockholm syndrome, but it's really not that bad?

Similar situation here, but it depends on your level of experience as well. Can you structure an AngularJS app so that it's (relatively) sane? Absolutely. It's also very easy to make a mess of things so that it's hard to reason about control flow; frameworks that are doing a better job of embracing unidirectional dataflow definitely help with this, but I don't blame Angular as it predates the wide adoption of that as a practice.

It's also more difficult to follow practices like quickly rendering above the fold content; when you use the normal practice of writing re-usable directives, you end up needing to wait until at least Angular and any dependencies are loaded prior to being able to render any content at all. Server side rendering of initial content helps to alleviate that quite a bit since even though the content may not be interactive until your app bootstraps, the perceived load time is much better as the user has something to look at.

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

#482
post #311

Earlier quoted context omitted.

That leads to the MEAN stack (Mongo, Express, Angular, Node) and I am not so sure whether that's where the rosy future is.

it's not, because Mongo has huge issues [0] and angular is generally a giant mess and a pain in the ass [1] [0] http://blog.runnable.com/post/149000201856/think-before-you-... [1] if you haven't used angular, ask someone who has

I've used Angular a good bit, seems fine to me. Last place I worked probably had around 20-30k lines of Angular code. It wasn't perfect, but it was way better organized and easier to understand than a much smaller project (~1k lines) done with JQuery and handmade paging system.

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

#483

Earlier quoted context omitted.

If anything, this understates the problem. A modal web application today takes an absolute minimum of five programming languages and three frameworks: * HTML * CSS * JS * A server-side language (eg Python) * SQL And then come the (leaky) abstractions on top of them: * A framework to make JS bearable (eg Angular) * A framework to make server-side bearable (eg Django) * A framework to make CSS bearable (eg Bootstrap) .…

You forgot something for the mobile strategy, something for web stats, something for monitoring, something for source control, something for issue management, something which shall remain nameless for team communication that breaks store and forward and interrupts you constantly, something for 'social', etc. Oh wait, and your infrastructure automation solution. And your third party DDoS protection/web cache integrati…

You forgot containers, and a platform for orchestrating(?) or swarming or cat-herding or whatever it is one does with a gaggle of microservices.

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

#484

Earlier quoted context omitted.

Maybe for web applications . There should be something in the license of JavaScript frameworks & libraries to prevent them from being used in blogs, newspapers, trade publications etc :-/ For now all innovations in JS just seems to provide us with even heavier web sites for no real benefits. I feel I'm starting to dislike JS the way I disliked Flash which would be quite a feat.

I think it's completely fine to write a website/blog/newspaper in React, provided you make it isomorphic and keep it as light as possible. Then you get all of the advantages of using React with almost none of the disadvantages. Of course, nobody does this in practice.

If your blog/newspaper/text+images website requires JS or it is not readable, you failed.

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

#485
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…

  JavaScript - Dynamically typed, does not scale what so
  ever. Code written in it becomes 'read only' very
  quickly. Impossible to refactor.
Consider the _brighter_ side of it:

- the one who authored the code is irreplaceable

- employment generation: many more are needed to maintain (and possibly enhance) what one person might have written

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

#486

The web platform is disorganized and has many missing pieces. It has also grown quite a lot in the last couple of years, so it’s virtually impossible to understand all of it. As long as you’re disciplined about learning from the relevant blogs, it will “become better” (but it may take months).

How can you know what constitutes "relevant" though? There are loud voices in the community that seem right at first but the more you learn, the more you realise you may have been led astray. I guess that's a way of learning, but that particular path to enlightenment is covered in litter.

Could you give an example of this issue? I’m interested to learn about this. :)

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

#487
post #412

Earlier quoted context omitted.

I think your use of "minimum" is wrong here. If you're using React running on Node and Webpack as your task-runner you just need Javascript and that's it. Node allows you to run isomorphic JavaScript that runs on both your server side and client side (to ensure you don't end up with the Angular-style skeleton pages coming from the server), You can pick a nice ORM (like sequelize) to abstract away SQL, and Webpack all…

> Node allows you to run isomorphic JavaScript that runs on both your server side and client side But then you're writing JavaScript on the server side, and I think I'd rather shove live weasels down my trousers than write one line more of JavaScript than I absolutely must.

You could of course write something that compiles to JavaScript. There's a ton of options, some are even pretty nice (I like ClojureScript; want to try out Elm).

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

#488

Earlier quoted context omitted.

It's, but not by design.

...and? There are plenty of things that were "designed" for one thing and used for something totally different.

So using the right tool for the job is a poor metaphor in programming? Or is it advice that gets continually ignored?

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

#489
post #284

Earlier quoted context omitted.

But none of your examples are as cross system portable and "native/normal feel" as writing an app that only works in chrome/chromium. For the decades leading up to this stage cross system GUIs with a few simple library dependencies have been an unachieved "easy" task. Web remains as frustrating as ever because now we need it to work on all non portable browsers even on platforms that supports better ones. Then we wan…

Why is native/normal feel the end-all-be-all of UI systems? I've never quite understood why this is so desirable. Or why the answer seems to be using a shoddy UI system stuffed in a browser frame.

Because chances are that whatever custom UI/UX design you come up with isn't going to be better (or even as good as) OS UI toolkits that've been designed by experts, battle tested for decades, and used for every type of application known to man.

Applications with native UIs also tend to give a a better impression of responsiveness, and they reduce mental load for your users since they're don't have to relearn much (if anything). They can rest assured that every button and popup menu and text field (for example) functions identically to every other such control they've encountered on the system and in other native apps. This is worth way more than most people think.

One easy example of this is text fields in OS X. Native text fields there all have a form of emacs key bindings built into them to make powerful text navigation and manipulation a systemwide thing. Every application built with Cocoa gets this for free, but more often than not applications using non-native UIs don't implement this functionality at all. This is highly frustrating when you've worked said bindings into your workflow.

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

#490

Earlier quoted context omitted.

If anything, this understates the problem. A modal web application today takes an absolute minimum of five programming languages and three frameworks: * HTML * CSS * JS * A server-side language (eg Python) * SQL And then come the (leaky) abstractions on top of them: * A framework to make JS bearable (eg Angular) * A framework to make server-side bearable (eg Django) * A framework to make CSS bearable (eg Bootstrap) .…

I think your use of "minimum" is wrong here. If you're using React running on Node and Webpack as your task-runner you just need Javascript and that's it. Node allows you to run isomorphic JavaScript that runs on both your server side and client side (to ensure you don't end up with the Angular-style skeleton pages coming from the server), You can pick a nice ORM (like sequelize) to abstract away SQL, and Webpack all…

> You can pick a nice ORM (like sequelize)

I'm gonna stop you right there. Node is a helpful tool and I enjoy using it, but Sequelize was nothing but pure pain when I used it. You're much better off running raw SQL, or using a query builder like KnexJS.

I would never use Sequelize for more than a 1-table read or update.

Post reply on HN