Most Popular
1500 questions
105
votes
5 answers
Should I submit a pull request to correct minor typos in a Readme file?
While going through the README file of a GitHub repository I am not a contributor of, I noticed a few minor typos and wondered if I should submit a pull request to correct them or if reviewing the request would take the maintainer too much time to…
Florent Michel
- 1,131
105
votes
17 answers
Is encapsulation still one of the elephants OOP stands on?
Encapsulation tells me to make all or almost all fields private and expose these by getters/setters. But now libraries such as Lombok appear which allow us to expose all private fields by one short annotation @Data. It will create getters, setters…
Gangnus
- 2,805
105
votes
12 answers
When do function call costs still matter in modern compilers?
I am a religious person and make efforts not to commit sins. That is why I tend to write small (smaller than that, to reword Robert C. Martin) functions to comply with the several commandments ordered by the Clean Code bible. But while checking…
Billal Begueradj
- 1,365
105
votes
14 answers
At what point is brevity no longer a virtue?
A recent bug fix required me to go over code written by other team members, where I found this (it's C#):
return (decimal)CostIn > 0 && CostOut > 0 ? (((decimal)CostOut - (decimal)CostIn) / (decimal)CostOut) * 100 : 0;
Now, allowing there's a good…
Bob Tway
- 3,636
- 3
- 21
- 26
105
votes
11 answers
Where should my team start with becoming "modern"?
I'm a relatively new developer, fresh from college. While in college and during subsequent job-seeking, I realized that there were a lot of "modern" software development methodologies that my education was lacking: unit testing, logging, database…
WannabeCoder
- 2,794
105
votes
3 answers
When and for what purposes should the const keyword be used in C for variables?
While getting my code reviewed here the issue of using the const keyword came up. I understand that it is used for implementing read-only behaviour on variables.
I am confused about what are the various situations when it can be useful.
Should it…
Aseem Bansal
- 2,974
105
votes
18 answers
Is it poor programming practice to pass parameters as Objects?
So, we've got a guy who likes to write methods that take Objects as parameters, so they can be 'very flexible.' Then, internally, he either does direct casting, reflection or method overloading to handle the different types.
I feel like this is a…
Risser
- 303
105
votes
4 answers
Is XHTML5 dead or is it just an synonym of HTML5?
So what happened to XHTML5?
http://www.w3.org/TR/html5/
That page is a draft for both xhtml5 and html5?
So there's no difference between these doctypes?
W3C
- 1,061
105
votes
21 answers
What's the benefit of avoiding the use of a debugger?
Over the course of my career, I've noticed that some developers don't use debugging tools, but do spot checking on erroneous code to figure out what the problem is.
While many times being able to quickly find errors in code without a debugger is a…
Jonathan DS
- 460
- 2
- 6
- 15
105
votes
47 answers
Make a big deal out of == true?
There is a colleague of mine who constantly writes:
if (someBool == true)
It drives me up the wall! Should I make a big deal of it or just drop it?
JoelFan
- 7,091
105
votes
9 answers
What is the supposed productivity gain of dynamic typing?
I often heard the claim that dynamically typed languages are more productive than statically typed languages. What are the reasons for this claim? Isn't it just tooling with modern concepts like convention over configuration, the use of functional…
Dr. Hans-Peter Störr
- 1,403
105
votes
2 answers
MIT vs. BSD vs. Dual License
My understanding is that:
MIT-licensed projects can be used/redistributed in BSD-licensed projects.
BSD-licensed projects can be used/redistributed in MIT-licensed projects.
The MIT and the BSD 2-clause licenses are essentially identical.
BSD…
ryanve
- 1,159
- 2
- 8
- 6
105
votes
15 answers
Why are data structures so important in interviews?
I must confess that I was not so strong in data structures when I graduated out of college. Throughout the campus placements during my graduation, I've witnessed that most of the biggie tech companies like Amazon, Microsoft etc focused mainly on…
Vamsi Emani
- 1,745
- 7
- 21
- 21
104
votes
14 answers
Why are most browsers developed in C++
It seems like most of common web browsers (Firefox, Chrome, Safari) are developed using C++. Whys is that so?
Nipuna
- 1,306
104
votes
9 answers
Why should I use dependency injection?
I am having a hard time looking for resources on why I should use dependency injection. Most of the resources that I see explains that it just passes an instance of an object to another instance of an object, but why? Is this just for cleaner…
Daniel
- 1,045
- 2
- 8
- 5