Most Popular
1500 questions
112
votes
17 answers
Being stupid to get better productivity?
I've spent a lot of time reading different books about "good design", "design patterns", etc. I'm a big fan of the SOLID approach and every time I need to write a simple piece of code, I think about the future. So, if implementing a new feature or a…
Andrey Agibalov
- 1,564
112
votes
22 answers
Automatic programming: write code that writes code
After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code".
I tried searching over the net for some more explanations or articles about it, and while I found some good articles on…
Jose Faeti
- 2,815
- 2
- 23
- 30
111
votes
9 answers
Fear of web-app not being "future-proof"
I'm a web developer of a small, local SaaS web application. It currently has about a half-dozen clients.
As I continue to design the application, it's become increasingly harder for me to convince myself to commit any time to the project, which has…
cameraguy258
- 1,229
111
votes
13 answers
Exception vs empty result set when the inputs are technically valid, but unsatisfiable
I'm developing a library intended for public release. It contains various methods for operating on sets of objects - generating, inspecting, partitioning and projecting the sets into new forms. In case it's relevant, it's a C# class library…
anaximander
- 2,285
111
votes
3 answers
Why do Trampolines work?
I've been doing some functional JavaScript. I had thought that Tail-Call Optimization had been implemented, but as it turns out I was wrong. Thus, I've had to teach myself Trampolining. After a bit of reading here and elsewhere, I was able to get…
Ucenna
- 1,302
111
votes
13 answers
Should we avoid language features that C++ has but Java doesn't?
Suppose I am limited to use C++ by the environment in the project. Is it good to prevent the use of some language features that C++ has but Java doesn't have (e.g.: multiple inheritance, operator overloading)?
I think the reasons are:
As Java is…
ggrr
- 5,775
111
votes
11 answers
Is it effective to review code in language I don't know?
I'm an experienced developer, but have not done many code reviews. I'm being asked to review code written in Python but I do not know Python.
Does it make any sense at all to review code in a language I don't know?
Heather Smith
- 1,001
- 2
- 7
- 4
111
votes
20 answers
Should I bother to develop for JavaScript disabled?
Should I bother to develop for JavaScript disabled?
I feel that my time is better spent developing for the majority.
Jiew Meng
- 2,271
111
votes
5 answers
Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?
In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override).
In my (probably naive) view, there was no need to violate interfaces like this.…
Mister Smith
- 2,977
- 4
- 21
- 17
111
votes
12 answers
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. For example, their input may describe a person but…
Daniel Kaplan
- 6,794
110
votes
166 answers
What's your favourite quote about programming?
What's your favourite quote about programming?
One quote per answer, and please check for duplicates before posting!
Gelatin
- 2,672
110
votes
13 answers
How do you justify more code being written by following clean code practices?
Moderator note
This question has already had seventeen answers posted to it. Before you post a new answer, please read the existing answers and make sure your viewpoint isn't already adequately covered.
I've been following some of the practices…
Pablo Gonzalez
- 843
110
votes
15 answers
When to optimize for memory vs performance speed for a method?
I recently interviewed at Amazon. During a coding session, the interviewer asked why I declared a variable in a method. I explained my process and he challenged me to solve the same problem with fewer variables. For example (this wasn't from the…
Corey P
- 1,224
110
votes
6 answers
Does immutability hurt performance in JavaScript?
There seems to be a recent trend in JavaScript towards treating data structures as immutable. For example, if you need to change a single property of an object, better to just create a whole new object with the new property, and just copy over all…
callum
- 10,417
110
votes
12 answers
Is testable code better code?
I'm attempting to get into the habit of writing unit tests regularly with my code, but I've read that first it's important to write testable code.
This question touches on SOLID principles of writing testable code, but I want to know if those design…
WannabeCoder
- 2,794