Lurker News
I've worked on large products for large and small companies and written tens of thousands of lines of code across my career, solving complex, abstract, challenging technical problems in a variety of languages on a variety of platforms, sometimes under difficult conditions. I have often been a resource for my friends and co-workers when they have programming or technical questions.

I only recently learned how to correctly raise and lower window blinds--I had been doing it wrong my entire life. It was maybe the dumbest I have ever felt, and was a humbling reminder of how much I don't know about how much I don't know.
Have you had similar experiences?

Comments (680) 153 threads

Show all comments

Showing thread 1 of 153

hu328 replies#
Learning that some folks can produce so much value with crappy code.

I've seen entire teams burn so much money by overcomplicating projects. Bikesheding about how to implement DDD, Hexagonal Architecture, design patterns, complex queues that would maybe one day be required if the company scaled 1000x, unnecessary eventual consistency that required so much machinery and man hours to keep data integrity under control. Some of these projects were so late in their deadlines that had to be cancelled.
And then I've seen one man projects copy pasting spaghetti code around like there's no tomorrow that had a working system within 1/10th of the budget.
Now I admire those who can just produce value without worrying too much about what's under the hood. Very important mindset for most startups. And a very humbling realization.

bicx2 replies#
My way of planning and writing software shifted a good bit after I went from working at a mid-size tech company to working for myself. Suddenly I cared very much about how long it took to reach a functional product and very little about developing sophisticated architectures.
sbayeta#
Same here. This is what happens when business/developer interests align.
prisenco#
Simple UX too. Early adopters are so much more forgiving of a boring but functional user interface than we want to admit. It doesn't have to look amazing out of the gate. It just needs to do something cool.

Plus a lot of our overcomplicated architectures on the frontend are because we shoot for a UI that competes with products that have been iterated on for 15 years now by teams of dozens or even hundreds.

spoiler#
Like with all things in life, one need to find balance within the two extremes you posted.

There's overcomplicated, there's too basic, and then there's simple.
I think it's fine adding just enough complexity and abstraction to make something malleable and manageable in the future

mablopoule7 replies#
I don't remember where I saw this quote, but... "It's okay to half-ass something, when all you need is half an ass".

EDIT: Totally agree about the 'important mindest for startup', I had a similar eye-opening experience, working in a startup with 'cowboy' code that was actually quite good, but I had to unlearn a bit of stuff I read as a junior/mid-level developper.
It was code that was well-architected, had well-concieved data structure, and had business value, but every "professional" coder would deem bad-quality, since it had no unit test, did some stuff unconventionally, and probably would have many linter warning.

bee_rider1 reply#
Most scenarios only warrant fractional assing. Also this philosophy provides the opportunity to say “ok guys, this time… we have to whole ass this one,” which is always fun.
eru#
Some times you might even have to bring two whole donkeys to bear on a project.
a_t481 reply#
Well-architected + well designed means you can go back later and fix the code if the project survives. I'm hitting this personally right now - the amount of code I can write is dwarfed by the amount of features needed to get something like a working demo out the door - I can spend time and make every thing perfect, or I can squint and imagine how I will implement fixes later and focus on making sure that I don't have to rearchitect.
Buttons8401 reply#
Ask yourself: Will the amount of work it takes to "do this right" increase over time? (And by how much?)

I drew some quick placeholder art for a game I'm working on for fun. One day I might sit down and draw some good art, but not today. When the day finally comes to finish the art, the difficulty of creating that art will be no greater than it is now. In fact, with improving art tools, it may be easier to do later.
On the other hand, if I'm not quite happy with my database scheme and I want to change it, I can spend a day on it now, or I can spend--based on my experience--months on it in the future. In fact, there's a good chance if I don't fix the database schema now, it will never be done.

Continue this thread — 1 reply

randomdata1 reply#
> since it had no unit test

But aren't unit tests the half-assed solution? They are a wonderful help if you want to deliver something fast, but if you had more time you'd probably do something else.

Buttons8401 reply#
It doesn't get said enough that unit-tests are not the ultimate in good code. There's a lot of shitty code with unit-tests, and there's a lot of really good code with no tests.

Continue this thread — 1 reply

adolph1 reply#
> "It's okay to half-ass something, when all you need is half an ass".

Going to mule that over.

makk1 reply#
Sometimes, in the interest of efficiency, you only use half your horsepower.

Continue this thread — 1 reply

SideburnsOfDoom#
or "If it's worth doing, it's worth doing badly."

Meaning that e.g. if you really need a ride, then a noisy, beat up old car will do.

ahfeah7373#
That's such a good quote, haven't heard that before
bch1 reply#
So hard to resolve this in my head - unless it’s understood there’s a “detonate” button attached to the code, that it might escape, or worse, that it gets passed on or sold(!!) is a chilling thought.
4star3star#
Just leave comments for the most embarrassing pieces.

// really not the way to do this, but it works
// ideally, we'd do xyz, but this is good enough

lr4444lr3 replies#
I think the other replies miss an important part of your comment:

Some of these projects were so late in their deadlines that had to be canceled
Speed is really important a lot more often than devs like to acknowledge when a company is small and fighting for its life to get revenue, let alone become profitable, and the code debt is often worth it. Fixing the code debt itself doesn't need to be any more thorough than necessary either.

mablopoule#
> and the code debt is often worth it.

This is something that I like about the metaphor of 'code debt', and which tends to go over peoples head: debt can be a perfectly fine instrument, and just like a real debt, it can be a good thing when leveraged wisely. The issue is more when debt is treated as 'free money', and is used carelessly.

