2189
votes
1answer
388k views

What technical details should a programmer of a web application consider before making the site public?

What things should a programmer implementing the technical details of a web application consider before making the site public? If Jeff Atwood can forget about HttpOnly cookies, sitemaps, and ...
839
votes
10answers
307k views

Which hashing algorithm is best for uniqueness and speed?

Which hashing algorithm is best for uniqueness and speed? Example (good) uses include hash dictionaries. I know there are things like SHA-256 and such, but these algorithms are designed to be ...
703
votes
7answers
94k views

Where did the notion of “one return only” come from?

I often talk to programmers who say "Don't put multiple return statements in the same method." When I ask them to tell me the reasons why, all I get is "The coding standard says so." or "It's ...
616
votes
29answers
116k views

My boss decided to add a “person to blame” field to every bug report. How can I convince him that it's a bad idea?

In one of the latest "WTF" moves, my boss decided that adding a "Person To Blame" field to our bug tracking template will increase accountability (although we already have a way of tying bugs to ...
495
votes
1answer
62k views

Is the use of “utf8=✓” preferable to “utf8=true”?

I have recently seen a few URIs containing the query parameter "utf8=✓". My first impression (after thinking "mmm, looks cool") was that this could be used to detect a broken character encoding. So, ...
487
votes
2answers
175k views

What is the Mars Curiosity Rover's software built in?

The Mars Curiosity rover has landed successfully, and one of the promo videos "7 minutes of terror" brags about there being 500,000 lines of code. It's a complicated problem, no doubt. But that is a ...
413
votes
33answers
198k views

How do I create my own programming language and a compiler for it [closed]

I am thorough with programming and have come across languages including BASIC, FORTRAN, COBOL, LISP, LOGO, Java, C++, C, MATLAB, Mathematica, Python, Ruby, Perl, JavaScript, Assembly and so on. I ...
413
votes
21answers
21k views

Overcoming slow problem solving due to increased knowledge of what might go wrong [closed]

This has been troubling me for some time, and I'd really appreciate the input of other professionals. Short background: I started programming when my parents bought me my first computer in 1988 (at ...
412
votes
5answers
146k views

Pros and Cons of Facebook's React vs. Web Components (Polymer)

What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)? According to ...
385
votes
9answers
110k views

Why is 80 characters the 'standard' limit for code width?

Why is 80 characters the "standard" limit for code width? Why 80 and not 79, 81 or 100? What is the origin of this particular value?
382
votes
21answers
90k views

My customer wants me to record a video of how I develop his software product

Working as a freelancer, I often see strange requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those ...
380
votes
13answers
126k views

So Singletons are bad, then what?

There has been a lot of discussion lately about the problems with using (and overusing) Singletons. I've been one of those people earlier in my career too. I can see what the problem is now, and yet, ...
378
votes
14answers
109k views

How to respond when you are asked for an estimate?

We, as programmers, are constantly being asked 'How long will it take'? And you know, the situation is almost always like this: The requirements are unclear. Nobody has done an in depth analysis of ...
370
votes
12answers
14k views

Should I intentionally break the build when a bug is found in production?

It seems reasonable to me that if a serious bug is found in production by end-users, a failing unit test should be added to cover that bug, thus intentionally breaking the build until the bug is ...
357
votes
29answers
56k views

Why can't the IT industry deliver large, faultless projects quickly as in other industries?

After watching National Geographic's MegaStructures series, I was surprised how fast large projects are completed. Once the preliminary work (design, specifications, etc.) is done on paper, the ...
354
votes
39answers
344k views

Why isn't Java used for modern web application development? [closed]

As a professional Java programmer, I've been trying to understand - why the hate toward Java for modern web applications? I've noticed a trend that out of modern day web startups, a relatively small ...
310
votes
6answers
19k views

What is negative code?

I was reading the Wikipedia article on Douglas McIlroy and found a quote that mentions "The real hero of programming is the one who writes negative code." What does that mean?
295
votes
20answers
66k views

How should I behave as a developer in a project that's headed for failure?

I am a developer in a 5-member team and I believe our project is headed for disaster. I'll describe why in a moment, but my question is: how should I behave? The deadline is in 1.5 months, and I ...
286
votes
4answers
101k views

What software programming languages were used by the Soviet Union's space program?

I got interested in the Soviet space program and was interested to discover that the software on the Buran spacecraft circa 1988 was written in Prolog. Does anyone know what languages might have ...
276
votes
10answers
32k views

I'm a Subversion geek, why should I consider or not consider Mercurial or Git or any other DVCS?

I try to understand the benefits of distributed version control system (DVCS). I found Subversion Re-education and this article by Martin Fowler very useful. Mercurial and others DVCS promote a ...
263
votes
16answers
58k views

Why are shortcuts like x += y considered good practice?

I have no idea what these are actually called, but I see them all the time. The Python implementation is something like: x += 5 as a shorthand notation for x = x + 5. But why is this considered good ...
260
votes
20answers
86k views

What does SVN do better than Git? [closed]

