Most Popular
1500 questions
176
votes
36 answers
How can programming ability be used to help people in poverty?
As a student studying Computer Science in college, I often hear from friends working on various humanitarian projects, and I want to do something myself. But it seems that programmers don't have as many obvious avenues to help out as, say, doctors…

Matthew
- 303
176
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,058
- 3
- 30
- 38
176
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
175
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,727
174
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
- 147,435
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
173
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,439
173
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,310
172
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
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
- 1,637
172
votes
3 answers
Benefits of Structured Logging vs basic logging
We're building a new app and I'd like to include structured logging. My ideal setup would be something like Serilog for our C# code, and Bunyan for our JS. These would feed into fluentd and then could go out to any number of things, I was thinking…

DTI-Matt
- 1,829
172
votes
11 answers
Are there guidelines on how many parameters a function should accept?
I've noticed a few functions I work with have 6 or more parameters, whereas in most libraries I use it is rare to find a function that takes more than 3.
Often a lot of these extra parameters are binary options to alter the function behaviour. I…

Darth Egregious
- 1,833
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,070
- 12
- 44
- 60
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,434
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