4 ms·
> Accidental complexity is a bad thing and should be avoided if possible. Yes. I absolutely agree. Start with a monolith. Use server-side rendering if possibl
by bob1029 5y ago
> Accidental complexity is a bad thing and should be avoided if possible.
Yes. I absolutely agree.
Start with a monolith. Use server-side rendering if possible. Use SQLite instead of [wretched nosql abomination]. API development is a waste of time. The business doesn't give a shit about any of this. Just make it work, then make it "webscale".
- nuerow 5y ago> Use server-side rendering if possible. Doesn't this lead to an unnecessary increase in complexity without any immediate benefit? > API development is a waste of time. Why do you think so? Doesn't a well developed API mitigate, if not eliminate entirely, needless increases in complexity?
- sdevonoes 5y agoCare to elaborate? In my mind, server-side rendering means: no more JavaScript framework to maintain (and that means: webpack + babel + a few hundred npm dependencies).
- nuerow 5y ago> In my mind, server-side rendering means: no more JavaScript framework to maintain Not necessarily. All the major JavaScript frameworks also support server-side rendering, which is used to improve load times and perceived performance.
- satyrnein 5y agoI think the suggestion here is for the likes of Django or Rails, not next.js
- renke1 5y agoWith server-side rendering you don't have to create yet another layer to actually transfer the data to the client just to render it. It usually also implies that you don't have build your data model in two different languages ($BE_LANG + JS/TS); of course there are things like JSON Schema, OpenAPI and whatnot to mitigate that, but they have their own share of problems. Developing an API may also be a waste of time when your client-side application is the sole consumer of the server API. This is especially true when people try to build an API that does too much (often seen when building REST-style HTTP APIs) instead of a more usecase-based (or even view-centric) API.
- nuerow 5y ago> With server-side rendering you don't have to create yet another layer to actually transfer the data to the client just to render it. That layer doesn't go away with server-side rendering. It is always there, even if you don't use a REST API. It just gets fused with views. In fact, I'd argue that this perception that server-side rendering gets rid of that layer is a telltale sign that the project is already plagued with accidental complexity. > It usually also implies that you don't have build your data model in two different languages ($BE_LANG + JS/TS); Unless the front-end is written in pure HTML+CSS, this hypothetical simplification doesn't materialize. Also, you can't brush off or ignore the complexity added by templating engines. > Developing an API may also be a waste of time when your client-side application is the sole consumer of the server API. I don't get what point you're trying to make. Even if you are the only client for that API, don't you still need to put it together and maintain it?
- arethuza 5y ago"Unless the front-end is written in pure HTML+CSS" But that can be "good enough" for many applications - look at how the site we are discussing this on works as an example....
- nuerow 5y ago> But that can be "good enough" for many applications I disagree. If you expect any type of non-trivial user interaction from the front-end, you'll find most of your needs is not practically possible to implement without javascript running on the client-side. > look at how the site we are discussing this on works as an example.... Please note that even HN loads javascript, which also makes AJAX calls to the backend.
- arethuza 5y agoSomething like 142 lines of pretty easy to understand JavaScript....
- renke1 5y ago
- ec109685 5y agoServer side rendering also nicely avoids the multiple round trip problem the author mentioned given browsers are inherently request / response so forces one stream of html output. While you can be careful about round trips with client side rendering, and graphql helps in that regard, it’s easy to create hidden bottlenecks.
- Zababa 5y ago> Doesn't this lead to an unnecessary increase in complexity without any immediate benefit? Why do you think using server-side rendering leads to an unnecessary increase in complexity without any immediate benefit? > Doesn't a well developed API mitigate, if not eliminate entirely, needless increases in complexity? It does when multiple clients consume that API. The point of GP is, I think, that you shouldn't start with the assumption that you will have at some point multiple clients and prepare for it.
- wsostt 5y agoGall’s law: A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a working simple system. https://en.m.wikipedia.org/wiki/John_Gall_(author) https://en.m.wikipedia.org/wiki/John_Gall_(author)
- pas 5y agowhere's the line between simple from scratch and complex from scratch? where's the line between from scratch and evolved?
- malwrar 5y agoIt’s hard to define a specific brightline, but I’d say you tend towards “complexity from scratch” as you spend time doing things other than making features. Some people try to write game engines from scratch before actually creating their game. Some people learn & adopt complex frontend frameworks before finishing their project’s landing page. Some people start new projects by immediately building all the abstraction layers they think they’ll need during the project before implementing a single useful feature. I’ve fallen for each of those at least once, and I’ve seen lots of people doing the same. You’re not going to need it. Wait until it makes sense to justify the hidden time & reliability costs. Wait until you actually know what you need.
- kjeetgill 5y agoI don't have the perfect answer, but my criteria for services might be something like: Is it serving prod traffic? Did you deal with keeping it online, performant, and available in parallel with your development iterations? Did the the experience of keep it running provide critical feed back for further design choices?
- cylon13 5y agoThanks for finally providing me with the source to this piece of wisdom that's been stuck in my head since I was a kid reading through some programming book I had. It's really stuck with me and I've been repeating it ever since, but I could never remember the attribution, just that I saw this quote in a book! I can't quite remember the book, but it was something like "Programming games with C++" and it came with a CD with a demo of Visual C++ 6.0 on it. Must have been around 2002-ish...
- 29athrowaway 5y agoIf you have never designed or developed software before, by all means try that. Once you have reached at least junior level, start learning about how to split the system into subsystems and putting some additional thought into it. The business doesn't give a shit about the implementation. Very true... that's why they hired you so that you fucking do. Just do your job. If you want to work in finance, accounting, sales, investor relations, partnerships, business development or whatever, go do that. If you want to work creating software, start caring about how software is created, or at least don't ruin it for people that do. If you decide to follow a business career path, you will find that they also have to care about their job, have attention to detail and care about good practices and compliance. In fact, that will also be the case for every occupation in every sector.
- bradleyjg 5y agoSystems divided up into subsystems include microservices architectures but that’s not the only way to get there. Like so many fads in our industry microservices solve a problem that giant, famous companies have and are aped by thousands of companies that don’t, and will never, have those problems.
- 29athrowaway 5y agoOK, then if not microservices, then the problem will be programming paradigms, programming languages, data structures and algorithms, interviews... everything that forces you to think will be a problem. We have to stay mediocre and keep the bar low, to lower the entry barrier to software and depress wages.
- bradleyjg 5y agoYes, we need to lower the barrier to entry. There are not enough programmers to go around. Mediocre programmers are much better than no programmers. Hiring managers at companies that can’t afford to get into bidding wars with FAAMG need to realize that. You might prefer that they try anyway just to push up your salary a bit more, and I can’t blame you for wanting that, but all of us in this conversation aren’t going to strategically tailor our thoughts to help you achieve that goal.