Most Popular

1500 questions
223
votes
7 answers

What is wrong with magic strings?

As an experienced software developer, I have learned to avoid magic strings. My problem is that it is such a long time since I have used them, I've forgotten most of the reasons why. As a result, I'm having trouble explaining why they're a problem…
Kramii
  • 14,029
  • 5
  • 44
  • 64
222
votes
10 answers

What is MVC, really?

As a serious programmer, how do you answer the question What is MVC? In my mind, MVC is sort of a nebulous topic — and because of that, if your audience is a learner, then you're free to describe it in general terms that are unlikely to be…
Nicole
  • 28,111
  • 12
  • 95
  • 143
220
votes
25 answers

New Team Lead - How to deal with a resentful former peer

I've been told that I am to be a team lead of an upcoming project. I've not ever been team lead before but the responsibilities are what you would typically expect, with revolving door of 3 to 4 other developers through the 8 or 9 months it takes to…
aceinthehole
  • 2,388
  • 4
  • 18
  • 26
219
votes
29 answers

What's the canonical retort to "it's open source, submit a patch"?

The danger of ever suggesting some feature on a product, especially open source, is that you'll get the response, "why don't you do it?". That's valid, and it's cool that you can make the change yourself. But we know practically that products do…
Vincent Scheib
  • 381
  • 2
  • 4
  • 6
219
votes
16 answers

My boss asks me to stop writing small functions and do everything in the same loop

I have read a book called Clean Code by Robert C. Martin. In this book I've seen many methods to clean up code like writing small functions, choosing names carefully, etc. It seems by far the most interesting book about clean code I've read.…
219
votes
6 answers

What exactly makes the Haskell type system so revered (vs say, Java)?

I'm starting to learn Haskell. I'm very new to it, and I am just reading through a couple of the online books to get my head around its basic constructs. One of the 'memes' that people familiar with it have often talked about, is the whole "if it…
phatmanace
  • 2,445
  • 3
  • 14
  • 11
219
votes
8 answers

'import module' vs. 'from module import function'

I have always been using this method: from sys import argv and use argv with just argv. But there is a convention of using this: import sys and using the argv by sys.argv The second method makes the code self documented and I (really) adhere to…
Santosh Kumar
  • 2,261
  • 4
  • 15
  • 21
218
votes
18 answers

How can one manage thousands of IF...THEN...ELSE rules?

I am considering building an application, which, at its core, would consist of thousands of if...then...else statements. The purpose of the application is to be able to predict how cows move around in any landscape. They are affected by things like…
217
votes
14 answers

"Never do in code what you can get the SQL server to do well for you" - Is this a recipe for a bad design?

It's an idea I've heard repeated in a handful of places. Some more or less acknowledging that once trying to solve a problem purely in SQL exceeds a certain level of complexity you should indeed be handling it in code. The logic behind the idea is…
PhonicUK
  • 1,047
  • 3
  • 11
  • 12
215
votes
16 answers

Do we really need OO languages to manage software complexity?

This is going to be a very non-technical, soft question and I am not sure if this is the right platform. But I am a beginning CS student so I hope you guys tolerate it. In the first semester we were introduced to OOP concepts like encapsulation,…
steakexchange
  • 1,569
  • 2
  • 9
  • 8
214
votes
5 answers

What are good habits for designing command line arguments?

While developing the application I started to wonder - How should I design command line arguments? A lot of programs are using formula like this -argument value or /argument value. Solution which came to my mind was argument:value. I thought it is…
Filip Hazubski
  • 2,013
  • 3
  • 11
  • 11
213
votes
16 answers

When using the Single Responsibility Principle, what constitutes a "responsibility?"

It seems pretty clear that "Single Responsibility Principle" does not mean "only does one thing." That's what methods are for. public Interface CustomerCRUD { public void Create(Customer customer); public Customer Read(int CustomerID); …
Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
209
votes
11 answers

What is the advantage of little endian format?

Intel processors (and maybe some others) use the little endian format for storage. I always wonder why someone would want to store the bytes in reverse order. Does this format have any advantages over the big endian format?
Cracker
  • 3,153
  • 5
  • 19
  • 20
208
votes
1 answer

Why are native ES6 promises slower and more memory-intensive than bluebird?

In this benchmark, the suite takes 4 times longer to complete with ES6 promises compared to Bluebird promises, and uses 3.6 times as much memory. How can a JavaScript library be so much faster and lighter than v8's native implementation written in…
callum
  • 10,377
  • 9
  • 30
  • 33