Most Popular
1500 questions
118
votes
16 answers
Should I add redundant code now just in case it may be needed in the future?
Rightly or wrongly, I'm currently of the belief that I should always try to make my code as robust as possible, even if this means adding in redundant code / checks that I know won't be of any use right now, but they might be x amount of years down…
KidCode
- 2,173
118
votes
8 answers
How to write a good exception message
I'm currently doing a code review and one of the things I'm noticing are the number of exceptions where the exception message just seems to reiterate where the exception occurred. e.g.
throw new Exception("BulletListControl: CreateChildControls…
Colin Mackay
- 1,392
118
votes
5 answers
How can Swift be so much faster than Objective-C in these comparisons?
Apple launched its new programming language Swift at WWDC14. In the presentation, they made some performance comparisons between Objective-C and Python. The following is a picture of one of their slides, of a comparison of those three languages…
Yellow
- 1,273
118
votes
2 answers
What does the term "Payload" mean in programming
I was going through the source code of an open source framework, where I saw a variable "payload" mentioned many times. Any ideas what "payload" stands for?
Vishwas
- 1,871
118
votes
4 answers
Difference between Dependency Injection (DI) and Inversion of Control (IOC)
I've been seeing a lot of references of Dependency Injection (DI) & Inversion Of Control (IOC), but I don't really know if there is a difference between them or not.
I would like to start using one or both of them, but I'm a little confused as to…
Elijah Manor
117
votes
18 answers
Dealing with engineers that frequently leave their jobs
My friend is a project manager for a software company. The most frustrating thing for him is that his engineers frequently leave their jobs. The company works hard to recruit new engineers, transfer projects, and keep a stable quality product. When…
卢声远 Shengyuan Lu
- 1,559
- 3
- 16
- 25
117
votes
12 answers
Rationale to prefer local variables over instance variables?
The codebase I'm working on frequently uses instance variables to share data between various trivial methods. The original developer is adamant that this adheres to the best practices stated in the Clean Code book by Uncle Bob/Robert Martin: "The…
Alexander
- 1,063
117
votes
20 answers
Project Manager that wants to lock in time estimate with a signed contract
At a previous employment, a project manager (PM) wasn't satisfied with the delivery time of the code on a project I was on. I was told by my project lead that that the PM was considering having me sign a contract to lock-in my time estimates I gave…
spong
- 9,421
117
votes
14 answers
What triggered the popularity of lambda functions in modern mainstream programming languages?
In the last few years anonymous functions (AKA lambda functions) have become a very popular language construct and almost every major / mainstream programming language has introduced them or is planned to introduce them in an upcoming revision of…
Giorgio
- 19,646
117
votes
20 answers
Is the phrase "never reinvent the wheel" suitable for students?
I find myself constantly running into this expression "don't reinvent the wheel" or "never reinvent the wheel" when I ask some questions on SO. They tell you to use some frameworks or existing packages. I know where this attitude is coming from…
Gnijuohz
- 2,055
117
votes
4 answers
What is the difference between the "lib" and "vendor" folders?
Regarding source folder hierarchy, there are always some common features, such as the src, doc or test folders, which have rather easy-to-understand contents.
However, I realized that big projects have both a lib and vendor folders, while I had…
MattiSG
- 1,952
- 2
- 13
- 16
117
votes
17 answers
Should I tell someone that their commit caused a regression?
When you track down and fix a regression—i.e. a bug that caused previously working code to stop working—version control makes it entirely possible to look up who committed the change that broke it.
Is it worth doing this? Is it constructive to point…
Scott
- 2,091
116
votes
20 answers
Is static typing worth the trade-offs?
I began coding in in Python primarily where there is no type safety, then moved to C# and Java where there is. I found that I could work a bit more quickly and with less headaches in Python, but then again, my C# and Java apps are at much higher…
Morgan Herlocker
- 12,742
116
votes
15 answers
Is LISP still useful in today's world? Which version is most used?
I try to teach myself a new programming language in regular intervals of time. Recently, I've read how Lisp and its dialects are at the complete opposite end of the spectrum from languages like C/C++, which made me curious enough to know more about…
TCSGrad
- 1,362
116
votes
8 answers
How to keep applications stateless
This may be a convoluted question, but I'm trying to get a better understanding of statelessness.
Based on what I've read, web applications should be stateless, meaning each request is treated as an independent transaction. As a result, Session and…
user253058