kaba0#
At the same time, companies often fail to invest into long-term goals, like maintainability, increasing test coverage, or even bettering the internal UI, even when it’s their core, business-critical product.
izacus#
And the other part is just the sheer amount of projects that can't deliver that "speed" after a year or two because shoddy, quick and poor decisions were made around code quality. Once you find out that your startup chose the wrong architecture because "we need to do it fast" and it needs to stop pivoting for 6 months to unfsck themselves, it's mostly too late.

Unfortunately people who create those monstrosities hide behind the same "keep it simple and quick" excuse than people who know how to prioritize.
It's interesting how many people here ignore that scenario - it's surprisingly common. Is it because most of developers jump ship at that point?

deadbabe3 replies#
I wonder if you’ll still admire them when they leave and the burden of maintaining the mess they left behind falls on you.

Continue this thread — 3 replies

nogridbag1 reply#
I always find these discussions interesting.

I've been working for the same company 10 years. When we built project A, I was surrounded by people who had built the same product for the past 20 years together. As a younger dev, I deferred to them as they were much older and had done this before. You would probably admire them. They pumped out code and delivered immense value. We had no over-engineering because there was no upfront design discussions. When we needed to use some service, we just wrote that directly in our normal framework code instead of using some over engineered abstraction. That's usually highly praised here on HN.
Years later, that project became an extreme maintenance burden. There is no separation of business code from framework code, so the first major framework migration took... years. When they completed the framework migration it was already 2 versions out of date. Subsequent upgrades were faster and given more priority, but still took multiple months. Onboarding new clients took whole teams. The code is fragile, lacks test, etc. The app is classic "spaghetti code". But they sure got to production quick!
Around 2.5 years ago, I was tasked with building project B. There was no development team. I worked with two domain experts, but ultimately the development of the product was in my hands. This is a product that will live on for at least another 10 years and will likely overtake our core product in revenue. There is no one to blame, but myself, if in 5-10 years this app becomes another unmaintainable mess. If you're in this position, what do you do? For me, all I could do is draw on my experience to try to avoid the mistakes I've seen made in the past. We made a lot of mistakes in project A, but I knew a big one was tying our business code, the core of our business, to the particular flavor of web framework that happened to be popular at the time the project started. How do you avoid that? Well, "Hexagonal architecture" sounds like a big scary buzzword, but it's a damn simple pattern that solves that elegantly. When we started, I basically received an indirect mandate that we use the same framework as project A. After we had written ~25k LOC, I had enough and we dropped that legacy framework and migrated to something much better. And we didn't have to change a single line of our business code. Our new framework allows us to iterate much faster than legacy framework. 2.5 years in and our code looks as clean as that initial POC I built. Hexagonal was a small bit of the initial architecture I did. I only point it out here as a counter example. But all the little things I've done which are considered "architecture" have paid off years down the road.

hu31 reply#
Interesting.

I'd like to think that, most probably, your job exists and is funded because those folks (and you) "got shit done" for the last 20 years.
In my experience (around 2 decades also), when it comes to small/medium projects, spending a bit of effort separating business logic from UI/database/server code is wise up to a certain point.
If the effort doesn't add too much code and layers of indirection, then fine.
However, DDD/HexagonalArch consultants tend to add soo much boilerplate and layers of indirection between between an HTTP request and a response that it becomes detrimental to productivity.
For example take a look at this article:
https://herbertograca.com/2017/11/16/explicit-architecture-0...
Specially this part (but the entire article is a gem):
> This means that Dependency Injection and Dependency Inversion are not enough to decouple components, we will need some sort of architectural constructs. We might need events, a shared kernel, eventual consistency, and even a discovery service!
Respectfully I'd like to think that it is satire. But it isn't.
With events your code is no longer linear. Stuff happens with triggers (events) that are not clear at first glance unless you fully understand the entire stack.
Shared kernel is just a place to shove interfaces under the carpet and pretend code is no longer coupled because you added extra 2 layers of indirection (interfaces and kernel) between 2 lines of code. Congrats now it became much harder to understand what actual code will be executed when I call this method.
Eventual consistency... Is that a good thing? We spent 4 decades maturing ACID compliant transactional RDBMS only for someone to come and disregard all these gains?
Discovery service... Yeah your code became so complex that you need more code to discover code. Because we can't have one layer calling another directly. Nonono, that would be coupling. And coupling makes it hard to change frameworks in a distant but slightly possible future. I'd rather pay a very expensive insurance from now on to safeguard from that possibility. Even though the insurance itself is so expensive that it alone can suffocate the project.
Sorry for the rant.

nogridbag#
Haha, I read through the beginning of that article which focused on hexagonal. While it was an over-complicated example, it didn't look too bad. But then skipped ahead to your quote. It definitely felt like satire to me! (Or at least I hope it was!).

And that's where a balance is needed. No one seems capable of defining what good architecture is. We have plenty of posts about spaghetti code, architecture astronauts, etc. But there's few comments with success stories, especially about fixing a spaghetti codebase and what that project looks years down the road. And I think that's because the problem is multi-faceted.
It's not "just" a technical problem. From a technical side, it's primarily lots of little patterns that as a whole add up to producing quality code. But there's also the social side, to hiring, reining in devs, enforcing the code patterns and quality, pushing back on business, etc. I can give lots of examples, but this would be a long post. All of these factors ultimately determine the fate of the project, the quality of the code, and whether it becomes spaghetti code or an over-engineered mess.

Continue this thread — 21 more replies