News for hackers. Stuff that matters.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by jaequery on Wednesday September 18, 2019 @02:16AM (#21002769)
First 1-3 years of coding, I just coded to get sht done. I got a lot of sht done.

Next 4-8 years, I started getting cute with it and applied all kinds of design patterns, Factory, Abstractions, DI, Facade, Singleton you name it. It looked cute and felt good when it all worked but it was a juggling act. There was usually like 2-3 files to touch just to do one thing. UserFactory, UserService, UserModel, User, you get the idea. It got to a point coding now felt like a burden and I started getting allergic reaction to any projects that had more than 50 files.

Next 4-5 years, I made it a mission to only code in a pragmatic, minimalistic way. Best decision I ever made, this have been the most productive time of my career. I don’t look back and never going back again. A simple require and requireAll with basic OOP is all I need on most cases. Most of my project now have less than 10 “core” files minus the standard views/routes/etc. I enjoy just working on code now it makes me happy and also any devs who joins loves it too as they get it right away. I code almost exclusively in Sinatra now btw. Express is great too but I think the ecosystem isn’t there yet for developer happiness.

Keeping code simple is not easy. It takes a lot of trials and errors to know what works and what doesn’t. I realize I code a lot slower now than in the past and that I write much fewer lines of code. It’s both good and bad because sometimes I’d even spend hours just trying to properly name a variable. But I believe this pays off at the end.

You just can’t best simplicity.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by JMTQp8lwXL on Wednesday September 18, 2019 @02:55AM (#21002941)
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" code. I find it tends to be brittle, and it fails the longevity test: you end up frequently having to touch everything, and be aware of the entire state of the system at once, due to a lack of functional style. There are few enforced boundaries between subsystems in this type of code.

Like most things, moderation is key. I only introduce abstractions when there is a meaningful value-add to doing so. This is somewhat subjective, but there is a right level of application of design patterns. Not too much, nor too little.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by stinos on Wednesday September 18, 2019 @03:46AM (#21003152)
In my own experience, it's really a must to go through both over- and under-engineering phase yourself: only then I found I got a really clear view on what's good and bad in approach, allowing me to default to somewhere in between (with outliers when useful) and in any case with focus on simplicity (but again, if needed for e.g. performance that can be violated). All of this is the basic 'learn from your mistakes' principle in the end - and it works.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by fnord123 on Wednesday September 18, 2019 @05:01AM (#21003471)
I don't even think it's a phase.

From what I see in my own experience, overengineering comes from not having a deadline to deliver an actual working piece of software. Unclear requirements. Fear that the code must be perfect against change without knowing what the changes might be.

Underengineering comes from confidence that the issues are too small to worry about. Or the time constraints mean I can't try to find good primitives to make something robust. And if I have to return to it because it's so important, I can re-engineer it then.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by tluyben2 on Wednesday September 18, 2019 @05:33AM (#21003596)
I have been writing software professionally for almost 30 years now and yes, this is exactly what I see too. I find the underengineering far more productive though; because of time constraints I hack something together which works but is brittle (decades experience do help fight the brittleness even in a hurry though) and I do revisit to fix and refactor if the software survives.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by fnord123 on Thursday September 19, 2019 @03:22AM (#21014063)
Underengineering is far more productive but not always possible when you're defining the overarching architecture of a multi team project.

Then you have to rely on experience to do things like definelibg interfaces that can be extended later on instead of overspecifying types. It's hard to balance it just right.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by stinos on Wednesday September 18, 2019 @06:31AM (#21003860)
overengineering comes from not having a deadline

This really resonates: at the height of the phase I spent about 2 years once, half-time developing something new for which there was essentally no deadline. I went totally berserk doing insane stuff like implementing design patterns using templated 'reusable' classes in C++ so whenever something even remotely looked like a pattern I had a class for, I would use that class. Which then needed small fixes of course. And extra logging. Pluggabble. Etc, you get the point :) In the end everything was dropped because I found a much better, much simpler, existing way to do everything though.

But didn't happen to me again afterwards, or at least not to that extent: it was really like having had a severe electric shock; once, but never again, before even coming close to any hot wire my brain is already subconsciously screaming to get away from the thing a.s.a.p.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by delinka on Wednesday September 18, 2019 @11:41AM (#21006532)
Overengineering: I just left an enterprise-y company where the lead software engineer "over-engineered" for the purpose of job security. His philosophy was that if it's layered and convoluted, it's harder to replace him. Oh, we had deadlines. It had to work. Part of "working" is "passing tests" so he also wrote lots of tests that executed the written code but actually tested the mocking framework.

I hated dealing with any of his code.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by psychoslave on Wednesday September 18, 2019 @08:04AM (#21004399)
My experience is that you rarely have the time to make things right, you take the time. And you do so, because you estimate that despite doing so will put you off the deadline, you expect it to be a good bet on the long run.

Not doing so, time required for maintenance will increase, and competing with new feature development time. Of course these new features have deadline already to short even before you add this burden. Moreover, maintaining everything working is the top priority "right now", but making the new development reaching production is prevent the solution to fall into market irrelevance.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by schwurb on Wednesday September 18, 2019 @05:57AM (#21003697)
I never went through the over-engineer phase personally. I am a very very lazy person, which leads to me to correct balance most of times: Not enough abstraction, I suffer because of too much change to the code base, too much abstraction, and I feel pissed about my risk management. Since I suffer greatly when I suffer, I avoid suffering in my own code as much as possible. What also helps is that I plan most of my algorithms and program designs on paper, actually touching a computer is the last step in that process.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by stinos on Wednesday September 18, 2019 @06:18AM (#21003806)
too much abstraction, and I feel pissed about my risk management

Interesting, so it's not a phase for you, but for the rest it sounds exactly like my point, i.e. learning that over-engineering (too much abstraction) is a mistake and as such trying to avoid it.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by schwurb on Wednesday September 18, 2019 @08:41AM (#21004704)
Yes, we are on the same page there. I think due to depression during my formative years, I have a mix of slight apathy towards expectations and a slightly off motivation system, which leads me to be very lazy - really only doing what is necessary to get a mantainable product and not so much caring about what other people want. Working in two software companies during studies was okay, but I really hope to sell my own software one day!

Glad to see you making progress!

Re:Software Architecture Is Overrated, Clear and Simple Desi... by tarsinge on Wednesday September 18, 2019 @03:02AM (#21002982)
I think you can under engineer and still use a pragmatic functional style.

Also yes when it’s under engineered you usually have to touch multiple parts to make a change, but in the end it usually take less time (testing for bugs included since the code is simpler).

Edit: I don’t say under engineering is perfect, but compared to an over engineered code base I prefer the first for maintainability.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by JMTQp8lwXL on Wednesday September 18, 2019 @03:08AM (#21003010)
In theory, I agree with you, but in practice, I rarely see under-engineered code that is functional in style. My conjecture is that people under-engineering aren't even aware of the concepts of imperative vs. functional style.

The more we can think of code as existing in a sandbox that knows nothing about the surrounding system it's in, the better. Because when you need to change that code, you don't need to juggle comprehension of the rest of the system as you edit that code. It makes reasoning about the code much simpler. This is why I agree -- code can be pragmatic and functional.

But if you tend to practice having code existing in little sandboxes, you are essentially practicing design. This might be semantics, but now you have sub-systems with well-defined borders that interact with other sub-systems in proscribed, expected ways. I would consider that, to some degree, the application of design patterns and architectural concepts -- even if it's only the inevitable consequence of writing pragmatic, functional code.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by bayindirh on Wednesday September 18, 2019 @06:57AM (#21003966)
> I think you can under engineer and still use a pragmatic functional style.

I actually believe this, and tried in some occasions for my personal projects.

When you develop the code further, you need to touch everywhere. It starts very neat and being extremely tidy at first, but when you need to add some significant features, the design breaks down pretty badly.

Then, to save the architecture, some significant refactoring runs are required, and boy, these refactorizations are expensive both time and design-wise.

If your project will not add new features over time and relatively compact, under-engineering can deliver pretty nice results. Otherwise, designing with some headroom and flexibility goes a long way.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by jamesb93 on Wednesday September 18, 2019 @07:05PM (#21011429)
You should clarify that your experience us pretty much exclusive to web development which is bot indicative of a lot of work that goes on in software creation and computer science research. Just a weird nit pick of mine that most people here seem to be web devs who assume everyone else is - it creates a weird environment for discussion.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by EGreg on Wednesday September 18, 2019 @10:56AM (#21006064)
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 always include an “options” at the end. Each function can have defaults that you can extend, which means you need a deep-extend method:

https://qbix.com/platform/guide/javascript#functions

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!

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.

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.

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!

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

https://qbix.com/blog/2018/01/17/modern-security-practices-f...

Re:Software Architecture Is Overrated, Clear and Simple Desi... by igor47 on Wednesday September 18, 2019 @11:50AM (#21006619)
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 Desi... by EGreg on Wednesday September 18, 2019 @12:02PM (#21006759)
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 Desi... by igor47 on Wednesday September 18, 2019 @12:26PM (#21006983)
> 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 Desi... by EGreg on Wednesday September 18, 2019 @01:42PM (#21007892)
3. Because it explicitly signifies a place to put those later arguments, in a way that is MAINTAINABLE.

First of all, the last parameter should have a default value of {} — that is, no options, but can still be deferenced in code. So not passing options is ok.

Secondly, if you don’t do this, future developers will keep adding parameters in an ad-hoc manner until you get stuff like:

context.copyImage(src, dest, sx, sy, sw, sh, dx, dy, dw, dh, filter, rotation, matrix, ...)

and your calls will keep looking like:

context.copyImage(a, b, 0,0,30,30, 20,20,40,40, null, 5, null, “foo”)

Not only will it be harder to read for anyone looking at the calls, but also the future function signatures will have parameters in the chronological order they were added — which is often totally unrelated to the order they should be in, but you can only add them at the end.

Since the function should be backward compatible, all new parameters are by definition OPTIONAL and therefore can be added to a hash or object called “options”.

And YES I stand behind this. Years ago I actually recommended this to the PHP language mailing list:

https://grokbase.com/t/php/php-internals/1042mr8yrn/named-pa...

In other words, I wanted the function call syntax in PHP look like the array syntax:

func($a, $b, $c => 3, $d => “foo”);

Simple, and elegantly enforces the above convention while looking “quintessentially” PHP!

4. When you are building a re-usable framework, it’s silly NOT to anticipate future needs. The whole point of a framework is future needs.

Now, you say you should weite code rhat is easy to undeerstand and change. If you hardcofe vales, that’s easy to change - just put a variable there. But if you hardcofe a concention in 100 places, fhat’s not ao easy to change. You can’t just grep for a hardcofed constant.

But ot gets worse rhan that. Other code will come to rely on this “invariant”, which may change later. Again, the wholw goal of my recommendations is to future-proof your code so that future developers will write code rhat grows up around it and can go in any direction, and can play nice with each other.

5. Suppose you are lacking middleware between A and C. So now you want to mock an input from A. Too bad, you can’t. Ok, what if you want to modify something that goes on between A and C? You have to rewrite A or C.

Let me give a real example. Suppose I said that people may have one more articles they write. So I implement a User table and an Article table, which has authorUserId field on it. Simple, right?

Except it’s too simple - one article can at most one author. If instead I had thought ahead and made three tables: Author, Article, and Authorship as a join table with articleId, authorId, then I could have 1 to N mappings in both directions and far more flexibility.

Now you may say — why think ahead? Maybe in the future articles can have more authors and THEN we will refactor the code! Except at that point you’ll have tons of plugins and apps, some beyond your control to change, relying on the details of your implementation.

Of course, you should also use another principle I didn’t mention (because it’s very obvious and popular) namely to write abstract interfaces that don’t leak implementation details, and keep these interfaces as small as possible, so that you can reason about large systems through these “bottlenecks”. But I have found that, on the back-end, it’s just a bit of extra work to add an extra indirection, whether you use it now or not. Instead of saying “we will NEVER do it the other way because it makes no sense”, if it costs you so little, why not allow for it, in case later someone will want it? The interfaces are often a leaky enough abstraction for this to matter.

For example you’d have article.getAuthor() if you didn’t make that extra table join indirection. And now what will article.getAuthor() return when articles can have many authors? It would return a random author, for backward compatibility. With my approach, you would prevent the “older” apps from using dumber interfaces. It’s just a bit extra work for everyone, for huge wins later. And that’s the point.

7. Event streams can be abstracted into pipelines and middleware. You can do undo/redo, store histories, have Merkle Trees and more. Compare SVN and Git :)

8. Sync becomes much easier when everything has a history of states. Look at git. You can just use it. Look at scuttlebutt, blockchains, or other types of merkle trees. Everything becomes super simple to reason about.

This forum could be refactored to be distributed. Everyone owns their own node of the tree and the relationship to its children (replies), and everyone else just replicates them scuttlebutt-style. Expanding a tree is fairly simple, and each branch has a merkle hash. There is no central server.

And the best part - you could start with a centralized app and gradually move to a decentralized, end-to-end encrypted model, if you only had the foresight to make sure that your tables has primary keys corresponding to how people look up some data (node, etc.)

The only thing you’d need to have consensus about is the ordering of replies to a node. And that consensus can be among the repliers or simply dictated by the parent node’s owner.

8. Having a non-extractable private/public key be used to sign requests is better than JUST having a bearer token (cookie). If someone commandeers the cookie via, say, session fixation, they still won’t have your private key. But they need the session id (bearer token) to look things up on the server. This is “piling on”.

Then, on top of this, you can have a blockchain of keys for devices, stored across sites, so you can revoke a device when it’s compromised, or authorize some new device with N previous devices.

You can have the same exact mechanism manage users in a chatroom or other merkle tree structure. This is what keybase does.

You can encrypt data on the server, with people’s public key, and they have to decrypt it.

You have to make sure that the initial signup requires some sort of token to prevent sybil attacks.

In short — once again the approach is to “layer on more security mechanisms”, they should all work independently.

You don’t just rely on HTTPS for example, because a server or CA cert can be compromised. You hash passwords on the client with salts before sending, regardless. Once again this is called “defense in depth”.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by dragonwriter on Wednesday September 18, 2019 @03:55PM (#21009362)
> Secondly, if you don’t do this, future developers will keep adding parameters in an ad-hoc manner

You seem to presume a situation where you have absolute control over the initial signature of functions added to the codebase but no ability to constrain future changes.

1. All parameters that for which a default makes sense should be optional and have a sensible default.

2. (In languages where this is an option) All parameters with a default must be keyword-only.

3. All new parameters to an existing function (from a stable release) must have a sensible default.

> When you are building a re-usable framework, it’s silly NOT to anticipate future needs. The whole point of a framework is future needs.

The point of a framework is to avoid solving the same problem multiple times in each new project. If you haven't needed to solve it twice in two separate projects, be skeptical that you need it in a framework. If you haven't needed it once, don't even consider it. Code for problems you don't have is pure waste.

Much of the advice you offer is going to produce waste because YAGNI; each time they come up the cost may be small, but in aggregate it's going to be a lot of extra zero-value code being written and maintained, bloating development and maintenance costs and timelines. Occasionally, you'll be benefit a little down the line from hitting a problem you correctly anticipated, but often you’ll suffer from having not having anticipated the real constraints of the problem when dealing with it when it wasn't a real need, meaning you’ll have to throw away your just-in-case code anyway, and all the time you'll be dealing with extra complexity dealing with problems you haven't had any real need to address but only imagined might come up in the future.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by darkarmani on Wednesday September 18, 2019 @02:02PM (#21008137)
> 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:

No! Absolutely not! There is a time and a place for this, but it's nearly impossible to reason about the interface if any data can be passed in.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by EGreg on Wednesday September 18, 2019 @03:34PM (#21009111)
I think you misunderstand. It’s not that “any” data can be passed in. The options object is documented in every version. It’s just a place that lets future versions add named parameterd
Re:Software Architecture Is Overrated, Clear and Simple Desi... by Madeindjs on Thursday September 19, 2019 @05:13PM (#21020822)
IMO If a method take many parameters there is a chance that this methods have too many responsibility and can be cut into two methods.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by olalonde on Wednesday September 18, 2019 @01:20PM (#21007635)
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 Desi... by xcubic on Wednesday September 18, 2019 @07:29PM (#21011621)
From someone doing webdev but without studies, is there a small list of simple data structures or algorithms that you would recomend?
Re:Software Architecture Is Overrated, Clear and Simple Desi... by galaxyLogic on Wednesday September 18, 2019 @03:10AM (#21003017)
>started getting cute with it and applied all kinds of design patterns

Even though there are books about design patterns, taking such a book and trying to "apply" its patterns is a bit backwards I think. The idea of patterns is they describe commonly useful solutions, not designs you "should" use.

Once you started to code in "pragmatic, minimalistic way" I assume you found you could apply the same solutions you had found earlier in new contexts. Those are your own design patterns. That is how design patterns work, some patterns of design "emerge", because they are the optimal solutions.

A Design Pattern should be minimalistic, it should only do what is needed, not anything more. It should only solve its problem in optimal, minimal way. But if the problem it is solving is not your problem, you should not use it.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by Scarbutt on Wednesday September 18, 2019 @03:37AM (#21003126)
Even though there are books about design patterns, taking such a book and trying to "apply" its patterns is a bit backwards I think. The idea of patterns is they describe commonly useful solutions, not designs you "should" use.

This nails it, and author does talk about it:

Similarly, knowing about common architecture patterns is a good thing: it helps shorten discussions with people, who understand them the same way as you do. But architecture patterns are not the goal, and they won't substitute for simpler system designs. When designing a system, you might find yourself having accidentally applied a well-known pattern: and this is a good thing. Later, you can reference your approach easier. But the last thing you want to do is taking one or more architecture pattern, using it as a hammer, looking for nails to use it on.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by saiya-jin on Wednesday September 18, 2019 @04:51AM (#21003435)
I agree with you, but that's not how people usually progress. Its more in line with initial discovery of 'the best and battle-tested way to design code'. Immediately they try to apply patterns anytime they see an opportunity for it. They must be taken more seriously from now on, right?

I get it, I went through exactly same hoops. My guess is, we all desperately want to be those aged and wise devs that nail the implementation in first go, without hesitation, knowing exactly what to expect and avoid, covering all corner cases with some elegant snippet. And learning about patterns feels like the surest way to get there.

Of course as we know now that's far from truth, path to seniority can't be fast-tracked by reading a book or two and that's it. But inferiority complex is rife with junior devs, I mean you think you know a bit and then you encounter a codebase where you are completely lost. You see tiny piece of code that takes forever to decipher and fully understand. Who would feel great at that moment

KISS was a thing 20 years ago, any probably even 40 years ago, there is no need to think now its different

Re:Software Architecture Is Overrated, Clear and Simple Desi... by galaxyLogic on Wednesday September 18, 2019 @02:43PM (#21008585)
It is understandable that everybody wants to learn especially junior developers, and it is a good thing to learn, and what better way to learn than try out different things.

Unfortunately then rather than getting something useful done we often just get some learning done, perhaps learning how NOT to do it :-)

The same issue I think affects the tools landscape. People want to use the latest hyped things because ... they want to learn how to use the new tools. The new tools might not be better, but you don't know until you try them.

Where you make a great point I think is that the most important thing to learn is: The simplest solution that works is typically the best. They used to say "YAGNI", You Ain't Gonna Need It.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by feketegy on Wednesday September 18, 2019 @03:50AM (#21003188)
Most devs prepare for the abstraction nirvana. I see a lot of fellow devs creating complicated code, because "in case we need to switch out the database down the road" or "what if we want to run the web app in CLI"

In 20 years of programming I maybe seen one or two times a large application switched database engines and I've never seen a client want to run his/her web application in CLI...

The art in programming is to decide whether you need that abstraction or not.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by UK-Al05 on Wednesday September 18, 2019 @06:50AM (#21003932)
I find the benefits of abstracting away database, isn't so you can swap.

It's that' the high-level business logic does not have any low-level unrelated persistence code in it.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by Double_a_92 on Wednesday September 18, 2019 @04:04AM (#21003243)
> in case we need to switch out the database down the road

I would still kinda consider that. But the solution wouldn't be to create some massive abstraction. Instead I'd try to separate logic from database access code. I.e. avoid reading data from the database while you are in the middle of some calculation, or in the GUI somewhere. If you need the data do it beforehand and pass it in a generic data format.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by nabnob on Wednesday September 18, 2019 @02:06PM (#21008188)
I'm not sure that was the best example to use of an abstraction that leads to more complicated code, with database code I feel like it's way simpler to have it separate from your business logic. That way, there's fewer places where you need to make changes anytime there's a schema change.

Abstracting away the database also makes it easier to write unit tests for your business logic.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by Vinnl on Wednesday September 18, 2019 @05:06AM (#21003489)
It's not just programming, though. A large part of it is defining the product roadmap: code can get a lot better if a product team has the guts to unequivocally say that some features are not going to be part of the product, ever, such as running the web app in CLI. That's not just a programming decision - though I guess influencing the product roadmap could be seen as part of the art in programming as well.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by downtide on Wednesday September 18, 2019 @05:41AM (#21003623)
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.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by james_s_tayler on Wednesday September 18, 2019 @06:07AM (#21003746)
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.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by codr7 on Wednesday September 18, 2019 @12:05PM (#21006786)
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 Desi... by james_s_tayler on Wednesday September 18, 2019 @06:05AM (#21003735)
I agree, but with a caveat. I think more often than not, you're right, worry about things like that just tends to be a waste of time, because while it might happen it mostly doesn't. Vendor lock-in is a good example. Probably not worth losing any sleep over.

However, I definitely see value in making code easy to throw away. That's something slightly different than making something easy to swap out. Entire front-ends being re-written is something I've seen a couple of times. But when they were super-glued to the back end that was very, very expensive to do. They were hard to throw away. I think clean separation between boundaries means when you want to throw something away you can. Doesn't mean it will be easy, but a heck of a lot easier. You don't necessarily always want to replace certain things either, sometimes you just want them gone.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by schwurb on Wednesday September 18, 2019 @06:01AM (#21003712)
Of course it all depends on the application at hand, but databases and other system endpoints are something I treat as volatile. However, I don't commit to the madness of replicating a whole database interface in our codebase. Instead, I find it sufficient to bundle all database access in a single point. (i.e. by using a singleton class). That way, later change is much easier and it's a very low investment in maintenance.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by GuiA on Wednesday September 18, 2019 @02:42AM (#21002889)
Well yes. It all sounds all so easy when you put it like that.

The problem is that, in my experience at least, you can’t just teach junior engineers how to go straight to phase 3. You have to go through phase 1 and 2 to really develop a sense for what makes a solid, streamlined design.

Some never get there - either because they become set in their ways early, or because they work in organizations where the wrong kind of thing is encouraged. Some get there faster - because they’ve worked with mentors or in codebases that accelerated their learning.

But like with any craft, you have to put in the hours and the mistakes.

(Yes, there are John Carmacks in the world who go through all those steps within 18 months when they are 12, but they are 0.0001% of the programming population)

Re:Software Architecture Is Overrated, Clear and Simple Desi... by userbinator on Wednesday September 18, 2019 @08:13AM (#21004479)
I think the state of CS education is actually responsible for a lot of overabstraction; students are taught early to worship abstraction (because of all the buzzwordy benefits it allegedly brings) and apply it liberally, and not taught when not to do it. A good way to counter that might be to get them to read early opensource code (e.g. first few versions of UNIX, some BSD stuff, etc.), which I think is mostly an example of "abstraction done right".
Re:Software Architecture Is Overrated, Clear and Simple Desi... by GuiA on Wednesday September 18, 2019 @10:17AM (#21005670)
Yes, curricula tend to focus on writing code over reading code, which is a shame. Looking at existing code, extending it, refactoring it, etc would ideally be something that students do as much as writing things from scratch.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by taneq on Wednesday September 18, 2019 @03:20AM (#21003060)
Carmack is actually a good example of professional development. A lot of what he talks about is how his style is evolving and the pros and cons of different approaches.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by GuiA on Wednesday September 18, 2019 @03:52AM (#21003196)
Yes, that’s a good addendum. Like any other craft, even the masters have always more to learn.

As they say, it is only when you get your black belt that you are really ready to start learning karate.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by taneq on Wednesday September 18, 2019 @03:15AM (#21003048)
> I realize I code a lot slower now than in the past and that I write much fewer lines of code. It’s both good and bad because sometimes I’d even spend hours just trying to properly name a variable.

I think the important thing happening here is more than just naming. You’re taking the time to fully consider what you’re doing with the new variable in order to name it. That’s time very rarely wasted.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by psychoslave on Wednesday September 18, 2019 @08:19AM (#21004535)
There are other factors here:

- how much time will the code be reread?

- does the carefully selected name does make sense for other readers, future self included? That is, does it help to make things easier to understand for them?

- a good name can be reused extensively over your whole career, so a few hours might well be well invested time from this perspective if you plan to keep a foot in the technical side of the story all along. Actually, a good name is surely something you might have the opportunity to reuse outside a coding context.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by croh on Wednesday September 18, 2019 @03:26AM (#21003081)
Well said. Similar to you, I code now almost exclusively in Flask. I don't want to spend days and night learning (and remembering for interviews) unnecessary abstractions and apis. Instead I prefer to spend more time on CS fundamentals, if I have to. Sad part of this story is broken hiring. Your resume doesn't get short-listed unless it comes with new hyped-shiny-toy. But this can encourage you to put more efforts on finding good employer.

Apart from juggling act you mentioned, there is another caveat. Many devs don't understand exact use-cases of these design patterns and use them in wrong context.

On foot note, If you don't have good team of engineers similar to OP, best way to craft your art is -

- pick up a good library in your subject

- start copying it line by line

- when copying, try to understand everything

- this will teach you lot about designing softwares

Even though this sounds like stupid and time consuming, it is not. Believe me. You don't have to even reach 100 %, just try to reach 33 %. You will learn lot by this in short period.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by paxys on Wednesday September 18, 2019 @03:13AM (#21003037)
This describes my career perfectly. And at every stage I inevitably get annoyed at other engineers not in the same stage as me.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by GordonS on Wednesday September 18, 2019 @02:25PM (#21008397)
I've been on a similar journey, and I've seen this pattern repeat itself again and again!

1. Hack any old shit together, but it works

2. When you actually have to maintain what you previously wrote, you realise (1) doesn't work so well. Then design patterns seem like an epiphany, and you Cargo-cult the shit out of them, using them everywhere. You dogmatically eliminate all code duplicatation, use mocks with wild abandon, and are not happy unless you have 100% test coverage. For bonus points, you also overuse abstraction. A lot.

3. When you actually have to maintain anything you previously wrote, you realise what a tangled mess of abstraction you have made - you can't simply open a file and ascertain what it's doing! You also realise that the tests you wrote to achieve 100% coverage are crap, and don't really prove anything works. You finally reach a zen-like state, realising that simplicity is key. You shun all forms of dogma, and use patterns and abstraction, but only just enough

Re:Software Architecture Is Overrated, Clear and Simple Desi... by tarsinge on Wednesday September 18, 2019 @02:57AM (#21002949)
This mirror my experience too.

I think at its core the issue is that code duplication is irrationally seen as a bad thing. But from my recent experience of the last few years with ultra minimalists approach making a change to a non abstracted code is so much faster. Yes it’s boring and feel unsophisticated, but when you only have flat functions vs an architecture tightly coupled to a business process, it’s a matter of hours vs days/weeks.

In short I would add to the title “because reusability is overrated”. Especially when the trade off is complexity.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by JMTQp8lwXL on Wednesday September 18, 2019 @03:19AM (#21003058)
I've seen code duplication fail me. In my current role, any time we want to spin up a new Node.js process, we "fork" an existing scaffold project. (Some of the repositories are actual forks; many more just copied the scaffold code and init'ed a new git repo). Whenever anything changes to the scaffold, there's no easy way to percolate those changes down the forks (then they all have to be versioned and deployed). It leads to a lot of copy-pasting and busy work that could instead be spent solving more pertinent company problems. Nobody ever considered how, once you end up with a growing X number of copies of what is nearly identical code, how to manage it. It's an increasingly unscalable problem for us. It would be 100% more efficient if all the development happened in a monolith that kept clear lines between the projects that exist as "forks".
Re:Software Architecture Is Overrated, Clear and Simple Desi... by gmueckl on Wednesday September 18, 2019 @06:06AM (#21003740)
There are also cases where code duplication is better than the alternative. Sometimes, you end up writing the same pattern (often a hand full of lines) over and over again in different modules and these copies can't easily be moved to a common place. In this case, it is likely be better to accept the repetition than to mess with high level architecture to worship the gods of DRY. Slavishly following DRY is often a cause for overengineering a system into a tar pit.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by TeMPOraL on Wednesday September 18, 2019 @06:18AM (#21003804)
DRY is unfortunately commonly misunderstood as a principle of avoiding repeating the same code patterns, whereas it's beneficial effects are entirely about avoiding creating repeated copies of a single concept. There are many ways to avoid or mitigate consequences of copying concepts in your system, not all of them involving abstracting similarly-looking code into a method.

Sometimes, a bunch of code repetition shouldn't be DRYed, because they're different concepts, just looking the same. Your language most likely doesn't have means for necessary structural abstraction - Lisp-style macros. If it has, you can sometimes address these cases cleanly and efficiently with a macro by correctly noticing that the concepts are in fact related, they're instance of a same structure or behavior (much like a book on physics and a book on literature are unrelated if you look at the topic, but related if you look at the structure).

And sometimes the best thing to do is to mitigate the consequences - through a quick unit test that fails when you change one thing without changing the other, or even a note in comments. "These two things are related, but we're not enforcing it." Or, "these two things are unrelated, even though they look the same".

Re:Software Architecture Is Overrated, Clear and Simple Desi... by collyw on Wednesday September 18, 2019 @07:02AM (#21003992)
I have come to a similar conclusion lately, though I would say "code reuse" as a goal is the problem. Someone said you shouldn't aim for code reuse, but avoid duplication, which seemed to sum it up better for me.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by james_s_tayler on Wednesday September 18, 2019 @02:47AM (#21002908)
Out of curiosity what kind of projects are that small?

I guess I have hobby projects that are that small, but all my professional work is large, enterprise systems that wouldn't fit in 10 files if they tried.

Makes sense when things are so small to only use what you need. Sounds like you made a reasonable decision for the kinds of things you work on. But when you get past a certain size actual architecture becomes very beneficial.

Of course it's also possible to have a massive enterprise system without any architecture. Believe me it's not very fun.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by flukus on Wednesday September 18, 2019 @03:52AM (#21003197)
I find 90% of the complication in large enterprise projects come from the developers trying to write too much architecture and not enough simple, boring, imperative code. At the moment I'm staring at a validation framework and 6 layers of validator inheritance who's job it is to verify that one number is bigger than another one. That's just for one tiny part of the overall system, nearly everything has to be in some inheritance hierarchy or pattern to minimize duplication or even worse, abstracted into an internal library that makes the entire organisation tightly coupled. God forbid you declare more than simple data class per file. We have tens of thousands of lines of code just to extract a few values from a csv file, tens of thousands more to write xml documents all because someone had to prove how clever they were.

Once you take away all these unnecessary complications you quickly find a lot of "large enterprise software" could be a few scripts dropped into a cgi-bin directory, some could even be a shell script + cron. I think we'd be better off with this as the starting point for all enterprise projects and should not become a "real project" until they past a point of complexity where they really deserve to be.

I'll take small stand alone spaghetti scripts over bloated architectures any day. At least they can be refactored without taking the whole system, all it's libraries and half the enterprise into account.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by james_s_tayler on Wednesday September 18, 2019 @05:46AM (#21003646)
I currently have the opposite problem. Staring a system with zero frameworks where every time the developer wanted to do something they didn't reuse an existing solution, they simply wrote a new one. So there's 10 different ways to create a customer and now there is a requirement to change some validation. It's a major high-risk overhaul of the system to change the validation on a single field of a single entity.

I've seen big enterprise systems that had solid architecture and I quite enjoyed working with them and I've seen the trash-fire variety too.

Abstraction can be wonderful. Abstraction can be ghastly. It's how you wield it. Well designed systems are just that. Well designed. They have solutions that fit their current problems well and make just enough room for the problems of tomorrow, but not for the unanticipatable problems beyond that.

Poorly designed systems don't have solutions that fit their current problems well (or at all), and/or don't have solutions that are amenable to tomorrows problems or have solutions well suited to tomorrows problems, but not todays, or have solutions that fit imaginary problems they will never have.

I think that's what the article fundamentally hints at. Taking the time to look at the problem and taking the time to derive and refine a well fitting solution. If you can do that, you've won.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by frgotmylogin on Wednesday September 18, 2019 @08:01AM (#21004374)
The enterprise project I have been on for quite a while now is overengineered, but the overengineering was done by some really smart people with years of overengineering experience. It works and isn't quite an unmaintainable, dangerous monster, but as someone who is very much in the short, simple, readable code camp, it drives me nuts.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by pytester on Wednesday September 18, 2019 @06:50AM (#21003929)
>Out of curiosity what kind of projects are that small?

A lot of open source projects with a tight focus which solve a specific problem very well.

>I guess I have hobby projects that are that small, but all my professional work is large, enterprise systems that wouldn't fit in 10 files if they tried.

Most of my enterprise work could be broken up into loosely coupled subprojects of that size similar to open source. IME that doesn't tend to happen, but it could.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by StreamBright on Wednesday September 18, 2019 @03:07AM (#21003002)
Not OP but couldn't you split up you project to smaller projects?

>> But when you get past a certain size actual architecture becomes very beneficial.

This article and only rejects the convoluted architecture approach with design patterns and suggests that you can come up with your own design without using these. It is not arguing that there is no need for architecture at all.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by james_s_tayler on Wednesday September 18, 2019 @05:53AM (#21003674)
>Not OP but couldn't you split up you project to smaller projects?

My own personal stuff I can do whatever I like with, work stuff I don't have much say over. Could they be split up? Oh, yes. Does it need to be 1 million lines of code? No... I think it could probably be about 1/5th to maybe even 1/10th of that.

But still, even if it's split into microservices or just smaller modules, the aggregate lines of code required to solve the entire business problem is still a great deal larger than will fit into 10 well crafted files. Was just curious the nature of the work that naturally fits into that size.

>This article and only rejects the convoluted architecture approach with design patterns and suggests that you can come up with your own design without using these. It is not arguing that there is no need for architecture at all.

I think this article is great. I took this article to be advocating for taking a good hard look at the problem at hand and really nutting out a solution that fits it well. It doesn't reject design patters, per se, it rejects not properly thinking things through.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by marcosdumay on Wednesday September 18, 2019 @08:23AM (#21004567)
Not microservices.

Way too many (but not all) enterprise codebases can be divided into small non-interacting pieces that share only a small bit of code. If so, diving them transforms the problem from a monster program that nobody can ever understand into a lot of tractable ones that a single person can read.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by downtide on Wednesday September 18, 2019 @05:25AM (#21003561)
When I couldn't program I almost achieved more! I saved time by picking stuff up and glueing it together. Then later spent ages learning specific softwares, plugins and their wiring only for them to fall out of favour. Later frameworks etc.

A web outfit I worked at should have concentrated on a few small plugins/components that would have handled most of their sites. Instead other behemoths emerged, that added pain and complexity to what should have been very simple sites. Only the author understood the ins and outs of a half finished product, that ended up bastardised for each project, resulting in multiple version hell. But hey this was before good 'Git'ing. Oh for hindsight.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by enriquto on Wednesday September 18, 2019 @03:10AM (#21003018)
> Next 4-8 years, I started getting cute with it and applied all kinds of design patterns, Factory, Abstractions, DI, Facade, Singleton you name it.

What's cute about this madness? There's nothing uglier than that! Simple code is cute. The simpler, the cuter.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by hoseja on Wednesday September 18, 2019 @03:53AM (#21003204)
It's an English idiom. See [1], point 3.

[1] https://en.wiktionary.org/wiki/cute#Adjective

Re:Software Architecture Is Overrated, Clear and Simple Desi... by enriquto on Wednesday September 18, 2019 @04:05AM (#21003248)
Thanks! I ignored this meaning (not a native speaker). Feeling a bit ridiculous now...
Re:Software Architecture Is Overrated, Clear and Simple Desi... by abtinf on Wednesday September 18, 2019 @06:00AM (#21003706)
In the spirit of being helpful: “ignored” implies you knew the meaning and intentionally did not address it. I think you meant “I was unaware of this meaning” or “I didn’t know that.”
Re:Software Architecture Is Overrated, Clear and Simple Desi... by jbn on Wednesday September 18, 2019 @09:02AM (#21004926)
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.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by woolcap on Thursday September 19, 2019 @02:44AM (#21013883)
"I ignored..." = I was aware, but consciously chose not to address it, but perhaps softer than, "I consciously chose not to address it. "I ignored the fact that the sun was out, and returned from the beach sunburned." (I knew the sun would burn me, but went out anyways, with perhaps a shade of not realizing how much I would get burned.)

"I was ignorant of..." = I was unaware. "I was ignorant of the fact that the sun causes sunburn, and returned from the beach sunburned." (I didn't realize the sun would burn me.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by enriquto on Wednesday September 18, 2019 @09:07AM (#21004970)
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

Re:Software Architecture Is Overrated, Clear and Simple Desi... by jbn on Wednesday September 18, 2019 @01:23PM (#21007665)
Right, and it's likely that this verb was imported into English from French :)

TIL!

Re:Software Architecture Is Overrated, Clear and Simple Desi... by iask on Wednesday September 18, 2019 @08:45AM (#21004740)
Thank you for sharing. Same experience here. I felt I was the only one going down this path. Many projects I look at has too many unnecessary layers files etc.

I joined a company recently that has a simple app for end users to take orders over the phone, perform lookup and refunds. Something that can be built in a few days, seriously. When I looked at the code - WTF!!! The previous dev over architected this thing. Unnecessary layers, interfaces etc. one simple change can take hours.

I think developers need a little bit of management experience to understand the impact of these complexity. At the very end, companies just want something usable to stay in the game...a Honda and not a Rolls.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by amelius on Wednesday September 18, 2019 @06:58AM (#21003972)
It looks like you were applying design patterns "just because". Obviously this is not a good thing.

A better approach is to take some time and think about all the requirements of your project, and to take into account what requirements might be added later. With that in mind, you can choose the abstractions that you need, and from there start coding. That way, your design patterns start working for you instead of against you.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by naikrovek on Wednesday September 18, 2019 @05:34PM (#21010467)
yes, and the problem is that carefully engineering your solutions is not what's taught; applying design patterns is what's taught, both in college and at most/all large employers (certainly all of the ones I've worked for.)
Re:Software Architecture Is Overrated, Clear and Simple Desi... by StreamBright on Wednesday September 18, 2019 @03:02AM (#21002981)
Exactly. I never got into OOP design patterns and my co-workers could not convince me this is a good idea. I thought for a while that I am crazy but then I got to know Erlang and Clojure. Joe and Rich set me straight on software design.

>> Keeping code simple is not easy. It takes a lot of trials and errors to know what works and what doesn’t.

Refactoring helps. I usually achieve 20-40% reduction with the first refactoring.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by jacquesm on Wednesday September 18, 2019 @03:05AM (#21002992)
Even OOP has its place. I once wrote a simulation of a physical system with a lot of moving parts and OOP made the problem tractable and the code readable and maintainable. I don't think any other style of coding would have had such an enlightening effect on that particular problem.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by mac01021 on Wednesday September 18, 2019 @10:08AM (#21005575)
Are you able to provide any more detail about what the simulation had to do, and how OOP helped?
Re:Software Architecture Is Overrated, Clear and Simple Desi... by jacquesm on Wednesday September 18, 2019 @10:37AM (#21005872)
Lots of mechanical linkages interacting with each other. Move one and everything else moves as well. Gears, shafts, levers, chains (modeled as independent links), that sort of thing.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by StreamBright on Wednesday September 18, 2019 @03:10AM (#21003016)
Totally. For me just AbstractUserGeneratorFactory does not make sense.

You can have a look here to get examples:

https://docs.spring.io/spring/docs/3.0.x/javadoc-api/allclas...

Re:Software Architecture Is Overrated, Clear and Simple Desi... by james_s_tayler on Wednesday September 18, 2019 @06:18AM (#21003809)
It's actually a pretty incredible framework.

While it might just look like word soup from that particular vantage point I'd venture to say that Spring Framework is one of the most successful examples of OOP in history. It has massive adoption because of its sheer flexibility which all of those abstract generator factories give it.

Granted, I think Ruby on Rails is also an amazing project. For slightly different reasons, but then again, they're different use cases serving different paradigms and different groups of people.

It isn't the paradigm that makes something good or bad or better or worse. It's the quality of the implementation.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by StreamBright on Wednesday September 18, 2019 @08:48AM (#21004780)
Sorry I am not trying to turn this into a framework discussion. I just used that list the exhibit the sort of naming that I do not really like. I like if I can tell what my code does. I usually use verbs in naming methods create, update, delete, add, remove, run, wait, etc. and try to name the classes (or more likely just packages, modules) after what they do.

Regarding your comment about the quality of implementation, I agree. This is why I like paradigms that are simple enough for everybody to understand.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by wonderwonder on Wednesday September 18, 2019 @09:41AM (#21005313)
I've always been happy with just OOP and dependency injection. Anything more and things start to get difficult to follow. Currently working on a a legacy system that uses micro services and it takes hours just to figure out where the code is that needs to be changed and to trace how those changes will be propagated through the system.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by dgellow on Wednesday September 18, 2019 @02:59AM (#21002963)
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).
Re:Software Architecture Is Overrated, Clear and Simple Desi... by TeMPOraL on Wednesday September 18, 2019 @06:06AM (#21003739)
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 prevented me from understanding the core insights of "dependency injection".
Re:Software Architecture Is Overrated, Clear and Simple Desi... by dgellow on Wednesday September 18, 2019 @12:00PM (#21006722)
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 Desi... by TeMPOraL on Wednesday September 18, 2019 @01:48PM (#21007968)
Depending how you look at it, you could argue that classical approach to SOLID's dependency inversion is an amalgamation of two separate concerns - dependency injection for ensuring that neither "higher" nor "lower" level depend on the other directly, plus a type system restricting what operations are available to both. There are so many ways to look at and reason about the problem of structuring programs that pretty much every year I discover a new perspective on an old thing that blows my mind.

Now my enlightening moment about dependency injection was this: it's literally as simple as passing an argument to a function. In a functional approach, you may be passing lots of values and closures expressing dependencies with surgical precision, in an object-oriented imperative approach you might pass an instance conforming to an interface just once. But it's the same concept.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by winrid on Wednesday September 18, 2019 @02:34AM (#21002851)
You can break things up without overdesign right?

I think you should do what is easiest most of the time. However, that is hard to measure. Easiest now, or when you need to finish this and move onto the next thing without spending two more sprints fixing bugs?

I prefer small/reasonably sized components because I can easily cover them in unit tests and sleep easier at night. I built a survey builder at one company (think mix of survey monkey/qualtrics) and that is probably over 100 files. But the codebase is straightforward and simple (no complicated inheritance, one tree data structure for pathing, lots of code reuse)...

Re:Software Architecture Is Overrated, Clear and Simple Desi... by JMTQp8lwXL on Wednesday September 18, 2019 @03:00AM (#21002965)
Breaking things up is, by definition, design. Having meaningfully enforced boundaries between subsystems, that collectively add up to forming one larger project, is applying the concept of design.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by lmm on Wednesday September 18, 2019 @03:05AM (#21002994)
You can define it that way, but in that case my position would be: devoting time and effort to design leads to worse design than not doing so.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by JMTQp8lwXL on Wednesday September 18, 2019 @03:16AM (#21003051)
It depends on how carefully you've considered requirements before you begin coding. Sometimes when I start coding, it triggers the realization that I need to change the design, because I failed to deeply consider something well enough.

When you're designing (paper, pen, boxes, arrows, no code), it can be easy to hand-wave or fail to consider real problems you might encounter.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by lmm on Wednesday September 18, 2019 @03:34AM (#21003112)
Indeed. I'd argue that this is so common that it is better to begin coding first, and allow any "design" to emerge, rather than trying to design before coding. Perhaps with extreme care one could achieve a decent design up front, but it would surely take much more effort than simply being willing to refactor as one goes.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by TeMPOraL on Wednesday September 18, 2019 @06:02AM (#21003718)
I've learned to prefer doing both. I start with spending enough time with pen and paper/whiteboard to get a coherent picture of what I want to build and how, and then I start coding it. I flip between "design" and "code" whenever I start to feel that current activity is getting hard. Getting increasingly confused as to what functions to write, how, and where to put them? I switch to design phase and sort it out at a higher level. Starting to feel I'm losing touch with the ground, or that I'm not able to figure out which design option is better? I go back to code and write what I can until the code itself reveals answers.

In essence, I see creating software as a dance between higher-level, structural concerns and low-level, immediate needs. Since one mode solves the problems found in the other, I try to be working in whichever mode I can make progress most effectively, and flip as soon as that changes.

Re:Software Architecture Is Overrated, Clear and Simple Desi... by yodsanklai on Wednesday September 18, 2019 @10:49AM (#21005980)
You can't beat simplicity, but software aren't planned entities. They evolve from the collaboration of multiple persons with a variety of skills and personalities, working together to meet deadlines.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by afpx on Wednesday September 18, 2019 @09:34AM (#21005223)
The only problem is that it takes at least 10 years to get to that point. No one has found a shortcut, yet.
Re:Software Architecture Is Overrated, Clear and Simple Desi... by nine_k on Wednesday September 18, 2019 @09:38AM (#21005273)
"Simplicity does not precede complexity, but follows it."

This is why it's often worth it to come up with a complicated design, work on it without implementing it as much as possible, think it through, understand where the core functionality lies, and make a new, much simpler design.