Most Popular
1500 questions
63
votes
10 answers
Readability versus maintainability, special case of writing nested function calls
My coding style for nested function calls is the following:
var result_h1 = H1(b1);
var result_h2 = H2(b2);
var result_g1 = G1(result_h1, result_h2);
var result_g2 = G2(c1);
var a = F(result_g1, result_g2);
I have recently changed to a department…

Dominique
- 1,705
- 2
- 14
- 24
63
votes
2 answers
Why use `const foo = () => {}` instead of `function foo() {}`
Edit added 2+ years later
I "checked" the @dandavis answer because it answers my original question, giving reasons to prefer const foo. However, I am completely convinced by the @Wayne Bloss answer that function foo() is generally…

user949300
- 8,679
- 2
- 26
- 35
63
votes
31 answers
Do I need to go to a big-name university?
As a soon-to-be graduating high school senior in the U.S., I'm going to be facing a tough decision in a few months: which college should I go to? Will it be worth it to go to Cornell or Stanford or Carnegie Mellon (assuming I get in, of course) to…

Itai Ferber
- 341
- 1
- 5
- 9
63
votes
3 answers
What is the present-day significance of SOAP
Last I encountered a SOAP based service was during my internship in a financial firm in 2013. That was the time when I started my career in IT. I remember having some study material about SOAP in one of my engineering course. Outside of that, I…

Abhas Tandon
- 723
- 1
- 5
- 8
63
votes
1 answer
What is a realistic, real-world, maximum size for a SQLite database?
According to this article on Appropriate Uses For SQLite it says that, while SQLite is limited to 140 terabytes, a client/server RDBMS may work better:
An SQLite database is limited in size to 140 terabytes (247 bytes, 128 tibibytes). And even if…

Ben Harrison
- 1,183
- 1
- 11
- 12
63
votes
11 answers
Are magic numbers acceptable in unit tests if the numbers don't mean anything?
In my unit tests, I often throw arbitrary values at my code to see what it does. For example, if I know that foo(1, 2, 3) is supposed to return 17, I might write this:
assertEqual(foo(1, 2, 3), 17)
These numbers are purely arbitrary and have no…

Kevin
- 2,668
- 2
- 15
- 23
63
votes
11 answers
Is a big boolean expression more readable than the same expression broken down into predicate methods?
What is easier to understand, a big boolean statement (quite complex), or the same statement broken down into predicate methods (lots of extra code to read)?
Option 1, the big boolean expression:
private static bool…

willem
- 1,053
- 9
- 10
63
votes
6 answers
Why is the minus sign, '-', generally not overloaded in the same way as the plus sign?
The plus sign + is used for addition and for string concatenation, but its companion: the minus sign, -, is generally not seen for trimming of strings or some other case other than subtraction. What could be the reason or limitations for…

Digvijay Yadav
- 685
- 1
- 5
- 10
63
votes
10 answers
Why would a program use a closure?
After reading many posts explaining closures here I'm still missing a key concept: Why write a closure? What specific task would a programmer be performing that might be best served by a closure?
Examples of closures in Swift are accesses of an…

Bendrix
- 759
- 1
- 6
- 8
63
votes
8 answers
Why does C provide language 'bindings' where C++ falls short?
I recently was wondering when to use C over C++, and vice versa? Fortunately someone already beat me to it and although it took a while, I was able to digest all the answers and comments to that question.
However one item in that post keeps being…

smeeb
- 4,820
- 10
- 30
- 49
63
votes
8 answers
What do you think about the Joel Test?
The Joel Test is a well known test for determining how good your team is. What do you think about the points? Do you disagree with any of them? Is there anything that you would add?

Casebash
- 7,662
- 5
- 41
- 62
63
votes
8 answers
What is the "default" software license?
If I release some code and binaries, but I don't include any license at all with it, what are the legal terms that apply by default (in the US, where I am). I know that I automatically have copyright without doing anything, but what restrictions are…

Tesserex
- 3,015
- 4
- 26
- 27
63
votes
2 answers
Are Git branches, in fact, "homeomorphic endofunctors mapping submanifolds of a Hilbert space"?
As we all know:
Git gets easier once you understand branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space
Which seems like jargon, but on the other hand,
All told, a monad in X is just a monoid in the category of…

Larry OBrien
- 4,927
- 2
- 21
- 25
63
votes
9 answers
How to write "good" unit tests?
Triggered by this thread, I (again) am thinking about finally using unit tests in my projects. A few posters there say something like "Tests are cool, if they are good tests". My question now: What are "good" tests?
In my applications, the main part…

Jens
- 739
- 1
- 7
- 9
63
votes
16 answers
How to handle divide by zero in a language that doesn't support exceptions?
I'm in the middle of developing a new programming language to solve some business requirements, and this language is targeted at novice users. So there is no support for exception handling in the language, and I wouldn't expect them to use it even…

Reactgular
- 13,040
- 4
- 48
- 81