Live data from Hacker News

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

news.ycombinator.com

71–80 of 688 posts

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

#71
I felt the exact same thing when I started webdev after 3 years of app dev and a little bit of REST APIs (and backend) using python flask. For me JS, and all frameworks built using JS felt like attempts at revival of something that should have long died. Every new framework gives JS lovers (honestly no offence) a little bit of hope and adds a year or two to its survival. For a long time, I felt JS was a hack on top of a series of hacks!

I've just come to accept it now. The reason you're disliking it is probably because of its extreme hit and trial nature - unlike appdev which is more fluid and consistent.

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

#72
Its very, opinionated. It has to be! (for now)

I can agree with almost every opinion in the comments, almost everyone is right. But with a strong opinion and a strong mental model there is light at the end of the tunnel.

The future is bright for web applications, and almost everyone in the space is aware of the biggest issues, which is important as the browsers adapt new features to help ease the pain.

Web development is a scary place but it can be enjoyable when the right pieces are in place. Older web applications have crazy hacks and made up anti-patterns to solve problems, which mix context between the client and the server making it a nightmare to wrap your head around or even implement new features.

Often a new feature in such application guides the developer to accept the fate of adding more technical debt, and creates a strong desire for a better way with no way out without a major overhaul of the backend and frontend. I have spent countless hours building patches to older systems just to prepare them for the option of pivoting to more modern approaches.

Today web application development is a fast moving target. Design patterns are changing from framework to framework. Even from framework version to version. i.e Angular 2.

It's almost as if the current state of frontend development is very comb shaped. broad in approaches, and that the community is digging deep into patterns that are showing success in scaling, and performance. We have to deal with various topics, the lack of concurrency, performance of the DOM, managing scope, and state.

I have a few opinionated methodologies to help me in modern web development.

1. Pick a strong frontend and backend frameworks and know them well.

2. Don't mix the backend and the frontend code. Keep the backend API in context to the business domain, data validation, and security. Allow the client to be an independent consumer of the API for portability and scalable distribution.

3. Keep your JSON responses as flat as possible, and avoid deeply nested data structures. Rely on functional programming to map and reduce your data on the client into deeply nested structures if needed.

4. Decide what the client can compute for free computation cycles.

5. Stay as data-driven as possible. Fall back to the server or micro-service if the client is not efficient at a demanding task.

6. Choose libraries with the least restraints and high flexiblity. They should not obfuscate or complicate your ability to implement the design. I find most libraries can assume to much control.

We are in a better place today then we have ever been for web applications. Though the learning curve is intense and the subjects broad. Especially for fullstack developers. I feel that finding what works and an opinion of how it should be done is important.

I am less picky about the backend technolgies as I am with the frontend. I would really only consider Angular, or React for my frontend. Both Angular and React expect you to form a mental model of how they work, and what a build pipeline should look like which is very project specific in my experience.

Its the wild west our here, and expect things to continue to change. Building an opinion, vetting new libraries to add to your toolbox, and experimenting is just part of the web application world.

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

#74
post #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 wh…

Sure, as said in other threads here -- large companies full of brilliant people can build good RIAs. Small companies full of OK people are suffering. Java Applets security could have been solved. I'm not even sure what problem you are referring to exactly. With todays web we get insanity of XSSs, CSRF and who knows what else. The only reason these are not killing modern web development is because this hydra has too many heads.

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

#76
post #55

Earlier quoted context omitted.

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.

And even their code is still often bloated, maddening hacks on hacks.

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

#77
I 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? Again depending on your platform that will be either C++, Swift/Objective-C, or some .NET thing. Making a neural net? You could do everything from scratch, but it probably makes more sense to just use a platform like Tensor Flow and python.

Backend web development on the other hand: use anything! Wanna use lisp? Go ahead. Wanna store your data in an unproven experimental database? No problem. Wanna use micro-services? Monoliths? Anything goes.

Browsers are extremely complex application platforms. But despite how you may feel, they didn't succeed because of their weaknesses. The browser as an application platform succeeded because of its strengths. Web browser are the least bad option (and beat out many other worse options).

For better or worse, browsers are what we have. Make the most of their strengths, and deal as best you can with the weaknesses.

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

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

> Back end and front end are written in the same language with strong typing and all that.

Exactly why I love GWT, even though it seems that it's not popular anymore.

It gets the job done, refactoring is not an error-prone and painful experience and it's fast because it's transpiled to javascript.

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

#79

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

[deleted]

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

#80
Some parts of web-dev are really chaotic right now, but other parts can be very well-organized, same as server-side code.

For example, you need to compile all of your es6/es7/typescript code to JS (because nobody will write in pure ES5 nowadays), minify and concatenate resulting files - this part is very chaotic. But you need to touch it not so often.

You also need to write unit-tests. Tests itself will take 10% of their configuration code, it's very annoying also.

But when you'll write e2e tests, everything will be much more clean.

Main part, JS code (I recommend TypeScript) can be organized by same rules you use on the server.

Frameworks: Angular 2 is closer to Java enterprise apps (with all good and bad parts of it), React and jQuery are not frameworks and if your codebase is built on jQuery - bad news, it will be mostly spaghetti-code.

Post reply on HN