Lurker News
Been doing application development, primarily backend development, for a number of years. I've always found it quite easy to move up and down the stack and work anywhere from UI down to the bare metal in a number of environments and languages, and always the 'fast learner' who quickly knows the system inside-out, even when thrown into some area that I've never seen.

Lately I've been doing some web development on a fairly long-lived and large code-base, but I'm finding it MUCH harder to wrap my head around than application development ever was. I think my difficulty is that the whole environment feels so... HACKISH... everything is a horrible hack on top of a horrible hack. (yes, I'm familiar with the history, been using the Internet since before the web) I'm not even talking about the fact that everything has to be stateless, in fact I develop desktop apps as stateless even driven UIs as well, but just the fact that it really feels like there's no consistent way to do anything, there are 1000 different frameworks, all with their own way of doing the most basic tasks, and my experience is that they all ... well... suck.
Am I missing something? Is it me resisting change? Is web programming really that bad? Is it really just that I need a new mental paradigm?
Can you recommend any good resources to help me orient my mind to this new way of thinking?

Comments (661) 164 threads

Earlier comments
elg0nz2 replies#
" 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 the other students that “the French curve is made so that at the lowest point on each curve, no matter how you turn it, the tangent is horizontal”. He reports that the other students in the class were excited by this discovery, and began holding up their French curves and turning them in various ways, trying to verify that the curve was always horizontal at the lowest point. Feynman found this funny, because they had already taken calculus and supposedly learned that the derivative of the minimum of any curve is zero. (Of course, it’s also intuitively obvious: If a curve at a given point is not flat, the point is obviously not the minimum.) Feynman says “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!” www.mathpages.com/home/kmath687/kmath687.htm

"Easy to begin, hard to master" languages/frameworks let you go very far in spite of your knowledge fragility. Some interesting topics to reduce this fragility are data structures, design patterns, software and hardware architecture and, distributed computing.
If I had a penny for every JR. Dev that thinks they can get around the CAP theorem...

barefootcoder1 reply#
Somehow I feel like this comment is meant to be directed toward me (OP), but am struggling to see how it applies to what I was asking. In fact, I specifically asked for resources to assist me in orienting my mind to the web development way of doing things.

Perhaps I've misunderstood and you're actually directing the comment at the hodge-podge of web frameworks that don't seem to follow the principles of design that other languages do?

elg0nz#
The main point I was trying to get across is that most software is indeed Hacky, not because Computer Science is terrible, but because the people who made it don't have a solid understanding of many fundamentals. They've taught themselves to "program in 21 days" and later have a hard time understanding why things break.

Peter Norvig said it better than I can, becoming a great programmer takes 10+ years. http://norvig.com/21-days.html
Data structures, design patterns, software & hardware architecture and, distributed computing are subjects that all engineers should be familiar with.
For example, the question whether to use NoSQL or SQL is another way of asking if you need to use a Hash or a Binary Tree.
Bad engineers pick one or the other based on Marketing or White Papers, Great Engineers pick the right one based on understanding how their algorithms will use that data and why there are no silver bullets.

aidenn0#
“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.

BerislavLopac#
> I've always found it quite easy to move up and down the stack

This is the most important point that most people overlook: the Web doesn't have a single stack, even though we talk about "full stack developers" and similar. Web is your ultimate distributed system (which is why you have no other option but to make it static); you never develop a single application, but a multitude of applications often (usually, in fact) executing on systems you have next to no control over.
Just think of your quintessential "Web page": a server prepares an HTML page which is then rendered in a browser. First, you have a server, which you rarely control (unless it physically sits on your desk/rack, and even then you're at mercy of your ISP). Second, even assuming the page was served correctly, it then arrives to another system which has OS/browser/display/etc which you have absolutely no control over except for hoping that it adheres to all the standards you have adhered to when developing. Even if there is no client-side code (i.e. Javascript) to be executed, even the simplest HTML (as well as CSS) are instructions that need to be interpreted.
What you call "hacks" are essentially numerous solutions -- some good and others less so -- to inherent problems of distributed computing, working around the peculiarities of the underlying platforms (namely HTTP and TCP/IP) to ensure reliability. Many things that are taken for granted in platform-specific development simply don't exist here; as a reminder, take a look at https://en.wikipedia.org/wiki/Fallacies_of_distributed_compu...

msoad1 reply#
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 think that's all the web is.
Although, I think React, webpack, Redux and all these little hacks are amazing for exploring what's possible in web.
[1] https://github.com/Microsoft/vscode/

voltagex_2 replies#
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".

onion2k1 reply#
Using a meta-language like Typescript (if it's appropriate), and writing a sensible number of tests, employing a consistent code style, documenting what you write, and spending time to actually design your software properly is the answer.

You can write good software in any language and on any platform. Good code is more about your processes than your choice of tools.

TranquilMarmot3 replies#
Thank you! So many people here blaming the tools for bad software when people have been using horrible tools to write good software for decades. I think one major part of why React + Redux are successful is because they sort of force you into a way of thinking that results in a better creative process and ends with better code.

Continue this thread — 3 replies

sotojuan#
Have a competent team and team lead, both of which are rare in web programming.
jorblumesea3 replies#
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.

roblabla2 replies#
Errm...

- "test".indexOf("st") == "test".length - "st".length
- "test".enddWith("st")
Am I the only one who thinks the second one is WAAAY more readable? And that's a COMMON function. Using the former is bringing complexity UP.
Not to mention, endsWith is part of es2016 I believe. So this package is just a simple polyfill.

EnigmaticLion1 reply#
> "test".indexOf("st") == "test".length - "st".length

I don't think this is a correct implementation of "endsWith".
"testtest".indexOf("st") =/= "testtest".length - "st".length

roblabla3 replies#
Good point. Should have been

"test".substr("test".length - "st".length) === "st"
Or is it substring? Might there be an off by one in there? Anyway, this kind of reflexion only proves my point. There's no reason to question what endsWith does, because it's obvious. It's the correct abstraction in many cases.

Continue this thread — 3 replies

dbkaplun#
- "test".match(/st$/)
mashlol2 replies#
I don't understand the problem with those modules. Just because you can do something one way, doesn't mean you shouldn't add an easier and better to understand way. The intention of `string.endsWith('Blah')` is easier to understand then `string.indexOf('Blah') === string.length - 4`. Java String has both `indexOf` and `startsWith`, do you think that is also problematic?
jorblumesea1 reply#
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 :)
Klathmon2 replies#
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.
There is no overhead to using a small module. It takes seconds to install, in some cases adds literally bytes to the output, and can take care of a lot of hidden complexity like defaulting to using the stdlib version if it exists, and being fully tested (because let's be honest, you aren't going to write 15 tests for a string-ends-with function).
Also, it's not as simple as 1 line of code. Look at the String.prototype.endsWith library. Look at the edge cases it supports, look at the way it does the search to be efficient. your one-liner might seem to work on the surface, but when you use it in a .apply it might blow up, when you try to get it to run on IE8 for some reason nothing works, when you go to run it on a million strings, the whole system bogs down.
There are benefits to using modules where someone has spent the time and effort finding and fixing those edge cases.

Continue this thread — 2 replies

sheriffderek#
I prefer writing instead of

:p

jorblumesea2 replies#
How well supported is ES6 across browsers? Chrome for sure. Not sure about FF or IE.
astrodust1 reply#
You can transpile to ES5 if you've got compatibility issues. Not really a problem.

Continue this thread — 1 reply

Load more comments