No question that the majority of debates over programmer tools distill to either personal choice (by the user) or design emphasis, that is, optimizing design according to particular uses cases (by the ...
246
votes
14answers
24k views

Why does everyone use Git in a centralized manner?

I have used Git at my past two companies for version control. It seems from what I've heard that about 90% of companies use Git over other version control systems. One of the biggest selling points ...
246
votes
13answers
43k views

Should you write your back-end as an API?

I had a heated discussion today about our MVC application. We have a website written in MVC (ASP.NET), and it usually follows the pattern of do something in the view -> hit the controller -> ...
243
votes
7answers
19k views

Does using == in JavaScript ever make sense?

In JavaScript, the Good Parts, Douglas Crockford wrote: JavaScript has two sets of equality operators: === and !==, and their evil twins == and !=. The good ones work the way you would expect. ...
241
votes
21answers
34k views

Leaving intentional bugs in code for testers to find

We don't do this at our firm, but one of my friends says that his project manager asked every developer to add intentional bugs just before the product goes to QA. This is how it works: Just before ...
240
votes
17answers
18k views

Why have private fields, isn't protected enough?

Is the visibility private of class fields/properties/attributes useful? In OOP, sooner or later, you are going to make a subclass of a class and in that case, it is good to understand and being able ...
237
votes
24answers
100k views

If immutable objects are good, why do people keep creating mutable objects?

If immutable objects¹ are good, simple and offer benefits in concurrent programming why do programmers keep creating mutable objects²? I have four years of experience in Java programming and as I see ...
231
votes
25answers
32k views

How do you know you're writing good code? [duplicate]

I love programming. I've been messing around with code since I was a kid. I never went the professional route, but I have coded several in-house applications for various employers, including a project ...
224
votes
14answers
26k views

How can a code editor effectively hint at code nesting level - without using indentation? [closed]

I've written an XML text editor that provides 2 view options for the same XML text, one indented (virtually), the other left-justified. The motivation for the left-justified view is to help users ...
219
votes
16answers
16k views

Project is nearly done, but procedural spaghetti code. Do I rewrite or just keep trying to ship it? [closed]

I'm a beginner web developer (one year of experience). A couple of weeks after graduating, I got offered a job to build a web application for a company whose owner is not much of a tech guy. He ...
216
votes
11answers
63k views

How accurate is “Business logic should be in a service, not in a model”?

Situation Earlier this evening I gave an answer to a question on StackOverflow. The question: Editing of an existing object should be done in repository layer or in service? For example ...
211
votes
15answers
53k views

Why was Tanenbaum wrong in the Tanenbaum-Torvalds debates?

I was recently assigned reading from the Tanenbaum-Torvalds debates in my OS class. In the debates, Tanenbaum makes some predictions: Microkernels are the future x86 will die out and RISC ...
210
votes
8answers
137k views

What is the difference between writing test cases for BDD and TDD? [duplicate]

I have been learning writing test cases for BDD (Behavior Driven Development) using specflow. If I write comprehensive tests with BDD, is it necessary to write TDD (Test Driven Development) test ...
203
votes
29answers
18k views

What's the canonical retort to “it's open source, submit a patch”? [closed]

The danger of ever suggesting some feature on a product, especially open source, is that you'll get the response, "why don't you do it?". That's valid, and it's cool that you can make the change ...
197
votes
64answers
119k views

Why do programmers write closed source applications and then make them free? [closed]

As an entrepreneur/programmer who makes a good living from writing and selling software, I'm dumbfounded as to why developers write applications and then put them up on the Internet for free. You've ...
197
votes
25answers
25k views

When is a BIG Rewrite the answer?

Just read the question about the Big Rewrites and I remembered a question that I've been wanting answered myself. I have a horrible project passed down to me, written in old Java, using Struts 1.0, ...
195
votes
17answers
22k views

How would you know if you've written readable and easily maintainable code?

How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view the code is readable and maintainable, because the author ...
193
votes
16answers
33k views

What's wrong with comments that explain complex code?

A lot of people claim that "comments should explain 'why', but not 'how'". Others say that "code should be self-documenting" and comments should be scarce. Robert C. Martin claims that (rephrased to ...
191
votes
18answers
77k views

How can one manage thousands of IF…THEN…ELSE rules?

I am considering building an application, which, at its core, would consist of thousands of if...then...else statements. The purpose of the application is to be able to predict how cows move around in ...
186
votes
6answers
61k views

Why do dynamic languages make it more difficult to maintain large codebases? [duplicate]

Large codebases are more difficult to maintain when they are written in dynamic languages. At least that's what Yevgeniy Brikman, lead developer bringing the Play Framework to LinkedIn says in a video ...
185
votes
9answers
14k views

Why do many exception messages not contain useful details?

It seems there is a certain amount of agreement that exception messages should contain useful details. Why is it that many common exceptions from system components do not contain useful details? A ...
182
votes
17answers
45k views

Why is Global State so Evil?

Before we start this, let me say I'm well aware of the concepts of Abstraction and Dependency Injection. I don't need my eyes opened here. Well, most of us say, (too) many times without really ...
179
votes
20answers
169k views

When should you call yourself a senior developer? [duplicate]

Possible Duplicate: Whats the difference between Entry Level/Jr/Sr developers? I'm curious what senior developer means because apparently the definition doesn't mean what I thought it ...
177
votes
9answers
16k views

Is it normal to spend as much, if not more, time writing tests than actual code?

I find tests a lot trickier and harder to write than the actual code they are testing. It's not unusual for me to spend more time writing the test than the code it is testing. Is that normal or am I ...
177
votes
11answers
89k views

Is it OK to have multiple asserts in a single unit test?

In the comment to this great post Roy Osherove pointed to the OAPT project that is designed to run each assert in a single test. This is written on projects home page: Proper unit tests should ...
172
votes
17answers
11k views

How do you balance between “do it right” and “do it ASAP” in your daily work? [closed]

I find myself pondering over this question from time to time, again and again. I want to do things the right way: to write clean, understandable and correct code that is easy to maintain. However, ...
171
votes
13answers
49k views

Should we avoid object creation in Java?

I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible. This seems somewhat to defeat ...
170
votes
37answers
114k views

Should curly braces appear on their own line? [closed]

Should curly braces be on their own line or not? What do you think about it? if (you.hasAnswer()) { you.postAnswer(); } else { you.doSomething(); } or should it be if (you.hasAnswer()) { ...
170
votes
23answers
16k views

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 ...

15 30 50 per page