Most Popular
1500 questions
250
votes
23 answers
If immutable objects are good, why do people keep creating mutable objects?
If immutable objects¹ are good, simple and offer benefits in concurrent programming why do programmers keep creating mutable objects²?
I have four years of experience in Java programming and as I see it, the first thing people do after creating a…

Vinoth Kumar C M
- 15,455
- 23
- 57
- 86
249
votes
8 answers
What is the difference between writing test cases for BDD and TDD?
I have been learning writing test cases for BDD (Behavior Driven Development) using specflow. If I write comprehensive tests with BDD, is it necessary to write TDD (Test Driven Development) test separately? Is it necessary to write test cases for…

arjun
- 2,695
- 3
- 15
- 10
247
votes
6 answers
Why do dynamic languages make it more difficult to maintain large codebases?
Large codebases are more difficult to maintain when they are written in dynamic languages. At least that's what Yevgeniy Brikman, lead developer bringing the Play Framework to LinkedIn says in a video presentation recorded at JaxConf 2013 (minute…

Jus12
- 2,501
- 4
- 16
- 8
246
votes
16 answers
Project is nearly done, but procedural spaghetti code. Do I rewrite or just keep trying to ship it?
I'm a beginner web developer (one year of experience).
A couple of weeks after graduating, I got offered a job to build a web application for a company whose owner is not much of a tech guy. He recruited me to avoid theft of his idea, the high cost…

solidsnake
- 2,045
- 3
- 13
- 5
245
votes
174 answers
What should every programmer know?
Regardless of programming language(s) or operating system(s) used or the environment they develop for, what should every programmer know?
Some background:
I'm interested in becoming the best programmer I can. As part of this process I'm trying to…

Matt Lacey
- 2,433
- 3
- 16
- 10
245
votes
15 answers
Is it wrong to use a boolean parameter to determine behavior?
I have seen a practice from time to time that "feels" wrong, but I can't quite articulate what is wrong about it. Or maybe it's just my prejudice. Here goes:
A developer defines a method with a boolean as one of its parameters, and that method calls…

Ray
- 2,460
- 3
- 15
- 10
243
votes
13 answers
Is it a bad practice to store large files (10 MB) in a database?
I am currently creating a web application that allows users to store and share files, 1 MB - 10 MB in size.
It seems to me that storing the files in a database will significantly slow down database access.
Is this a valid concern? Is it better to…

B Seven
- 3,105
- 3
- 16
- 14
242
votes
9 answers
Why shouldn't I use the repository pattern with Entity Framework?
During a job interview, I was asked to explain why the repository pattern isn't a good pattern to work with ORMs like Entity Framework. Why is this the case?

StringBuilder
- 2,545
- 3
- 13
- 4
241
votes
13 answers
Why use a database instead of just saving your data to disk?
Instead of a database I just serialize my data to JSON, saving and loading it to disk when necessary. All the data management is made on the program itself, which is faster AND easier than using SQL queries. For that reason I have never understood…

MaiaVictor
- 5,820
- 7
- 27
- 45
240
votes
15 answers
Why was Tanenbaum wrong in the Tanenbaum-Torvalds debates?
I was recently assigned reading from the Tanenbaum-Torvalds debates in my OS class. In the debates, Tanenbaum makes some predictions:
Microkernels are the future
x86 will die out and RISC architectures will dominate the market
(5 years from then)…

Robz
- 1,613
- 4
- 13
- 10
239
votes
14 answers
How can a code editor effectively hint at code nesting level - without using indentation?
I've written an XML text editor that provides 2 view options for the same XML text, one indented (virtually), the other left-justified. The motivation for the left-justified view is to help users 'see' the whitespace characters they're using for…

pgfearo
- 944
- 4
- 11
- 19
239
votes
15 answers
Why do we need private variables?
Why do we need private variables in classes?
Every book on programming I've read says this is a private variable, this is how you define it but stops there.
The wording of these explanations always seemed to me like we really have a crisis of trust…

mwallace
- 2,444
- 3
- 14
- 10
239
votes
2 answers
AGPL - what you can do and what you can't
AGPL is a fairly new license that was meant to go GPL-over-networks. However, not being a lawyer, and actually not having read the whole license, I can't understand what exactly you can do freely and what not with AGPL.
My uncertainty is fed by this…

Bozho
- 2,665
- 3
- 17
- 12
237
votes
9 answers
Is it normal to spend as much, if not more, time writing tests than actual code?
I find tests a lot trickier and harder to write than the actual code they are testing. It's not unusual for me to spend more time writing the test than the code it is testing.
Is that normal or am I doing something wrong?
The questions “Is unit…

springloaded
- 2,123
- 3
- 11
- 10
237
votes
17 answers
Torvalds' quote about good programmer
Accidentally I've stumbled upon the following quote by Linus Torvalds:
"Bad programmers worry about the code. Good programmers worry about
data structures and their relationships."
I've thought about it for the last few days and I'm still…

beyeran
- 1,052
- 3
- 8
- 10