15
votes
5answers
8k views

What to plan before starting development on a project? [closed]

Say I've received the specifications for a project from a client, and now its time to start developing it. Normally, I just start with the first module (usually user registration) and then go from one ...
55
votes
7answers
56k views

When to use abstract classes instead of interfaces with extension methods in C#?

"Abstract class" and "interface" are similar concepts, with interface being the more abstract of the two. One differentiating factor is that abstract classes provide method implementations for derived ...
25
votes
10answers
26k views

Should I use switch statements or long if…else chains?

Often when I hear about the switch statement, its put off as a way to replace long if...else chains. But it seems that when I use the switch statement I'm writing more code that I would be just ...
24
votes
7answers
1k views

Does software reuse preclude process repeatability

Code Reuse as a Problem I was thinking about this question on software delivery, and I kept coming back to the issue of repeatability and / or reproducibility. They matter, because if you don’t ...
20
votes
5answers
4k views

Data input validation - Where? How much? [closed]

Data input validation always was quite an internal struggle to me. On the verge of adding a real security framework and code to our legacy application rewrite project (which so far pretty much keeps ...
28
votes
9answers
2k views

Design for future changes or solve the problem at hand [closed]

While writing the code or during design do you try to generalize the problem at the first instance itself or try to solve that very specific problem. I am asking this because trying to generalize the ...
18
votes
6answers
7k views

Efficient try / catch block usage?

Should catch blocks be used for writing logic i.e. handle flow control etc? Or just for throwing exceptions? Does it effect efficiency or maintainability of code? What are the side effects (if there ...
419
votes
33answers
202k 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 can'...
388
votes
13answers
130k 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, ...
237
votes
33answers
66k views

Will high reputation in Stack Overflow help to get a good job?

In a post, Joel Spolsky mentioned that 5 digit Stack Overflow reputation can help you to earn a job paying $100k+. How much of that is real? Would anyone like to share their success in getting a high ...
188
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 ...
119
votes
10answers
9k views

Should we define types for everything?

Recently I got into a problem with the readability of my code. I had a function that did an operation and returned a string representing the ID of this operation for future reference (a bit like ...
112
votes
39answers
38k views

Why are zero-based arrays the norm?

A question asked here reminded me of a discussion I had with a fellow programmer. He argued that zero-based arrays should be replaced with one-based arrays since arrays being zero-based is an ...
76
votes
15answers
6k views

Why is DRY important?

Quite simple, why would I want to write code that works for all cases and scalable data when all I need to do is repeat the same process a few times with a few minor tweaks? I'm unlikely to need to ...
63
votes
11answers
8k views

Did the developers of Java consciously abandon RAII?

As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom: using (var ...
32
votes
12answers
5k views

How possible is it to estimate time for programming projects? [duplicate]

It seems like it is nearly impossible to get close because you could run into any number of issues and things not first anticipated. How close can we be expected to reasonably estimate? Our PM wants ...
56
votes
9answers
7k views

Clean readable code vs fast hard to read code. When to cross the line?

When I write code I always try to make my code as clean and readable as possible. Every now and then there comes a time when you need to cross the line and go from nice clean code to slightly uglier ...
35
votes
14answers
6k views

How to learn to make better estimates? [closed]

I suck at estimates. When someone asks me how long something will take, I don't even dare to make a guess since I will be completely off the mark. Usually I'm way too optimistic, and should probably ...
40
votes
7answers
5k views

How do I prove or disprove “god” objects are wrong?

Problem Summary: Long story short, I inherited a code base and a development team I am not allowed to replace and the use of God Objects is a big issue. Going forward, I want to have us re-factor ...
71
votes
12answers
8k views

I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?

My specific case here is that the user can pass in a string into the application, the application parses it and assigns it to structured objects. Sometimes the user may type in something invalid. ...
27
votes
7answers
53k views

Functional or non-functional requirement?

I'm wondering about functional or non-functional requirements. I have found lot of different definitions for those terms and I can't assign some of my requirement to proper category. I'm wondering ...
32
votes
1answer
11k views

What is the difference between the factory pattern and abstract factory?

Having finally begun seriously trying to learn some basic patterns (very late in the career, but that's a different story), I'm trying to get my head around the differences between the Factory Pattern ...
37
votes
9answers
2k views

Prototyping vs. Clean Code at the early stages

I'm planning to work/start on a few personal projects that could end up as my daily job. It made me think, which way should I start? Just prototype—write just working basic code that could cost me ...
38
votes
8answers
2k views

Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?

I have to extend an existing module of a project. I don't like the way it has been done (lots of anti-pattern involved, like copy/pasted code). I don't want to perform a complete refactor for many ...
24
votes
6answers
2k views

What actions to take when people leave the team? [duplicate]

Recently one of our key engineers resigned. This engineer has co-authored a major component of our application. We are not hitting Truck number yet though, but we're getting close :) Before the guy ...
23
votes
9answers
2k views

Can Agile be accomplished without client involvement?

I couldn't write a book on Agile. I have worked in several shops that call their process Agile. One of the main points of Agile development is regular client involvement. After a sprint, the work ...
17
votes
2answers
6k views

Using GPL libraries without modification on a commercial website, do I need to make my source code available? [duplicate]

If I write a public-facing commercial website, and use a GPL javascript library and/or binaries without modifying them (such as plupload), would I be required to make the source for my website ...
29
votes
5answers
5k views

Why is it often said that the test cases need to be made before we start coding? [duplicate]

Why is it often said that the test cases need to be made before we start coding? What are its pros and what the cons if we don't listen to this advice? Moreover, does that advice refer to black box ...
6
votes
4answers
818 views

Are trivial protected getters blatant overkill?

Something I really have not thought about before (AS3 syntax): private var m_obj:Object; protected function get obj():Object { return m_obj; } private var m_str:String; protected function get ...
82
votes
15answers
45k views

How can I really master a programming language?

I know that learning a language, you can simply buy a book, follow the examples, and whenever possible try the exercises. But what I'm really looking is how to master the language once you've learned ...
100
votes
45answers
17k views

What popular “best practices” are not always best, and why? [closed]

"Best practices" are everywhere in our industry. A Google search on "coding best practices" turns up nearly 1.5 million results. The idea seems to bring comfort to many; just follow the instructions,...
132
votes
17answers
41k views

Are #regions an antipattern or code smell?

C# allows the use of #region/#endregion keywords to make areas of code collapsible in the editor. Whenever I do this though I do it to hide large chunks of code that could probably be refactored into ...
62
votes
10answers
10k views

(Why) is it important that a unit test not test dependencies?

I understand the value of automated testing and use it wherever the problem is well-specified enough that I can come up with good test cases. I've noticed, though, that some people here and on ...
67
votes
17answers
36k views

How can software be protected from piracy?

Why does it seem so easy to pirate today? It just seems a little hard to believe that with all of our technological advances and the billions of dollars spent on engineering the most unbelievable and ...
83
votes
16answers
25k views

Should one check for null if he does not expect null?

Last week, we had a heated argument about handling nulls in our application's service layer. The question is in the .NET context, but it will be the same in Java and many other technologies. The ...
50
votes
5answers
13k views

Should I use Dependency Injection or static factories?

When designing a system I am often faced with the problem of having a bunch of modules (logging, database acces, etc) being used by the other modules. The question is, how do I go about providing ...
35
votes
4answers
8k views

As a sole developer (for now), how should I be using Git? [closed]

I have multiple projects on Git that I eventually want to bring others into. However, right now it's just me and I use Git and GitHub very simplistically: no branches and basically just using the ...
24
votes
7answers
5k views

Should I keep investing into data structures and algorithms? [closed]

These days, I'm investing heavily in data structures and algorithms and trying to solve some programming puzzles. I'm trying to code and solve with Java and Clojure. Am I wasting my time? should I ...
22
votes
21answers
14k views

Self Documenting Code Vs. Commented Code

I had a search but didn't find what I was looking for, please feel free to link me if this question has already being asked. Earlier this month this post was made: http://net.tutsplus.com/tutorials/...
129
votes
34answers
6k views

How do you make people accept code review? [duplicate]

All programmers have their style of programming. But some of the styles are let’s say... let’s not say. So you have code review to try to impose certain rules for good design and good programming ...
30
votes
14answers
7k views

Why develop free, open source programs? [closed]

Why would someone use his own time to develop an open-source project for free and without compensation?
25
votes
6answers
9k views

Is there a canonical book for learning Java as an experienced developer? [closed]

I have been a .NET developer now for about the past 5/6 years give or take. I have never done any professional Java development and the last time I really touched it was probably back in college. I ...
55
votes
4answers
2k views

How to explain to a non-technical person why the task will take much longer than they think?

Almost every developer has to answer questions from business side like: Why is going to take 2 days to add this simple contact form? When a developer estimates this task, they may divide it into ...
28
votes
4answers
21k views

Copyright notices/disclaimers in source files

It's a common practice to place copyright notices, various legal disclaimers and sometimes even full license agreements in each source file of an open-source project. Is this really necessary for a (1)...
25
votes
4answers
2k views

Using assertions versus throwing exceptions?

Often when I write a functions I want to make sure the inputs to it are valid in order to detect such errors as early as possible (I believe these are called preconditions). When a precondition fails, ...
34
votes
16answers
6k views

Should newbies use IDE autocomplete (Intellisense)? [closed]

I often encounter this when I am helping out someone who is new to programming and learning it for the first time. I'm talking about really new newbies, still learning about OOness, constructing ...
15
votes
2answers
862 views

Software Testing Techniques or Categories [closed]

What kinds of software testing do you know? I've heard about Test-Driven Development, Unit tests etc, but can't understand their importance and difference. For example, why are we using regression ...
97
votes
11answers
9k views

One-line functions that are called only once

Consider a parameterless (edit: not necessarily) function that performs a single line of code, and is called only once in the program (though it is not impossible that it'll be needed again in the ...
21
votes
11answers
5k views

Is it a really required skill to program without API documentation? [closed]

I barely passed my Java programming exam today. I had to answer some general questions about threading which I did well and to write a little threaded program which was worse. I had to connect my ...
10
votes
2answers
3k views

Choosing the right Design Pattern

I've always recognized the importance of utilizing design patterns. I'm curious as to how other developers go about choosing the most appropriate one. Do you use a series of characteristics (like a ...

15 30 50 per page