69 karma · joined May 9, 2018
Compare this to server-side rendering where you run some DB queries, generate some HTML based on those results, and send it to the browser to be rendered.
There are some cases where you actually need a rich experience in the browser. In those cases, I would start by seeing if plain old Javascript would work.
In writing this, I definitely feel like a "get off my lawn" guy. But I've just seen too many junior and senior engineers (me included) fall flat on their face trying to use these SPA frameworks.
And I think that may be one of the larger points here. CSS can be simple, and using techniques like this forces it to stay that way. You have to take a step back and understand what we're trying to do as engineers. I would argue that being able to quickly understand code (e.g. the context to understand a line of code is small) should be a top priority of most software project.
One of the driving philosophies was that when one saw a CSS class, they should easily be able to find it's definition in the source. Another driving philosophy was that one should easily be able to determine what the class is doing.
This lead to classes like `u-centered`. The `u` tells me it's in the utils.less file. Classes starting with `l-` were layout classes, `t-` text classes, etc..
I had classes like this:
u-{max,min}-width-{xxs,xs,s,m,l,xl,xxl}
t-white
u-bg-red (red background)
t-h3
l-container-{xxs,xs,s,m,l,xl,xxl}
You get the picture.
(The nice thing about xl and xs is that you can keep adding x's as you need.)
I found it to be very effective. I understand the arguments that it kind of defeats the purpose of CSS, but I think CSS is pretty easy to mess up, and this give you a solid, consistent structure to work with.
Of course, I didn't follow this style 100%. There were some cases where it just made sense to use a more semantic style, but I found those case to be few and far between.
I rarely, if ever see this done. Probably because it takes a big risk as an engineer to actually do it.
The problem is that devs do not create enough leverage in their solutions, so they're never that useful in the future. And, devs tend to over estimate what is actually re-usable. The second point may be the most important. Too often, I see solutions that are half-way reusable, which means they're not re-usable at all.
In the end, building out a solid foundation is key. The problem is, this is pretty hard and takes a lot of experience to know how to do well.
<rant> I see a lot of software engineers trying to get rid of the cost of writing robust programs. It's not possible. Stop trying. You are either safe, or you are not. You either handle all cases, or you don't. </rant>
Another thing I've noticed is that most Europeans see American as a "high tax" country, and they wonder what we get for those taxes. I can say that I pay less taxes to Switzerland than I pay to the US. I would bet the impression from America is that the Swiss pay more in taxes, but that does not seem to be the case.
Pros:
* Low stress. I find the most stressful thing at work is trying to figure out what my boss wants. (Small) Startups are easy -- just stay alive and find product market fit.
* Power/control. Things are small, so it's easy to know a large part of the codebase/product. This allows one to quickly make changes to support the business.
Cons:
* Pay. This has been well documented in this thread.
What this really comes down to is, do you prefer to have guarantees, or do you think that "less code"/"less useless checks" is better.
In my mind, the only way to write robust, maintainable code is to not use null and use Option/Maybe.