Most Popular
1500 questions
174
votes
17 answers
How can I convince management to deal with technical debt?
This is a question that I often ask myself when working with developers. I've worked at four companies so far and I've become aware of a lack of attention to keeping code clean and dealing with technical debt that hinders future progress in a…

Desolate Planet
- 6,038
- 3
- 29
- 38
174
votes
24 answers
Elegant ways to handle if(if else) else
This is a minor niggle, but every time I have to code something like this, the repetition bothers me, but I'm not sure that any of the solutions aren't worse.
if(FileExists(file))
{
contents = OpenFile(file); // <-- prevents inclusion in if
…

Benjol
- 3,747
- 5
- 33
- 41
173
votes
21 answers
Stored Procedures a bad practice at one of worlds largest IT software consulting firms?
I'm working at a project in one of the world's top 3 IT consulting firms, and was told by a DBA that company best practice's state stored procedures are not a "best practice". This is so contrary to everything I've learned.
Stored procedures give…

user22453
- 477
- 3
- 6
- 8
173
votes
11 answers
Is Ken Thompson's compiler hack still a threat?
Ken Thompson Hack (1984)
Ken Thompson outlined a method for corrupting a compiler binary (and other compiled software, like a login script on a *nix system) in 1984. I was curious to know if modern compilation has addressed this security flaw or…
Andrew
173
votes
21 answers
How do quick & dirty programmers know they got it right?
If you ask programmers why they should write clean code, the number one answer you get is maintainability. While that's on my list, my main reason is more immediate and less altruistic: I can't tell if my new code is correct if it's too dirty. I…

Karl Bielefeldt
- 146,727
- 38
- 279
- 479
172
votes
4 answers
Why is JavaScript not compiled to bytecode before sending over the network?
You'd often see that JavaScript is actually being transported over the web with all the useless stuff that doesn't need to be there -- Comments, particularly those containing licenses, indentations ('\t', '\n'), etc. Given enough time, it could end…

zombiesauce
- 1,429
- 2
- 6
- 8
172
votes
23 answers
Programming cleanly when writing scientific code
I don't really write large projects. I'm not maintaining a huge database or dealing with millions of lines of code.
My code is primarily "scripting" type stuff - things to test mathematical functions, or to simulate something - "scientific…

Auden Young
- 1,637
- 3
- 11
- 21
172
votes
19 answers
Why are interfaces useful?
I have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, they do nothing. If I can remember the names and…

Pankaj Upadhyay
- 5,060
- 11
- 44
- 60
171
votes
9 answers
When would someone use MongoDB (or similar) over a Relational DBMS?
I'm a bit confused about the whole NoSQL thing and such.
When would you choose to use something like MongoDB over something like Oracle or MySQL?
I don't really understand the "difference" as far as usage goes between them.
From my understanding…
user6791
171
votes
5 answers
Scheme vs Common Lisp: Which characteristics made a difference in your project?
There are no shortage of vague "Scheme vs Common Lisp" questions on both StackOverflow and on this site, so I want to make this one more focused. The question is for people who have coded in both languages:
While coding in Scheme, what specific…

SuperElectric
- 1,931
- 2
- 13
- 9
171
votes
5 answers
What's the reason for not using C++17's [[nodiscard]] almost everywhere in new code?
C++17 introduces the [[nodiscard]] attribute, which allows programmers to mark functions in a way that the compiler produces a warning if the returned object is discarded by a caller; the same attribute can be added to an entire class type.
I've…

Christian Hackl
- 1,884
- 2
- 11
- 12
171
votes
11 answers
What happened to the "Surgical Team" pattern from "The Mythical Man-Month"?
Years ago, when I read The Mythical Man-Month, I found lots of stuff which I already knew from other sources. However, there were also new things in there, despite the book being from 1975. One of them was:
The Surgical Team
Mills proposes that…

vog
- 1,424
- 2
- 11
- 10
171
votes
6 answers
How to break up a programming project into tasks for other developers?
I have recently joined a development project and was suddenly given the job of lead developer. My primary responsibility is to break up the programming part of the project into tasks, give these tasks to the other developers, and then make sure that…

khm
- 1,411
- 3
- 10
- 9
171
votes
11 answers
How should I test randomness?
Consider a method to randomly shuffle elements in an array. How would you write a simple yet robust unit test to make sure that this is working?
I've come up with two ideas, both of which have noticeable flaws:
Shuffle the array, then make sure its…

dlras2
- 2,290
- 2
- 17
- 16
170
votes
10 answers
Mono is frequently used to say "Yes, .NET is cross-platform". How valid is that claim?
In What would you choose for your project between .NET and Java at this point in time? I say that I would consider the "Will you always deploy to Windows?" the single most important technical decision to make up front in a new web project, and if…
user1249