Most Popular

1500 questions
101
votes
14 answers

Is it bad practice to write code that relies on compiler optimizations?

I've been learning some C++, and often have to return large objects from functions that are created within the function. I know there's the pass by reference, return a pointer, and return a reference type solutions, but I've also read that C++…
Matt
  • 1,043
101
votes
10 answers

Should I follow a bad coding style just to follow the established conventions at my workplace?

I've been working at my job for about a year. I primarily do work in our GUI interface which uses methods from a C backend, but I generally don't have to deal with them except for return values. Our GUI is structured pretty reasonably, given our…
Justin
  • 913
101
votes
9 answers

Why did BASIC use line numbers?

Why did old BASICs (and maybe other languages) use line numbers as part of the source code? I mean, what problems did it (try to) solve?
DerMike
  • 1,053
  • 2
  • 7
  • 9
101
votes
10 answers

Why is "Select * from table" considered bad practice

Yesterday I was discussing with a "hobby" programmer (I myself am a professional programmer). We came across some of his work, and he said he always queries all columns in his database (even on/in production server/code). I tried to convince him not…
the baconing
  • 1,121
101
votes
3 answers

Why is Python written in C and not in C++?

In Python's tutorial one can read that Python's original implementation is in C; On the other hand, the Python implementation, written in C, (...) I'm very curious why was Python written in C and not C++? I'd like to know the reasoning behind…
101
votes
61 answers

What's the most absurd myth about programming issues?

To put it another way... What is the most commonly held and frustrating misunderstanding about programming, you have encountered? Which widespread and longstanding myths/misconceptions do you find hard for programmers to dispel/correct. Please,…
Maniero
  • 10,806
101
votes
22 answers

Why is OOP difficult?

When I started using an object-oriented language (Java), I pretty much just went "Cool" and started coding. I've never really thought about it until only recently after having read lots of questions about OOP. The general impression I get is that…
gablin
  • 17,407
101
votes
60 answers

Which things instantly ring alarm bells when looking at code?

I attended a software craftsmanship event a couple of weeks ago and one of the comments made was "I'm sure we all recognize bad code when we see it" and everyone nodded sagely without further discussion. This sort of thing always worries me as…
FinnNk
  • 5,809
101
votes
7 answers

What is the history of why bytes are eight bits?

What were the historical forces at work, the tradeoffs to make, in deciding to use groups of eight bits as the fundamental unit? There were machines, once upon a time, using other word sizes. But today, for non-eight-bitness, you must look to museum…
DarenW
  • 4,433
101
votes
8 answers

Should interface names begin with an "I" prefix?

I have been reading "Clean Code" by Robert Martin to hopefully, become a better programmer. While none of it so far has been really ground breaking it has made me think differently about the way I design applications and write code. There is one…
100
votes
10 answers

What are the key differences between software engineers and programmers?

What are the key differences between software engineers and programmers?
grokus
  • 7,528
100
votes
7 answers

What is the most accepted transaction strategy for microservices

One of the major issues that I have seen occur in a system with microservices is the way transactions work when they span over different services. Within our own architecture, we have been using distributed transactions to resolve this, but they…
Kristof
  • 2,231
100
votes
64 answers

What is the (craziest, stupidest, silliest) thing a client/boss asked you to do?

See title, but I am asking from a technical perspective, not Take my 40 year old virgin niece on a date or you're fired.
µBio
  • 2,466
100
votes
3 answers

Break on default case in switch

I am a bit puzzled on whenever or not to include break after the last case, often default. switch (type) { case 'product': // Do behavior break; default: // Do default behavior break; // Is it considered…
100
votes
3 answers

Why do programming languages, especially C, use curly braces and not square ones?

The definition of "C-Style language" can practically be simplified down to "uses curly braces ({})." Why do we use that particular character (and why not something more reasonable, like [], which doesn't require the shift key at least on US…
SomeKittens
  • 4,240