Most Popular
1500 questions
187
votes
9 answers
Has "Not everyone can be a programmer" been studied?
An old adage that many programmers stick to is "It takes a certain type of mind to learn programming, and not everyone can do it."
Now I'm sure that we all have our own trove of anecdotal evidence, but has this been studied scientifically?
System Down
- 4,763
187
votes
3 answers
Is C++11 Uniform Initialization a replacement for the old style syntax?
I understand that C++11's uniform initialization solves some syntactical ambiguity in the language, but in a lot of Bjarne Stroustrup's presentations (particularly those during the GoingNative 2012 talks), his examples primarily use this syntax now…
void.pointer
- 5,113
186
votes
15 answers
Developer insists if statements shouldn't have negated conditions, and should always have an else block
I have an acquaintance, a more seasoned developer than me.
We were talking about programming practices and I was taken aback by his approach on 'if' statements.
He insists on some practices regarding if statements that I find rather…
Patsuan
- 1,637
186
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,311
184
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
184
votes
17 answers
Is there a benefit in compiling your code as you go along?
I recently had a job interview in which they gave me an hour to write some real code. It wasn't a huge amount, probably less than 100 lines. After about 45 minutes, I compiled, ran it, and got it to work. I may have spent 5-10 minutes working out…
CaptainCodeman
- 1,895
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…
g45rg34d
- 1,949
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
- 713
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,301
183
votes
5 answers
What's the reason for not using C++17's [[nodiscard]] almost everywhere in new code?
C++17 introduces the [[nodiscard]] attribute, which allows programmers to mark functions in a way that the compiler produces a warning if the returned object is discarded by a caller; the same attribute can be added to an entire class type.
I've…
Christian Hackl
- 2,004
- 2
- 13
- 12
183
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,809
- 5
- 34
- 38
181
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
180
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,134
180
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,731
180
votes
11 answers
Is Ken Thompson's compiler hack still a threat?
Ken Thompson Hack (1984)
Ken Thompson outlined a method for corrupting a compiler binary (and other compiled software, like a login script on a *nix system) in 1984. I was curious to know if modern compilation has addressed this security flaw or…
Andrew