News for hackers. Stuff that matters.
Re:Software Architecture Guide by mobjack on Saturday August 24, 2019 @11:52AM (#20787840)
Software development is as much of an art as a science.

Personally I've seen people double down on bad design decisions early in a project that becomes major pain to deal with later on. It is easy to see that if they spent a little extra time on quality in the beginning it would pay off in a few weeks or even sooner.

I also see others spend too much time trying to be perfect in the beginning and nothing ever gets delivered or the over engineered solution creates its own form of tech debt.

Every situation is different so you need to use judgement whether to apply someone's advice.

Re:Software Architecture Guide by goostavos on Saturday August 24, 2019 @03:38PM (#20789242)
>need to use judgement

I'd put this as the only real Golden Rule of software development. There is so much blind cargo culting around best practices / code / architecture in our industry that, with some engineers, human judgement seems to have been replaced with someone else's paint-by-numbers rules. Sometimes, man, it just makes sense to take a step back, look at what you're actually building, and ask what makes sense _for this case_. Sometimes the stupid thing is the best option. Sometimes it's not. Judgement should trump all else.

Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @12:34PM (#20788098)
Software development doesn't need to be an art and it doesn't need to be a science either.

By science I mean using data and statistical evidence to drive development, by Art I mean using your gut and your intuition to drive development.

A computer is a deterministic system. It is 100% predictable and follows an exact set of rules. Software development is amenable to proof, logic and theory. You don't need to make decisions driven by data or your gut if the problem space can be described by a logical and axiomatic theory.

The problem is that the current "theory" is incomplete and not all parts of systems are amenable to statistical measurement. Thus a proper system architect needs to unify Theory, Science and Art to form a cohesive framework of system architecture.

Theory is priority because it says definitive things about the system, Science is secondary and operates as a data driven backup for places theory is currently incomplete, and Art is basically the catch all admission that there is no data or theory to back up the problem space and you're just going to have to rely on your intuition.

The problem with Martin Fowler is that all his stuff is 100% Art. It's just made up stuff from intuition and buzz words. Art is largely ad-hoc and does involve a lot of guess work that is often wrong. People identify with Martin Fowlers stuff because they identify with it on the "gut" level. It "feels" right. Your feelings are not a good way to do engineering, you rely only on intuition when you have no choice.

Fowler is also a big Object Oriented Architect. The thing with Object Orientation is that it has no basis in theory or science and is almost 100% art. The pattern is starting to fall out of favor because people are realizing that they tend to build over-complicated systems when following the pattern because they are largely just relying on their gut intuition to build these things using primitives that are validated by the same flawed intuition.

Re:Software Architecture Guide by streetcat1 on Saturday August 24, 2019 @12:49PM (#20788183)
> The thing with Object Orientation is that it has no basis in theory or science and is almost 100% art.

Absolutely incorrect.

The data part of OO is based on set theory as formalised in the database design research and type systems.

The dynamic part of OO is based on finite state machines.

The data abstraction and information hiding part is based on the work of barbara liskov (for which she won the Turing award) - https://en.wikipedia.org/wiki/Barbara_Liskov

Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @03:57PM (#20789345)
>Absolutely incorrect.

I said OO didn't have basis in theory or science. By basis I mean it wasn't derived from theory. Rather it was created as more of an "artistic" endeavor and later it was fit into a framework of an existing theory. You should know almost ANY system can be broken down to fit into an existing theory from a projectile object, to a flying plane, to the weather, to an object oriented programming language. Thus following that line of thought ANYTHING can be a part of a theory but I use the term "basis" to emphasize that something can be derived out of theory.

>The data part of OO is based on set theory as formalised in the database design research and type systems.

I highly disagree. Type systems are not exclusive to OO, additionally the OO type system allows for mutation which is basically not at all part of set theory at all. Also type systems and database systems didn't formalize set theory. Set theory comes from mathematics.

>The dynamic part of OO is based on finite state machines.

This I can agree. A state machine modifies a change of state which is closer to the definition of an object in OOP.

>The data abstraction and information hiding part is based on the work of barbara liskov (for which she won the Turing award) - https://en.wikipedia.org/wiki/Barbara_Liskov

This has more to do with the type system then it does with OOP. Also note if you read the paper. Her paper has no data, statistics, formal theory, rigor, theorems, proofs or axioms. So although she won the turing award, although this is a research paper... it is largely "artistic" in the sense I defined it. See the paper here:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.136...

Note that her paper is important, I am not discounting it. But it is largely more in the realm of design then it is in the realm of theory and science.

Re:Software Architecture Guide by streetcat1 on Saturday August 24, 2019 @04:38PM (#20789557)
She developed the axiomatic theory in a later book:

https://mitpress.mit.edu/books/abstraction-and-specification...

Were she propose an axiomatic theory for OO interface design.

Definitely not artistic.

The only thing artistic in OO (as someone who practice it in the last 30 years), is finding the initial set of objects. But you will have this issue with any technique.

Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @05:20PM (#20789783)
>The only thing artistic in OO (as someone who practice it in the last 30 years), is finding the initial set of objects. But you will have this issue with any technique.

OO is highly artistic. It's not just the initial set of objects you decide on, but you have to decide how each and every single object composes and which objects compose. There's multitudes of techniques for how to compose objects and when to compose: Inheritance, dependency injection, Object composition, etc, etc. Within each of these techniques you still have to write custom code, what is the parent, what is the child? What property overrides what? How does the parent use the injected object? etc etc... You are literally designing the system rather than operating within a theoretical framework. It is largely art.

If you operated within the framework of an existing theory you would be able to much better predict the outcome of a system at scale, but because in OO you are creating the system from scratch for almost every application it is largely unpredictable.

In mathematics all theorems flow from your choice of axioms. There is little room for deviation.

Interface is not exclusive to OO. It's a seperate concept. I don't have access to that book so I can't say what she talks about in the book specifically but an interface is not exclusive to OO. The concept exists in mathematics as well which deals more with functions and types rather than objects.

Additionally OO to my knowledge came later after her paper on abstraction. Alan Kay developed OO. Then OO as we use it today came when JAVA and C++ grafted parts of the concept into the framework of procedural languages. This is not deriving a language from theory, it's more of an organic evolution of concepts. This isn't bad, but it's not axiomatic, scientific or theoretical. It is art through and through.

As I said, any system artificially created or not can be fit into the framework of some theory. There is a huge difference though between systems that are designed artistically vs systems that are derived from theoretical knowledge.

Re:Software Architecture Guide by perlgeek on Saturday August 24, 2019 @12:50PM (#20788190)
> A computer is a deterministic system. It is 100% predictable and follows an exact set of rules. Software development is amenable to proof, logic and theory. You don't need to make decisions driven by data or your gut if the problem space can be described by a logical and axiomatic theory.

That's true, only if you can assume perfect knowledge about the problems/requirements, the data, the environment, and how (if at all) those will change.

In practice, none of these tend to be true, and that is where a lot of gut feeling will come in.

An experienced practitioner will just know that certain modules / feature sets will grow and grow and grow over time, and will take special care to build a particular robust approach for that area. Or that certain kinds of data are often of low quality.

Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @01:10PM (#20788339)
Yes this is where the "Art" that I described also comes into play. We have no theory that can predict the output of a human brain therefore we can't theoretically derive what requirements a customer will want or change over a span of time.

However...

There is something sort of new from the academic side that could potentially be a theory that can deal with problem you describe.

At a high level the theory looks almost like a formal language for "design" and "abstraction." It's called category theory. It's new-ish so it doesn't yet solve the problem you describe but I see the outlines of it within the framework of the theory.

Re:Software Architecture Guide by lidHanteyk on Saturday August 24, 2019 @06:02PM (#20790000)
Category theory is nearly a century old; what are you talking about? People write code today to solve these problems, and it's category-theoretic code: https://www.categoricaldata.net/fql.html
Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @06:53PM (#20790203)
Yes yes, you are right. I mean new-ish in it's application to things outside of math. And also very new to programming.

In terms of just pure math though, category theory is very new when compared to most of the disciplines around today.

Also you are completely wrong about it being a century old. It was invented in the 1940s.

I'm assuming you just googled it to find counter points. That being said you missed something even OLDER then CQL and the most popular and definitive use of CT in programming today:

Haskell.

Anyway my main point is that Category Theory can answer some questions about 'deriving' an architecture for a problem rather than having a person 'design' one. The way category theory is used and haskell and CQL is as a framework. In haskell and CQL it's more about designing the system within the constraints of category theory then it is about deriving a system. The derivation of a system from a formal theory was ultimately what I was trying to get at.

You can sort of see an outline for the possibility of this happening when you study CT. I'm being really speculative here in case I failed to convey that. Such a system doesn't actually exist (yet). That's all.

Re:Software Architecture Guide by lidHanteyk on Sunday August 25, 2019 @10:04AM (#20793015)
Haskell is not really category-theoretic. The category Hask doesn't quite line up with real-world Haskell. The disconnection is well-understood and well-documented [0][1].

Category theory can directly give us systems from theories. See the papers behind FQL/CQL for more details, especially [2] and [3].

[0] https://wiki.haskell.org/Hask

[1] http://www.cse.chalmers.se/~nad/publications/danielsson-et-a...

[2] https://arxiv.org/abs/1102.1889v2

[3] https://arxiv.org/abs/1706.00526

Re:Software Architecture Guide by crimsonalucard on Sunday August 25, 2019 @12:56PM (#20793991)
Well you're not technically wrong about the Haskell thing. I'll look into FQL and CQL. If such a thing exists, what in your opinion is stopping an architect from using it?

Is it just that it's not popular or are there flaws?

Re:Software Architecture Guide by lidHanteyk on Sunday August 25, 2019 @10:12PM (#20796974)
If you use it now, and it ends up being popular like Java or Python or Haskell are popular today, then you can expect a two-decade delay before you're vindicated.
Re:Software Architecture Guide by perlgeek on Saturday August 24, 2019 @04:55PM (#20789651)
What's the relation between category theory and changing requirements? You lost me there...
Re:Software Architecture Guide by crimsonalucard on Saturday August 24, 2019 @07:13PM (#20790283)
An example:

Since category theory looks almost like a formal theory of "design" and "abstraction" is looks like if one day someone could come up with an algorithm or function to formally derive a solution given a set of requirements. To anticipate changing requirements you simply need to adjust the initial set of requirements to be more broader and then this hypothetical function would output a system that can handle potential changes that you anticipated.

This is all hand-wavy and not concrete. Many people who study CT see it as currently the closest thing to a formal theory of "design" and "abstraction." If this is true then techniques or algorithms for deriving architectures of systems can become turn key.

Of course let me emphasize, I'm just speculating here. Not talking about anything that actually exists. Just saying that if you study CT you can kind of see this kind of thing existing sometime in the future.

Re:Software Architecture Guide by krapht on Sunday August 25, 2019 @06:15AM (#20792207)
Proving diagrams commute with abstract nonsense is not going to help the average programmer. At most it's a formalism that will help people who design programmer's tools reason about their system, much like relational algebra for databases or Hoare logic for imperative programming, or UML.
Re:Software Architecture Guide by crimsonalucard on Sunday August 25, 2019 @12:54PM (#20793977)
Relational algebra is more or less isomorphic to SQL if you're doing SQL you're doing relational algebra.

Hoar logic can prove your programs 100% correct. This is useful for anyone who wants to write a program that's bug free.

UML is more of a visualization tool then a theoretical tool.

>Proving diagrams commute with abstract nonsense is not going to help the average programmer.

What in the world is a proving diagram, and what is abstract nonsense? Please be more clear with your explanations. I am not talking about diagrams and trying to say they commute with anything.