Live data from Hacker News

Software Architecture Is Overrated, Clear and Simple Design Is Underrated

blog.pragmaticengineer.com

181–190 of 218 posts

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#181
post #170

Earlier quoted context omitted.

Over my career, I've worked with engineers that like to over-engineer and under-engineer. The over-engineered code looked like russian dolls: had many layers to it, and some of the abstractions offered no value. That can make onboarding to such code unnecessarily complex. On the other hand, under-engineered code made very little of use of even simple data structures or algorithms. I like to call it "chicken scratch"…

In general I have found — over 20 years of experience architecting software - the following: 1. Platforms and reusable frameworks should be architected as well as possible. Apps can be whatever. 2. A developer who writes clean code and documents it is far better than a “10x” developer, unless you have budget for only one developer. 3. Functions should have extensibility, put the required parameters as parameters and…

This list is full of hilariously terrible advice. Was that intentional? On the internet, nobody know if you're a dog or being sarcastic, and I dread stumbling across a code base where someone took some of this stuff seriously.

Examples: > if you can have an extra indirection, add it.

> Use events instead of functions.

> You never know when someone may need something else!

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#182
post #22

Earlier quoted context omitted.

What about tests? In my experience simple code without abstractions often becomes a pain to write tests for. For example that’s one of the main reason I see to use some form of Dependency Injection and other indirections, even if in practice you have only two implementation of each dependencies (once in your tests, once the real one).

Basic dependency injection is just functional style - code getting its dependencies as arguments. I feel it's often actually simpler than having code manage its own dependencies. I didn't think that until recently, though, because my primary exposure was always bloated Enterprise Java DI frameworks written in pre-Java 8 style. I'm not saying the frameworks were bad per se, just that the amount of incidental bloat pre…

I gave DI as an example, but other types of abstractions can also make an implementation more complex (i.e: less simple) but easier (or just make it possible) to test, which can be quite important (dependending on the context of course).

Now for DI being a functional programming principle, I don't know, I guess you could argue for this. I personally learned it as a way to satisfy the "D" from the SOLID principles, so in a context related to object oriented programming. But there is always some level of overlap between paradigms.

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#183
post #181
post #170

Earlier quoted context omitted.

In general I have found — over 20 years of experience architecting software - the following: 1. Platforms and reusable frameworks should be architected as well as possible. Apps can be whatever. 2. A developer who writes clean code and documents it is far better than a “10x” developer, unless you have budget for only one developer. 3. Functions should have extensibility, put the required parameters as parameters and…

This list is full of hilariously terrible advice. Was that intentional? On the internet, nobody know if you're a dog or being sarcastic, and I dread stumbling across a code base where someone took some of this stuff seriously. Examples: > if you can have an extra indirection, add it. > Use events instead of functions. > You never know when someone may need something else!

Please be specific about the issues and let’s discuss. I am serious - this list is optimized for maintainability of code. Developer time is more valuable than processor cycles, in most cases. Unless you are the kind of person who would argue that C++ introducing object orientation and virtual methods made everything slower and that extra indirection by default is hilariously bad architecture?

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#184

Earlier quoted context omitted.

Yeah I had a manager that was quite good at throwing out functionality. Didn't like it at the time, but they were mostly right - of course they were just trying to save money.

I like this. Because time after time after time I have seen the opposite. Managers saying "but we might need it again later" and... We. Never. Have. And even if we did... its still under source control if you really want to dig it out.

Second that, after 34 years in the game I'm always on the lookout for dead or dying code. Every line I can put out of its misery is one less to deal with in the future.

And I find that removing dead code often unlocks further improvements that become obvious without the noise.

Even if the functionality is needed down the line, it tends to require massive rewrites to catch up.

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#185

Services at Uber are pretty much all stateless Go or Java executables, running on a central shared Mesos cluster per zone, exposing and consuming Thrift interfaces. There is one service mesh, one IDL registry, one way to do routing. There is one managed Kafka infrastructure with opinionated client libraries. There are a handful of managed storage solutions. There is one big Hive where all the Kafka topics and datasto…

Umm:

    + all stateless Go or Java executables
    + running on a central shared Mesos cluster per zone
    + one service mesh
    + one IDL registry, 
    + one way to do routing
    + one managed Kafka infrastructure
    - handful of managed storage solutions
    + one big Hive where all the Kafka topics and datastores are archived, 
    + one big Airflow (fork) operating the many thousands of pipelines computing derived tables. 
    + Almost all Java services now live in a monorepo with a
    + unified build system. 
    + Go services are on their way into one. 
    + Stdout and stderr go to a single log aggregation system.

    = +11 singular/unified things, forming a single, larger system.
" It takes pretty strong justification to take a nonstandard dependency ... Even within most services you will find a pretty consistent set of layers ... "

Maybe I'm misunderstanding, but how in the world do you get 'bazaar' out of this?

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#186
I remember reading somewhere, that it's wise to avoid naming your classes after design patterns. It only leads to discussions about technicalities.

Makes sense to apply this to bigger designs, discussing the concepts is more important than following the book by the letter.

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#187
post #183
post #181

Earlier quoted context omitted.

