What is orthogonality?

25

Within the context of software development what does it mean to be orthogonal?

Why is it important to follow it?

    
asked by Maniero 06.04.2017 в 13:43
source

1 answer

25

Something is orthogonal to something else if you change something in it it will not affect anything else. There is no dependency relationship.

It is very important to seek orthogonality whenever possible. Imagine if a car changes direction when you accelerate. Bad, right? In the car accelerator and steering wheel are orthogonal. In a helicopter they have not been able to do this and to increase the speed they have to compensate for other controls to keep the helicopter stable.

We can also talk about side effects. If your code does something watertight, only related to itself, it is orthogonal, has no side effects. If you have to worry about what will happen elsewhere when something changes in it then it is not orthogonal.

What is not DRY is not orthogonal. If you did not apply this principle, when you change in one place you have to change in your repetitions.

Orthogonality is related not exclusively to the principle of SRP .

A programming language is one of the most complicated things to do because a lot of things are not orthogonal. Each feature works well on its own, but along with all the other has a lot of complication when there is intersection. When features can be used together without constraints and complications it is orthogonal.

It's important to manage complexity, ease maintenance, and reduce the need for testing.

    
answered by 06.04.2017 / 13:43
source