Skip to main content
46 votes

Error handling considerations

CLAIM: The exception mechanism is a language semantic for handling errors exceptions are a control-flow mechanism. The motivation for this control-flow mechanism, was specifically separating error ...
Useless's user avatar
  • 12.7k
34 votes

In OOP, what counts as a "getter"

So what exactly is a "leaky abstraction" via getters ? Emphasis on exactly. What is exposing data exactly ? If you're looking for exact deterministic discussion of big picture software ...
Flater's user avatar
  • 56.3k
33 votes
Accepted

Error handling considerations

Error-handling is perhaps the hardest portion of a program. In general, realizing that there is an error condition is easy; however signalling it in a way that cannot be circumvented and handling it ...
Matthieu M.'s user avatar
  • 15.1k
29 votes
Accepted

Do functional programming languages disallow side effects?

Functional programming includes many different techniques. Some techniques are fine with side effects. But one important aspect is equational reasoning: If I call a function on the same value, I ...
amon's user avatar
  • 135k
28 votes

Is declarative programming just imperative programming 'under the hood'?

At a lower level, every(?) CPU in current use is essentially imperative so yes, everything has to be imperative at some level. However, to some extent that's not really important: everything is an ...
Philip Kendall's user avatar
21 votes
Accepted

Is declarative programming just imperative programming 'under the hood'?

Differences So is declarative programming just imperative programming 'under the hood'? If so then how to differentiate them two? Two of the major differences between declarative and imperative ...
Lawnmower Man's user avatar
19 votes

Is there a programming paradigm that promotes making dependencies extremely obvious to other programmers?

Discoverability Its absence plagues many organizations. Where is that tool that Fred built again? In the Git repository, sure. Where? The software pattern that comes to mind is Model-View-ViewModel....
Robert Harvey's user avatar
15 votes

Error handling considerations

I would like to understand better the implications of using such a paradigm in a project: Is the premise to the problem correct? or Did I missed something relevant? Is the solution a good ...
utnapistim's user avatar
  • 5,305
13 votes

What's The Difference Between Imperative, Procedural and Structured Programming?

I am afraid none of the answers given so far capture the core of the concepts very well. Imperative, procedural and structured are not mutually exclusive properties, they just focus on different ...
Martin Maat's user avatar
  • 18.5k
13 votes
Accepted

How to reconcile Dependency Injection and Convention over Configuration?

Convention over configuration doesn't mean "let's take the easy path;" it means that certain programming decisions are already made by default. It is used by software frameworks to decrease ...
Robert Harvey's user avatar
11 votes

Is declarative programming just imperative programming 'under the hood'?

To expand already existing answers, there are languages like VHDL which are mainly for writing declarative code and they can produce truly declarative output in the form of hardware, which executes &...
Jiří's user avatar
  • 249
10 votes

Is there a programming paradigm that promotes making dependencies extremely obvious to other programmers?

The best way to approach these sorts of problems is incrementally. Don't get frustrated and propose wide, sweeping architectural changes. Those will never get approved, and the code will never ...
Karl Bielefeldt's user avatar
9 votes

Before OOP, how were systems modeled

It would be pretty silly to think that we didn't have objects before OOP. OOP formalizes a notion of class, which allows arguably superior code organization.  But these same constructs can be ...
Erik Eidt's user avatar
  • 34.4k
9 votes

Is assignment declarative or imperative?

Declarative vs imperative programming cannot always be distinguished on a syntactical level. To a large part, this is more about different programming styles: a declarative program will mostly ...
amon's user avatar
  • 135k
9 votes

In OOP, what counts as a "getter"

A "getter", for the purposes above of talking about code maintainability and design, is any method that returns an object that already existed when the call began, that the caller didn't ...
Robert Bräutigam's user avatar
8 votes
Accepted

Has any language enforced Command–query separation?

Yes, SQL has distinct commands for querys (reads) and commands (updates). SQL has different commands for DML (Data Manipulation Language) for performing INSERT, UPDATE, DELETE. For reads, use DQL (...
Jon Raynor's user avatar
  • 11.7k
8 votes
Accepted

What is the programming paradigm when I just use functions in a file to organize my program?

The programming paradigm that organizes the software into functions is called procedural programming. For example, C is a procedural programming language. Most dynamic languages like JS or Python can ...
amon's user avatar
  • 135k
8 votes

Colleague wants web apps to behave like Windows desktop programs

User expectations should be taken into account when developing software but users are bad sources of UX/UI specifications. You need to have (or be) a UX/UI designer to design a UI that fulfills the ...
Hans-Martin Mosner's user avatar
7 votes

Is it possible to say that the difference between imperative programming and declarative programming is merely in the level of abstraction?

Declarative languages are not necessarily higher abstraction level. Thay are not magical - they cannot figure out on its own how to cook eggs if you dont tell it how (unless there is a library for it, ...
JacquesB's user avatar
  • 61k
7 votes

Do functions make Java a functional programming language?

OOP is a language with sole aim of modeling complex (real-world) systems No, sorry, no. OOP is very good at modeling reality. However, that is not its sole purpose, in fact, we often model very ...
Theraot's user avatar
  • 9,201
7 votes
Accepted

Temporal logic as a programming language paradigm?

TLA+ isn't so much a general purpose language, but... One of the benefits of using TLA+ to investigate the bug is that once you can reproduce the bug, it’s easy to try alternative fixes. The bug in ...
Robert K. Bell's user avatar
7 votes
Accepted

What's an abstraction?

Probably an example could help. Let's say you want to do an HTTP request to an API and process its JSON response. Such process involves, at software level: Doing a DNS request in order to transform ...
Arseni Mourzenko's user avatar
6 votes

Did GO embrace any language construct introduced in Java?

No, Go does not show any particular influence from Java. Go and Java do share similar goals, but took different paths to achieve these goals. The Go designers are of course aware of Java, C#, C++, ...
amon's user avatar
  • 135k
6 votes

Before OOP, how were systems modeled

OOP is actually more limited as far as modeling is concerned. The reason is every verb must be tightly coupled to exactly one noun. Other paradigms don't have that limitation. You don't have to make ...
Karl Bielefeldt's user avatar
6 votes

Before OOP, how were systems modeled

Before OOP, the structured programming paradigm used to separate processes and data. This separation also applied for modelling: Processes used to be modelled with dataflow diagrams (the most ...
Christophe's user avatar
  • 80.6k
6 votes

In OOP, what counts as a "getter"

A getter is a failure to design an object. It violates encapsulation which is a core principle of object oriented programing. Now please tell me, how do you design a libraries hash table collection ...
candied_orange's user avatar
5 votes
Accepted

What is the proper terminology for this sort of thing?

It appears you are building a table of values and address of the routine to call. This appears to be a "Dispatch Table".
BillThor's user avatar
  • 6,290
5 votes

Do functional programming languages disallow side effects?

No programming language eliminates side effects. I think it's better to say that declarative languages contain side effects while imperative languages do not. However, I'm not so sure that any of this ...
Daniel T.'s user avatar
  • 3,061
5 votes

Is assignment declarative or imperative?

In a declarative approach, you declare facts, for example that gravity g is 9.80665 m/s2 or the number or wheels x is 3. Many programming languages express this with some kind of declaration or ...
Christophe's user avatar
  • 80.6k

Only top scored, non community-wiki answers of a minimum length are eligible