This list is full of hilariously terrible advice. Was that intentional? On the internet, nobody know if you're a dog or being sarcastic, and I dread stumbling across a code base where someone took some of this stuff seriously. Examples: > if you can have an extra indirection, add it. > Use events instead of functions. > You never know when someone may need something else!

Please be specific about the issues and let’s discuss. I am serious - this list is optimized for maintainability of code. Developer time is more valuable than processor cycles, in most cases. Unless you are the kind of person who would argue that C++ introducing object orientation and virtual methods made everything slower and that extra indirection by default is hilariously bad architecture?

> 3. Functions should have extensibility, put the required parameters as parameters and always include an “options” at the end. Each function can have defaults that you can extend, which means you need a deep-extend method:

counter-point: why not write functions that take the arguments they need? if they need more arguments later, why not add them later?

> 4. When in doubt whether to do convention A or B, take a bit more time to do C which can handle both, and add the convention in a config. You never know when someone may need something else!

counter-point: why try to anticipate future needs? maybe it won't happen. maybe it'll be something you totally don't expect. you should write code that's easy to understand and change, so it can react to future requirements. you should not write code that's bloated with unnecessary features, because it slows down your future ability to iterate.

> 5. Similar to 4, if you can have an extra indirection, add it. So you can let others hook into “before” and “after” hooks at any point. Use events instead of functions.

have you ever tried to figure out how a piece of functionality is implemented, only to go chasing it across 10 files because of indirection? have you ever had a piece of code that runs, but you don't know why it's running because you can't tell which things are firing what events? have you ever had to ask the question, "what happens when i execute this function", but been unable to answer because of hooks/observers that are not directly connected to that function?

my counter-point: use the barest minimum of functionality you actually need. stick with functions and maintain linear control flow with minimal side effects.

> 6. In fact try to have event driven architecture rather than futzing around with mutating data. The easiest way to sync is to maintain a linear total order for events.

if you have to mutate data, you should mutate data? not sure how events save you.

> 7. Think about how lookups will proceed and partition everything by those keys. Sometimes you need to have duplicate tables and keep a sync from a “primary” table to a “secodary” one in the app layer. Doing this allows you to do sharding or even go serverless peer-to-peer later!

wow! serverless peer-to-peer! i can't wait to re-write my app, i'm sure my customers will love the new architecture! /s -- on a serious note, while distributed sync is sometimes required (for instance, state kept in the JS front-end app that is a copy of the DB-preserved state on the backend), keeping them in sync can be a nightmare, and you should avoid this at all costs if possible.

> 8. Security: more checks are better than less. Pile on private keys, bearer tokens (api or cookie), and so on. Use a device keychain

in my experience, 80% of all bugs are security bugs (that number may be as low as 20% if you use the OPs advice to increase your bug count). while security is important, you should avoid "[piling] it on", and instead be thoughtful about it. separate authentication (accomplished with keys/tokens/etc...) from authorization (accomplished through checks of the identity at points of functionality).

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#188
post #170

Earlier quoted context omitted.

Over my career, I've worked with engineers that like to over-engineer and under-engineer. The over-engineered code looked like russian dolls: had many layers to it, and some of the abstractions offered no value. That can make onboarding to such code unnecessarily complex. On the other hand, under-engineered code made very little of use of even simple data structures or algorithms. I like to call it "chicken scratch"…

In general I have found — over 20 years of experience architecting software - the following: 1. Platforms and reusable frameworks should be architected as well as possible. Apps can be whatever. 2. A developer who writes clean code and documents it is far better than a “10x” developer, unless you have budget for only one developer. 3. Functions should have extensibility, put the required parameters as parameters and…

[deleted]

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#189
post #170

Earlier quoted context omitted.

Over my career, I've worked with engineers that like to over-engineer and under-engineer. The over-engineered code looked like russian dolls: had many layers to it, and some of the abstractions offered no value. That can make onboarding to such code unnecessarily complex. On the other hand, under-engineered code made very little of use of even simple data structures or algorithms. I like to call it "chicken scratch"…

In general I have found — over 20 years of experience architecting software - the following: 1. Platforms and reusable frameworks should be architected as well as possible. Apps can be whatever. 2. A developer who writes clean code and documents it is far better than a “10x” developer, unless you have budget for only one developer. 3. Functions should have extensibility, put the required parameters as parameters and…

Not sure you are aware but it seems you are describing "event sourcing" in point 6. [0]

[0] https://martinfowler.com/eaaDev/EventSourcing.html

Re: Software Architecture Is Overrated, Clear and Simple Design Is Underrated

#190
post #148

Earlier quoted context omitted.

not to nitpick any more than necessary, but I don't think that's entirely correct: "I have ignored" implies that GP knew the meaning and intentionally did not address it, while "I ignored" is correct and also means “I was unaware of this meaning” or “I didn’t know that.” ... at least that's how I see it.

according to wiktionary [1], this is indeed a possible meaning of the verb "to ignore", but it is marked as "obsolete". This is a case of false friend when translating from french, where this meaning is the first one [2]. [1] https://en.wiktionary.org/wiki/ignore#Verb [2] https://fr.wiktionary.org/wiki/ignorer#Verbe

Right, and it's likely that this verb was imported into English from French :)

TIL!

Post reply on HN