Skip to main content

All Questions

79 votes
10 answers
17k views

How functional programming achieves "No runtime exceptions"

How does a functional programming language, such as Elm, achieve "No runtime exceptions"? Coming from an OOP background, runtime exceptions have been part of whatever framework that is based ...
Fireburn's user avatar
  • 889
30 votes
10 answers
5k views

How would Functional Programming proponents answer this statement in Code Complete?

On page 839 of the second edition, Steve McConnell is discussing all the ways that programmers can "conquer complexity" in big programs. His tips culminate with this statement: "Object-oriented ...
dan's user avatar
  • 2,273
27 votes
7 answers
4k views

Does functional programming ignore the benefits gained from the "On the Criteria To Be Used in Decomposing Systems into Modules" (data hiding)?

There's a classic article named On the Criteria To Be Used in Decomposing Systems into Modules that I just read for the first time. It makes perfect sense to me, and is probably one of those articles ...
Daniel Kaplan's user avatar
18 votes
6 answers
3k views

Does functional programming increase the 'representational gap' between problems and solutions? [closed]

Since machine language (e.g., 0110101000110101) computer languages have generally evolved to higher forms of abstraction, generally making it easier to understand the code when it's applied to a ...
Fuhrmanator's user avatar
  • 1,475
13 votes
3 answers
27k views

Is it a better practice pre-initialize attributes in a class, or to add them along the way?

I'm sorry if this is a ABSOLUTELY sophomoric question, but I'm curious what the best practices are out there, and I can't seem to find a good answer on Google. In Python, I usually use an empty class ...
Gilead's user avatar
  • 233
11 votes
4 answers
3k views

Why not apply Interface Segregation Principle to "extreme"

Providing that clients would typically consume just one method, though methods would be conceptually related, why not always apply the Interface Segregation Principle to the extreme and have [many] ...
Den's user avatar
  • 4,877
11 votes
4 answers
2k views

Design in "mixed" languages: object oriented design or functional programming?

In the past few years, the languages I like to use are becoming more and more "functional". I now use languages that are a sort of "hybrid": C#, F#, Scala. I like to design my application using ...
Lorenzo Dematté's user avatar
10 votes
3 answers
1k views

Long parameter list versus long state variable list

In a C++ book, the author says we no longer need a function with a long parameter list because most of the parameters can be refactored into state variables in a class. On the other hand, a ...
TomCaps's user avatar
  • 883
6 votes
3 answers
2k views

Functional programming strategies in imperative languages

I've been convinced for awhile now that some strategies in functional programming are better suited to a number of computations (i.e immutability of data structures). However, due to the popularity of ...
jmarple's user avatar
  • 71
6 votes
1 answer
611 views

Functional core for elevator system design

How can Gary Bernhardt's "Functional Core / Imperative Shell" architecture be used to design software for an elevator system? Specifically, let's say there are a few elevators, each with call buttons ...
max's user avatar
  • 1,115
5 votes
5 answers
597 views

Implicit reading/writing of state in OOP hurts readability, maintainability, and testability. Good way of mitigating this damage?

OOP makes state reads and writes implicit. For instance, in Python: class Foo: def bar(self): # This method may read and/or write any number of self.attributes. # There is no way ...
Dun Peal's user avatar
  • 159
3 votes
2 answers
2k views

design a model for a system of dependent variables

I'm dealing with a modeling system (financial) that has dozens of variables. Some of the variables are independent, and function as inputs to the system; most of them are calculated from other ...
McGarnagle's user avatar
3 votes
0 answers
353 views

Lightweight data modeling vs traditional classes [closed]

I've heard a lot of talk about using lightweight data modeling as of late. Especially in relation to the Clojure programming language. What is it and how it differs from traditional classes regarding ...
user7610's user avatar
  • 429
2 votes
1 answer
885 views

What is the correct granularity for events in the context of designing a rule-based decision system?

Introduction We need to design a system that, given a set of events that are happening in the source application, reacts to them and if some conditions have been met, actions can be triggered. Users ...
Jacob's user avatar
  • 321
1 vote
2 answers
249 views

Connecting classes by passing method references

I am trying to find a good way of allowing two objects that are separated by a intermediate object to communicate while keeping the architecture loosely coupled. A solution I have developed is to pass ...
dda2120's user avatar
  • 21

15 30 50 per page