Most Popular

1500 questions
103
votes
13 answers

Should we eliminate local variables if we can?

For example, to keep a CPU on in Android, I can use code like this: PowerManager powerManager = (PowerManager)getSystemService(POWER_SERVICE); WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,…
ggrr
  • 5,775
103
votes
7 answers

Should we create a new single instance of HttpClient for all requests?

recently I came across this blog post from asp.net monsters which talks about issues with using HttpClientin following way: using(var client = new HttpClient()) { } As per the blog post, if we dispose the HttpClient after every request it can keep…
Ankit Vijay
  • 1,588
103
votes
2 answers

What is the "Free Monad + Interpreter" pattern?

I've seen people talking about Free Monad with Interpreter, particularly in the context of data-access. What is this pattern? When might I want to use it? How does it work, and how would I implement it? I understand (from posts such as this) that…
103
votes
10 answers

What should I do when I've already waited too long between commits?

I was naughty... Too much "cowboy coding," not enough committing. Now, here I am with an enormous commit. Yes, I should have been committing all along, but it's too late now. What is better? Do one very large commit listing all the things I…
durron597
  • 7,600
103
votes
6 answers

What's the difference between simulation and emulation

I frequently see Simulation and Emulation in computer science. These two terms seem synonymous. Is there any difference between Simulation and Emulation?
user
  • 2,200
103
votes
25 answers

How do programmers quit a job?

I'm thinking about leaving my current employer and wondering how one goes about that process in the programming world. We have a lot of projects on the go at the moment and I'm the only developer. We have 4-5 projects that are fairly big and need to…
103
votes
3 answers

What's the difference between MariaDB and MySQL?

What's the difference between MariaDB and MySQL? I'm not very familiar with both. I'm primarily a front end developer for the most part. Are they syntactically similar? Where do these two query languages differ? Wikipedia only mentions the…
chrisjlee
  • 2,070
102
votes
16 answers

TDD negative experience

What is a negative side of your TDD experience? Do you find baby steps (the simplest fix to make test green) annoying and useless? Do you find no-value tests (when test has sense initially but in final implementation checks the same logic as other…
SiberianGuy
  • 4,793
102
votes
7 answers

What are invariants, how can they be used, and have you ever used it in your program?

I'm reading Coders at Work, and in it there's a lot of talk about invariants. As far as I've understood it, an invariant is a condition which holds both before and after an expression. They're, among other things, useful in proving that loop is…
gablin
  • 17,407
102
votes
12 answers

Should I use a parser generator or should I roll my own custom lexer and parser code?

What specific advantages and disadvantages of each way to working on a programming language grammar? Why/When should I roll my own? Why/When should I use a generator?
Maniero
  • 10,806
102
votes
5 answers

Clang warning flags for Objective-C development

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags. I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on. I…
Macmade
  • 1,146
101
votes
16 answers

How can I tell in an interview if a programmer is passionate about programming?

While most interview questions are focused on current knowledge of a candidate or check his/her skill to solve algorithmic problems I would like to hire a developer who is passionate about programming. What if instead of asking questions like What…
Nutel
  • 1,501
101
votes
45 answers

How do programmers in the West see programmers in the East?

The other half of this question: How do Programmers in the East see programmers in the West? The eastern part of the world (India/China/Philippines ) mainly provide outsourcing services to the western world (USA and Europe). Do you have the…
101
votes
9 answers

Is it ever okay to use lists in a relational database?

I've been trying to design a database to go with a project concept and ran into what seems like a hotly debated issue. I've read a few articles and some Stack Overflow answers that state it's never (or almost never) okay to store a list of IDs or…
101
votes
11 answers

How do you detect dependency problems with unit tests when you use mock objects?

You have a class X and you write some unit tests that verify behaviour X1. There's also class A which takes X as a dependency. When you write unit tests for A, you mock X. In other words, while unit testing A, you set (postulate) the behaviour of…
bvgheluwe
  • 1,177