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,565
250
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,705
- 3
- 16
- 10
248
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,511
248
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,755
247
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,480
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
244
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,125
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
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,830
240
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,454
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,633
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
17 answers
Is it good practice to always have an autoincrement integer primary key?
In my databases, I tend to get into the habit of having an auto-incrementing integer primary key with the name id for every table I make so that I have a unique lookup for any particular row.
Is this considered a bad idea? Are there any drawbacks to…

AJJ
- 2,978
238
votes
2 answers
Best existing license for closed-source code
I'm creating a few closed-source applications on my own (no big company behind me) and am wondering exactly how to protect them. At the top of all the source code files I have this pretty basic copyright…

TheLQ
- 13,580