Most Popular
1500 questions
56
votes
4 answers
Is there a chart for helping me decide between open-source licenses?
The Open Source Initiative lists 9 different licenses in their list of "License that are popular and widely used or with strong communities".
I want to license my project as open-source. Unfortunately, I do not speak legalese. Is there some chart I…

Oak
- 5,215
- 6
- 28
- 39
55
votes
11 answers
What are the best practices regarding unsigned ints?
I use unsigned ints everywhere, and I'm not sure if I should. This can be from database primary key id columns to counters, etc. If a number should never be negative, then I will always used an unsigned int.
However I notice from other's code that…

wting
- 1,034
- 2
- 9
- 12
55
votes
5 answers
Audiobooks for programmers?
I'm a programmer with a two-hour round trip commute to work each day. I'd like to fill some of that time with audiobooks about software development. Any audiobooks that would help me become a better programmer would be appreciated. I'm thinking…

Zoot
- 970
- 1
- 9
- 21
55
votes
17 answers
Is OO-programming really as important as hiring companies place it?
I am just finishing my masters degree (in computing) and applying for jobs. I've noticed many companies specifically ask for an understanding of object orientation. Popular interview questions are about inheritance, polymorphism, accessors etc.
Is…

ale
- 1,046
- 1
- 10
- 18
55
votes
10 answers
Why Should I Avoid Inline Scripting?
A knowledgeable friend recently looked at a website I helped launch, and commented something like "very cool site, shame about the inline scripting in the source code".
I'm definitely in a position to remove the inline scripting where it occurs; I'm…

thesunneversets
- 1,135
- 2
- 8
- 13
55
votes
5 answers
if ('constant' == $variable) vs. if ($variable == 'constant')
Lately, I've been working a lot in PHP and specifically within the WordPress framework. I'm noticing a lot of code in the form of:
if ( 1 == $options['postlink'] )
Where I would have expected to see:
if ( $options['postlink'] == 1 )
Is this a…

Tom Auger
- 847
- 1
- 7
- 10
55
votes
10 answers
Should a method validate its parameters?
Say you are designing a Square root method sqrt. Do you prefer to validate the parameter passed is not a negative number or do you leave it up to the caller to make sure the param passed is valid. How does your answer vary if the method/API is for…

Amit Wadhwa
- 1,962
- 1
- 15
- 20
55
votes
16 answers
Why such popularity with Python?
Other than being annoyed at whitespace as syntax, I'm not a hater, I just don't get the fascination with Python.
I appreciate the poetry of Perl, and have programmed beautiful web services in bash & korn, and shebang gnuplot. I write documents in…

Jé Queue
- 3,937
- 2
- 29
- 37
55
votes
11 answers
How would you refactor nested IF Statements?
I was cruising around the programming blogosphere when I happened upon this post about GOTO's:
http://giuliozambon.blogspot.com/2010/12/programmers-tabu.html
Here the writer talks about how "one must come to the conclusion that there are situations…

saunderl
- 655
- 1
- 6
- 7
55
votes
13 answers
Is commented out code really always bad?
Practically every text on code quality I've read agrees that commented out code is a bad thing. The usual example is that someone changed a line of code and left the old line there as a comment, apparently to confuse people who read the code later…

nikie
- 6,303
- 4
- 36
- 39
55
votes
7 answers
Why do so many standards for JSON API response formats contain a "success" property in the response body instead of just using HTTP status codes?
I was researching about best practices for standardised JSON response formats for APIs, according to various sources available online general consensus looks something like this:
//Successful request:
{
"success": true,
"data": {
/*…

Šime
- 669
- 1
- 3
- 6
55
votes
11 answers
Is there a general solution to the problem of "sudden unexpected bursts of errors" in software?
Let me explain what I mean.
I have made a complex, highly polished over years PHP framework/library for my own use. I very aggressively log the smallest notice and immediately deal with it as soon as it pops ups, always trying to predict potential…

user379490
- 675
- 1
- 4
- 3
55
votes
9 answers
Is a single config object a bad idea?
In most of my applications, I have a singleton or static "config" object, in charge of reading various settings from disk. Almost all classes use it, for various purposes. Essentially it's just a hash table of name/value pairs. It's read-only, so I…

JW01
- 1,011
- 1
- 9
- 13
55
votes
2 answers
When not to use Google Web Toolkit?
I'm considering use of GWT on a major in-house web app development project, namely it's major advantage in my eyes is the cross-compilation to Javascript which would (at least theoretically) help my team reduce the size of tech stack by one. …

Jas
- 6,254
- 1
- 31
- 46
55
votes
3 answers
What is the name for storing / packing many boolean states into one number?
It's a sort of simple compression where you use one numeric variable to store many boolean / binary states, using doubling and the fact that every doubling number is 1 + the sum of all the previous ones.
I'm sure it must be an old, well-known…

user56reinstatemonica8
- 621
- 5
- 11