Most Popular
1500 questions
145
votes
30 answers
How many hours can you be really productive per day? How?
I find that I'm having a great deal of trouble staying alert 8 hours per day. I've heard of people who've negotiated work contracts of just 4 hours/day, arguing that they won't be able to do much more in eight hours.
I am often overwhelmed with…
fzwo
- 631
145
votes
11 answers
Are (database) integration tests bad?
Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not always fond of.
I find that, in some cases, a…
mindplay.dk
- 1,697
145
votes
11 answers
Should I stop using the term C/C++?
I understand C and C++ are different languages but when I was learning C++ I was always told that C is a subset of C++ or C++ is C with classes. And that was quite true until the appearance of C++x0, C++11 (or the modern C++ 11/14/17 in general). In…
rkachach
- 1,229
- 2
- 9
- 9
145
votes
10 answers
When is it a good idea to force garbage collection?
So I was reading a question about forcing the C# garbage collector to run where almost every single answer is the same: you can do it, but you shouldn't - except for some very rare cases. Sadly, nobody there elaborates on what are such cases.
Can…
Saturn
- 3,907
144
votes
31 answers
How do you dive into large code bases?
What tools and techniques do you use for exploring and learning an unknown code base?
I am thinking of tools like grep, ctags, unit-tests, functional test, class-diagram generators, call graphs, code metrics like sloccount, and so on. I'd be…
miku
- 1,508
144
votes
7 answers
What is an integration test exactly?
My friends and I have been struggling to classify exactly what is an integration test.
Now, on my way home, I just realised, that every time I try to give a real world example of an integration test, it turns out to be an acceptance test, ie.…
Martin Blore
- 4,655
144
votes
3 answers
Where do "magic" hashing constants like 0x9e3779b9 and 0x9e3779b1 come from?
In code dealing with hash tables, I often find the constant 0x9e3779b9 or sometimes 0x9e3779b1. For example
hash = n * 0x9e3779b1 >>> 24
Why is this particular value used?
bkgs
- 1,023
144
votes
8 answers
How do I get people to stop bikeshedding (focusing on trivialities)?
I have been tasked with teaching other teams a new codebase, but I keep running into an issue. Whenever I go to actually walk through the code with people, we don't get very far before the entire exercise devolves into a bikeshedding (members of an…
Telastyn
- 109,398
143
votes
14 answers
Simple method for reliably detecting code in text?
GMail has this feature where it will warn you if you try to send an email that it thinks might have an attachment.
Because GMail detected the string see the attached in the email, but no actual attachment, it warns me with an OK / Cancel dialog…
Jeff Atwood
- 6,747
142
votes
12 answers
TDD vs. Productivity
In my current project (a game, in C++), I decided that I would use Test Driven Development 100% during development.
In terms of code quality, this has been great. My code has never been so well designed or so bug-free. I don't cringe when viewing…
Nairou
- 1,529
142
votes
7 answers
What should you test with unit tests?
I'm freshly out of college, and starting university somewhere next week. We've seen unit tests, but we kinda not used them much; and everyone talks about them, so I figured maybe I should do some.
The problem is, I don't know what to test. Should I…
zneak
- 2,586
142
votes
3 answers
Can I use an LGPL-licenced library in my commercial app?
I want to use an LGPL-licensed library in my app for Microsoft's app marketplace. Is that OK?
William Jockusch
- 2,041
142
votes
14 answers
Time difference between developing with unit tests vs no tests
I'm a solo developer with a pretty time-constrained work environment where development time ranges usually from 1-4 weeks per project, depending on either requirements, urgency, or both. At any given time I handle around 3-4 projects, some having…
Revenant
- 1,415
142
votes
6 answers
The trend of the "develop" branch going away
I've noticed something lately looking at some popular projects on GitHub, that there's no develop branch. And in fact, the GitHub Flow guide doesn't mention it either. From my understanding, master should always be totally stable and reflect…
ffxsam
- 1,561
142
votes
87 answers
How to become a "faster" programmer?
My last job evaluation included just one weak point: timeliness. I'm already aware of some things I can do to improve this but what I'm looking for are some more.
Does anyone have tips or advice on what they do to increase the speed of their output…
Nick Gotch
- 213