Most Popular
1500 questions
185
votes
23 answers
How can I deal with a team member who dislikes making comments in code?
One of my team members consistently avoids making comments in his code.
His code is not self-documenting, and other programmers have a difficult time understanding his code.
I have asked him several times to comment his code, however he just gives…

Md Mahbubur Rahman
- 4,747
- 5
- 32
- 38
184
votes
2 answers
Git branching and tagging best practices
I am currently learning to use Git by reading Pro Git. Right now I'm learning about branching and tags. My question is when should I use a branch and when should I use a tag?
For example, say I create a branch for version 1.1 of a project. When I…

Code-Guru
- 2,419
- 3
- 16
- 17
184
votes
10 answers
Why is Clean Code suggesting avoiding protected variables?
Clean Code suggests avoiding protected variables in the "Vertical Distance" section of the "Formatting" chapter:
Concepts that are closely related should be kept vertically close to each other. Clearly this rule doesn't work for concepts that…

Matsemann
- 1,918
- 3
- 16
- 21
184
votes
3 answers
Is Entity Framework Suitable For High-Traffic Websites?
Is Entity Framework 4 a good solution for a public website with potentially 1000 hits/second?
In my understanding EF is a viable solution for mostly smaller or intranet websites, but wouldn't scale easily for something like a popular community…

niaher
- 1,949
- 3
- 12
- 7
183
votes
5 answers
When do you use a struct instead of a class?
What are your rules of thumb for when to use structs vs. classes? I'm thinking of the C# definition of those terms but if your language has similar concepts I'd like to hear your opinion as well.
I tend to use classes for almost everything, and use…

RationalGeek
- 10,077
- 7
- 38
- 56
183
votes
23 answers
How to apologize when you have broken the nightly build
My first commit in my project resulted in the nightly build being broken and people are all over me as we are nearing the release. I want to send an apology email that should sound sincere
and at the same time hinting that this was my first commit…

rajachan
- 733
- 2
- 9
- 9
183
votes
4 answers
What is the benefit of git's two-stage commit process (staging)?
I'm learning git and I've noticed that it has a two-step commit process:
git add
git commit
The first step places revisions into what's called a "staging area" or "index".
What I'm interested in is why this design decision is made, and…

thomasrutter
- 2,311
- 3
- 16
- 13
183
votes
16 answers
Why does automated testing keep failing in my company?
We have tried to introduce developer automated testing several times at my company. Our QA team uses Selenium to automate UI tests, but I always wanted to introduce unit tests and integration tests. In the past, each time we tried it, everyone got…

Mag20
- 3,281
- 2
- 23
- 21
182
votes
15 answers
What is the advantage of currying?
I just learned about currying, and while I think I understand the concept, I'm not seeing any big advantage in using it.
As a trivial example I use a function that adds two values (written in ML). The version without currying would be
fun add(x, y)…

Mad Scientist
- 2,766
- 2
- 18
- 19
180
votes
2 answers
Which SPDX license is equivalent to 'All Rights Reserved'?
I've got a package.json that's expecting a SPDX-approved license acronym, but I can't find one that means 'proprietary commercial license, all rights reserved'.
Is there one for non-FOSS, where I want to specify that I want to allow no reuse?

Bryce
- 1,999
- 2
- 12
- 7
179
votes
8 answers
Exceptions: Why throw early? Why catch late?
There are many well-known best practices about exception handling in isolation. I know the "do's and don'ts" well enough, but things get complicated when it comes to best practices or patterns in larger environments. "Throw early, catch late" - I've…

shylynx
- 2,124
- 3
- 13
- 16
179
votes
13 answers
Is it OK to split long functions and methods into smaller ones even though they won't be called by anything else?
Lately I've been trying to split long methods into several short ones.
For example: I have a process_url() function which splits URLs into components and then assigns them to some objects via their methods. Instead of implementing all this in one…

Stas Bichenko
- 3,689
- 4
- 24
- 32
179
votes
6 answers
What is the point of using DTO (Data Transfer Objects)?
What is the point of using DTO and is it an out dated concept? I use POJOs in the view layer to transfer and persist data. Can these POJOs be considered as an alternative to DTOs?

Vinoth Kumar C M
- 15,455
- 23
- 57
- 86
178
votes
22 answers
Are null references really a bad thing?
I've heard it said that the inclusion of null references in programming languages is the "billion dollar mistake". But why? Sure, they can cause NullReferenceExceptions, but so what? Any element of the language can be a source of errors if used…

Tim Goodman
- 2,644
- 2
- 28
- 25
176
votes
36 answers
How can programming ability be used to help people in poverty?
As a student studying Computer Science in college, I often hear from friends working on various humanitarian projects, and I want to do something myself. But it seems that programmers don't have as many obvious avenues to help out as, say, doctors…

Matthew
- 303
- 3
- 4
- 11