Most Popular
1500 questions
53
votes
27 answers
What is the most egregious waste of money you have seen, and what did you do about it?
Often we as programmers see large organisations wasting huge sums of money on bloated and inefficient solutions to problems. This pains me greatly because I like organisations to benefit from best of breed solutions. However, my abilities as a…

Gary
- 24,420
- 9
- 63
- 108
53
votes
2 answers
What is the purpose of NaN boxing?
Reading 21st Century C I arrived at chapter 6 at the section "Marking Exceptional Numeric Values with NaNs", where it explains the use of the bits in the mantissa to store some arbitrary bit patterns, to use them as markers or pointers (the book…

andijcr
- 641
- 1
- 5
- 9
53
votes
6 answers
"A good programmer can be as 10X times more productive than a mediocre one"
I had read an interview with a great programmer (it is not in English) and in it he said that "a great programmer can be as 10 times as good as a mediocre one" giving reason for why good programmers are very well paid and why programming companies…

Random42
- 10,370
- 10
- 48
- 65
53
votes
14 answers
Why does DirectX use a left-handed coordinate system?
I considered posting on Stack Overflow, but the question strikes me as being far too subjective since I can't think of a reasonable technical explanation for Microsoft's choice in this matter. But this question has bugged me for so long and the…

greyfade
- 11,103
- 2
- 40
- 43
53
votes
3 answers
Where to put business logic in MVC design?
I have created a simple MVC Java application that adds records through data forms to a database.
My app collects data, it also validates it and stores it. This is because the data is being sourced online from different users. the data is mostly…

BriskLabs Pakistan
- 631
- 1
- 6
- 4
53
votes
12 answers
How to take a step back and look at code with fresh eyes?
I've spent the last year as a one-man team developing a rich-client application (35,000+ LoC, for what it's worth). It's currently stable and in production. However, I know that my skills were rusty at the beginning of the project, so without a…

BenCole
- 665
- 5
- 7
53
votes
16 answers
Should I take care of race conditions which almost certainly has no chance of occuring?
Let's consider something like a GUI application where main thread is updating the UI almost instantaneously, and some other thread is polling data over the network or something that is guaranteed to take 5-10 seconds to finish the job.
I've received…

TtT23
- 1,553
- 4
- 20
- 28
53
votes
6 answers
Pros and Cons of holding all the business logic in stored procedures in web application
In some organization I worked for web applications are developed basing all the business logic in Database stored procedures. For example, use html for view and servlet as controllers to divert the client request to appropriate Database stored…

droidsites
- 1,027
- 2
- 11
- 10
53
votes
9 answers
Explanation on how "Tell, Don't Ask" is considered good OO
This blogpost was posted on Hacker News with several upvotes. Coming from C++, most of these examples seem to go against what I've been taught.
Such as example #2:
Bad:
def check_for_overheating(system_monitor)
if system_monitor.temperature > 100
…

Pubby
- 3,290
- 1
- 21
- 26
53
votes
3 answers
What is the benefit of writing to a temp location, And then copying it to the intended destination?
I am writing an application that works with satellite images, and my boss asked me to look at some of the commercial applications, and see how they behave. I found a strange behavior and then as I was looking, I found it in other standard…

Devdatta Tengshe
- 2,514
- 4
- 21
- 22
53
votes
15 answers
Is it bad practice to name an unused variable with a single underscore?
Often when the syntax of the language requires me to name a variable that is never used, I'll name it _.
In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I find it to be unobtrusive so that it produces an…

Kris Harper
- 2,237
- 2
- 19
- 21
53
votes
20 answers
Does Object Oriented Programming Really Model The Real World?
I've seen it commonly repeated the object-oriented programming is based on modeling the real world but is it?
It seems to me that is not true of anything outside of the business layer. My GUI classes/data access classes aren't modeling anything in…

Winston Ewert
- 24,732
- 12
- 72
- 103
53
votes
10 answers
How to correct a junior, but encourage him to think for himself?
I am the lead of a small team where everyone has less than a year of software development experience. I wouldn't by any means call myself a software guru, but I have learned a few things in the few years that I've been writing software.
When we do…

Phil
- 3,660
- 26
- 29
53
votes
11 answers
Get 100 highest numbers from an infinite list
One of my friend was asked this interview question -
"There is a constant flow of numbers coming in from some infinite list
of numbers out of which you need to maintain a datastructure as to
return the top 100 highest numbers at any given point…

Sachin Shanbhag
- 543
- 1
- 4
- 7
53
votes
3 answers
Why are exception specifications bad?
Back in school some 10+ years ago, they were teaching you to use exception specifiers. Since my background is as one of them Torvaldish C programmers who stubbornly avoids C++ unless forced to, I only end up in C++ sporadically, and when I do I…
user29079