Why is c not orthogonal




















In theory, depending on the theoretical functional language, it may be true. In practice no, even functional languages have ways to change state. I bet that helicopter example is from "Pragmatic Programmer" : — Sreekanth Karumanaghat. Show 3 more comments. Raymond's "Art of UNIX programming" Orthogonality is one of the most important properties that can help make even complex designs compact.

Federico klez Culloca Federico klez Culloca Think of it has being able to change one thing without having an unseen affect on another part. Martin Beckett Martin Beckett Khaled Alshaya Khaled Alshaya Actually I saw this in my book and still don't understand what is that.

LOL I'm using this book and saw this question on online quiz of the book. What a coincidence. Maybe I should read first chapter, too. It's simply saying that return and arrays are more complex when put together: you can't use return around arrays without thinking about the interaction between them. Ideally, you would know what return means, and what an array is, and so you would know what returning an array would do, but actually, it's more complex than that, because C exposes implementation details about arrays and return.

This sense of "orthogonal" is covered by: en. This is the "more right" answer about orthogonality in context of programming. Lee B Lee B 2, 11 11 silver badges 16 16 bronze badges. For instance, in one language you can have: str. On a language more orthogonal, you would always use str.

When you would clone an object or do anything else, you would know whether to use clone obj or obj. Asrail Asrail 1 1 silver badge 7 7 bronze badges. This answer isn't consistent to others; this just claims consistency between function calls or overall structure in contrast to others that are on the lines of "less-coupling" or "side-effectlessness".

This is the usage I usually have heard. I think the reason it is orthogonal is that if you have X. ToString and X. GetType, you can vary the object and the syntax is the same, or you can vary the function and the syntax is the same.

The object is independent of the function. From Robert W. Sebesta's "Concepts of Programming Languages": As examples of the lack of orthogonality in a high-level language, consider the following rules and exceptions in C. Alireza Rezaee 89 6 6 bronze badges.

Max Stephen Max Stephen 71 3 3 bronze badges. Oh thanks I just visited this stub en. From Wikipedia : Orthogonality is a system design property facilitating feasibility and compactness of complex designs. Laurence Gonsalves Laurence Gonsalves k 32 32 gold badges silver badges bronze badges. Features are orthogonal if there are no restrictions on how they may be combined Example : non-orthogonality PASCAL: functions can't return structured types. Functional Languages are highly orthogonal.

Real life examples of orthogonality in programming languages There are a lot of answers already that explain what orthogonality generally is while specifying some made up examples. Ahmet Alp Balkan Jan Jan 1, 10 10 silver badges 24 24 bronze badges. Dil Dil 1 1 silver badge 2 2 bronze badges.

Orthogonality in Programming: Orthogonality is an important concept, addressing how a relatively small number of components can be combined in a relatively small number of ways to get the desired results. Majid Majid Answers that are little more than a link may be deleted. Jen do you know what a community wiki means? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Linked Related Hot Network Questions. Question feed. In software engineering, a system is considered orthogonal if changing one of its components changes the state of that component only. For instance, consider a program with three variables: a, b, and c. Changing the value of a should not change the value of b or c, provided they are independent.

This property is particularly critical in debugging a program since one relies on narrowing down the number of moving parts of a program to identify the root cause of the problem. It is the combination of two other principles, namely strong cohesion and loose coupling. It's actually is a term borrowed from mathematics. For example, two lines are orthogonal if they are perpendicular. In software design, two components are orthogonal if a change in one does not affect the other.

Applying this concept to classes or other sections of code results in less coupling. To be orthogonal two classes cannot depend on each others implementation. Orthogonality in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the language.

The term is most-frequently used regarding assembly instruction sets, as orthogonal instruction set.

Features of a program that is compatible with its own earlier versions - this is called backward compatible, have an orthogonal relationship with the features of the earlier version, because they are mutually independent; you don't have to worry about how the use of one version's features will cause an unintended effect because of an interaction with those of the other version.

Both the features and the programs can be said to be mutually orthogonal. The length of time data is kept in storage in a computer system is known as its persistence. Orthogonal persistence is the quality of a programming system that allows a programmer to treat data similarly without regard to the length of time the data is kept in storage.

Data is stored for varying lengths of time; some is stored very briefly and some is stored relatively permanently. Frequently, a programmer must use different approaches and separate coding to access data depending on whether it is stored for a long time or a short time. Using a programming system with orthogonal data persistence allows the programmer to treat data the same way regardless of its persistence characteristic, saving programming time and making it easier to enforce referential integrity a type of constraint applied to ensure correct data validity.



0コメント

  • 1000 / 1000