Most Popular
1500 questions
58
votes
3 answers
Are asserts or unit tests more important?
Both asserts and unit tests serve as documentation for a codebase, and a means of discovering bugs. The main differences are that asserts function as sanity checks and see real inputs, whereas unit tests run on specific simulated inputs and are…

dsimcha
- 17,224
- 9
- 64
- 81
58
votes
10 answers
How to explain that sample size does not influence project length
We have big enterprise projects they normally involve copying data from a source database to a destination database and then setting up a number of additional applications that sync this data etc.
The last project contained 250,000 items (rows of…

Daveo
- 900
- 6
- 12
58
votes
4 answers
Why is SQL's BETWEEN inclusive rather than half-open?
Semi-open (or Half-Open, Half-Closed, Half-Bounded) intervals ([a,b), where xbelongs to the interval iff a <= x < b) are pretty common on programming, as they have many convenient properties.
Can anyone offer a rationale that explains why SQL's…

alex
- 2,904
- 1
- 15
- 19
58
votes
8 answers
Scrum - how to carry over a partially complete User Story to the next Sprint without skewing the backlog
We're using Scrum and occasionally find that we can't quite finish a User Story in the sprint in which it was planned. In true Scrum style, we ship the software anyway and consider including the User Story in the next sprint during the next Sprint…

Nick
- 1,175
- 2
- 8
- 12
58
votes
7 answers
Why are there so many string classes in the face of std::string?
It seems to me that many bigger C++ libraries end up creating their own string type. In the client code you either have to use the one from the library (QString, CString, fbstring etc., I'm sure anyone can name a few) or keep converting between the…

Tamás Szelei
- 7,737
- 7
- 38
- 42
58
votes
5 answers
get weighted random item
I have, for example, this table
+-----------------+
| fruit | weight |
+-----------------+
| apple | 4 |
| orange | 2 |
| lemon | 1 |
+-----------------+
I need to return a random fruit. But apple should be picked 4 times as…

fl00r
- 691
- 1
- 6
- 8
58
votes
6 answers
Why aren't there other programming languages that compile to Python bytecode?
In Java, there are multiple languages that compile to Java bytecode and can run on the JVM -- Clojure, Groovy, and Scala being the main ones I can remember off the top of my head.
However, Python also turns into bytecode (.pyc files) before being…

Michael0x2a
- 1,099
- 1
- 7
- 22
58
votes
15 answers
I don't know C. And why should I learn it?
My first programming language was PHP (gasp). After that I started working with JavaScript. I've recently done work in C#.
I've never once looked at low or mid level languages like C.
The general consensus in the programming-community-at-large is…

Stephen
- 2,200
- 6
- 22
- 24
58
votes
6 answers
Bug reopen vs. new
A bug was opened, fixed, verified and closed. A month later, it showed up again in a subsequent version after several iterations without any regression.
Provided the bug characteristics are the same, would you reopen the existing bug ID or open a…

KMoraz
- 633
- 6
- 10
58
votes
17 answers
As a software engineer, who should I be following on Twitter?
Who in the software engineering and software development fields uses Twitter to tweet about relevant happenings in the field?

Thomas Owens
- 79,623
- 18
- 192
- 283
58
votes
6 answers
What is the difference between a function and a lambda?
I'm a little bit confused about 'function' and 'lambda'. I've seen some examples showing that the scheme keyword lambda works very similarly to the JavaScript keyword function, but I really don't know how they are related.
I'm told that 'function'…

Vivian River
- 2,397
- 5
- 21
- 32
58
votes
9 answers
Code Smell: Inheritance Abuse
It's been generally accepted in the OO community that one should "favor composition over inheritance". On the other hand, inheritance does provide both polymorphism and a straightforward, terse way of delegating everything to a base class unless…

dsimcha
- 17,224
- 9
- 64
- 81
58
votes
3 answers
How can I test PHP skills in a interview?
My company needs to hire a PHP developer, but nobody has PHP knowledge in my company and we find difficult to test for PHP skills. If it were a C/Java developer I would ask him to write a quick implementation of the Game of Life, but PHP is a…

Mascarpone
- 765
- 1
- 6
- 8
58
votes
10 answers
How to test the tests?
We test our code to make it more correct (actually, less likely to be incorrect). However, the tests are also code -- they can also contain errors. And if your tests are buggy, they hardly make your code better.
I can think of three possible types…

Ryszard Szopa
- 1,810
- 12
- 11
58
votes
21 answers
"It was working yesterday, I swear!" What can you do?
When you arrive in the morning, you find that your software does not work anymore, even though it did when you left yesterday evening.
What do you do? What do you check first? What do you do to stop being angry and start working on your problem? Do…

Nikko
- 652
- 6
- 14