Most Popular

1500 questions
80
votes
4 answers

Why do many software developers violate the open/closed principle?

Why do many software developers violate the open/closed principle by modifying many things like renaming functions which will break the application after upgrading? This question jumps to my head after the fast and the continuous versions in the…
Anyname Donotcare
  • 1,374
  • 2
  • 16
  • 29
80
votes
5 answers

Why would you not use the 'using' directive in C#?

The existing coding standards on a large C# project includes a rule that all type names be fully qualified, forbidding employment of the 'using' directive. So, rather than the familiar: using System.Collections.Generic; .... other stuff…
Jim Mischel
  • 1,202
80
votes
14 answers

Are data type declarators like "int" and "char" stored in RAM when a C program executes?

When a C program is running, the data is stored on the heap or the stack. The values are stored in RAM addresses. But what about the type indicators (e.g., int or char)? Are they also stored? Consider the following code: char a = 'A'; int x = 4; I…
user16307
  • 907
80
votes
4 answers

What is the purpose of a Code Review

I am in the process of trying to sell my organisation on the value of code reviews. I have worked at several places where they were employed. I have seen them used to nitpick styling choices, and functional decisions, and I have seen them used as…
SoylentGray
  • 3,063
80
votes
7 answers

How to write camel case for words like "phonenumber", "motorcycle", "wavelength", etc

I am having a problem in understanding how to apply camelCase syntax to some of my variable names. For example, how should I correctly write a word like "phonenumber" in camel case? Is it phoneNumber or phonenumber? Similarly with "username", is…
Niklas Rosencrantz
  • 8,068
  • 17
  • 57
  • 96
80
votes
15 answers

Is it possible to reach absolute zero bug state for large scale software?

I am talking about 20-30+ millions lines of code, software at the scale and complexity of Autodesk Maya for example. If you freeze the development as long as it needs to be, can you actually fix all the bugs until there is simply not a single bug,…
Joan Venge
  • 1,960
80
votes
2 answers

Are there any OO-principles that are practically applicable for Javascript?

Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by: Writing the functions to be used as classes by yourself Use a nifty class system in a framework (such as mootools…
Spoike
  • 14,773
80
votes
14 answers

Why are side-effects considered evil in functional programming?

I feel that side effects are a natural phenomenon. But it is something like taboo in functional languages. What are the reasons? My question is specific to functional programming style. Not all programming languages/paradigms.
Gulshan
  • 9,442
80
votes
20 answers

Is it ok to replace optimized code with readable code?

Sometimes you run into a situation where you have to extend/improve some existing code. You see that the old code is very lean, but it's also difficult to extend, and takes time to read. Is it a good idea to replace it with modern code? Some time…
Coder
  • 6,968
  • 5
  • 38
  • 49
80
votes
20 answers

Is a company order to switch to a certain IDE a red flag?

I recently joined a rapidly growing startup. In the past 3 months the development team has grown from 4 to 12. Until now they were very laissez-faire about what developers used to do their work. In fact one of the things I initially found…
80
votes
11 answers

Does programming in general become easier to read, write and understand as you gain experience?

I'm a beginner in programming and I've been reading books, studying, reading articles, and whatnot. I'm getting great results since I've started learning programming, and when I was a beginner I used to think I knew everything about programming, but…
Bugster
  • 4,013
  • 8
  • 38
  • 44
80
votes
2 answers

Studies on how noise affects productivity of programmers

Does anyone have any links to studies that show how noise affects the productivity of programmers? Specifically I would like to see how/if productivity rises when noise levels decrease. As pointed in comments, the nature of the programming workflow…
80
votes
7 answers

Why declare final variables inside methods?

Studying some classes of Android, I realized that most of the variables of methods are declared as final. Example code taken from the class android.widget.ListView: /** * @return Whether the list needs to show the top fading edge */ private boolean…
Rodrigo
  • 1,077
  • 1
  • 9
  • 10
80
votes
5 answers

Are there pre-made commercial software licenses to choose from?

I currently have an open source project that is licensed under GPLv3. I'd like to dual license it, so I can offer it for commercial use. Are there any resources for choosing or creating a commercial software license?
79
votes
17 answers

How to train yourself to avoid writing “clever” code?

Do you know that feeling when you just need to show off that new trick with Expressions or generalize three different procedures? This does not have to be on Architecture Astronaut scale and in fact may be helpful but I can't help but notice someone…
Dan
  • 2,892