Most Popular

1500 questions
87
votes
11 answers

Why Garbage Collection if smart pointers are there

These days, so many languages are garbage collected. It is even available for C++ by third parties. But C++ has RAII and smart pointers. So what's the point of using garbage collection? Is it doing something extra? And in other languages like C#, if…
Gulshan
  • 9,442
87
votes
6 answers

Why does git use hashes instead of revision numbers?

I always wondered why git prefers hashes over revision numbers. Revision numbers are much clearer and easier to refer to (in my opinion): There is a difference between telling someone to take a look at revision 1200 or commit 92ba93e! (Just to give…
Max Beikirch
  • 1,049
87
votes
12 answers

Readable regular expressions without losing their power?

Many programmers know the joy of whipping up a quick regular expression, these days often with help of some web service, or more traditionally at interactive prompt, or perhaps writing a small script which has the regular expression under…
hyde
  • 3,754
87
votes
4 answers

What skills should I cultivate to become a development/technical lead?

I am currently a professional programmer. I want to expand my skillset, but I also want to make the career jump to being a dev lead as part of a team. I know there's got to be a lot to learn (and this won't be an instant thing) but I think I'm smart…
user26452
87
votes
6 answers

Single quotes vs double quotes

I just started a job where I'm writing Python after coming from a Java background, and I'm noticing that other developers tend to quote strings using single quotes ('') instead of double quotes (""). For example: line1 = 'This is how strings…
Eric Hydrick
  • 2,451
86
votes
17 answers

How do you stop yourself from bringing work home?

Programming is a highly cerebral job, and one of the biggest problems I have is bringing my work home with me. It's so easy to do: whenever I get the chance to think, my mind naturally wanders to work-related matters. I find so many of the other…
Chris Eberle
  • 919
  • 1
  • 8
  • 12
86
votes
18 answers

Design flaws and dealing with humiliation from it

Have you always been fundamentally correct in the software designs you proposed? When you give out some design that was fundamentally wrong, you tend to lose the respect of your fellow team members. No matter what you do after that you end up being…
user20358
  • 713
86
votes
14 answers

What are the advantages and disadvantages to using your real name online?

As a programmer, do you see any professional or other advantage in using your real name in online discourse, versus an invented handle? I've always gone by a single username and had my real name displayed whenever possible, for a few reasons: My…
Jon Purdy
  • 20,547
86
votes
10 answers

How many lines per class is too many in Java?

In your experience, what is a useful rule of thumb for how many lines of code are too many for one class in Java? To be clear, I know that number of lines is not even close to the real standard to use for what should be in a particular class and…
86
votes
19 answers

Why isn't OCaml more popular?

I've always heard that C is the language of choice to use for embedded systems, or anything that needs to run at maximum speed. I never developed a fondness for C, mostly because I don't like pointer arithmetic and the language is barely a rung…
Juliet
  • 2,787
86
votes
16 answers

Best Development Methodology for One Person?

I spend a lot of time working on projects in which I am the sole developer, project manager, designer, QT person (Yes, I know... Bad!), and sometimes I'm even the client. I've tried just about everything for planning projects and managing myself,…
Eli
86
votes
22 answers

Is OOP hard because it is not natural?

One can often hear that OOP naturally corresponds to the way people think about the world. But I would strongly disagree with this statement: We (or at least I) conceptualize the world in terms of relationships between things we encounter, but the…
zvrba
  • 3,460
86
votes
13 answers

Why isn't Java more widely used for game development?

I'm not a game developer or anything, but I know that Java is not very widely used for game development. Java should be fast enough for most games, so where's the catch? I can think of some reasons: Lack of game developers with expertice in…
Anto
  • 11,187
  • 13
  • 68
  • 103
86
votes
12 answers

Is it considered 'bad practice' to check file contents/encoding in unit tests?

A bit of context: Earlier today I had to update some SQL code that another colleague of mine provided, and since it’s a pretty large script, it’s stored as a separate file (which is then read and executed at runtime). While doing this I accidentally…
Paradoxis
  • 1,361
86
votes
6 answers

Why are floats still part of the Java language when doubles are mostly recommended instead?

In every place I've looked, it says that double is superior to float in almost every way. float has been made obsolete by double in Java, so why is it still used? I program a lot with Libgdx, and they force you to use float (deltaTime, etc.), but it…
Eames
  • 885