Most Popular
1500 questions
104
votes
11 answers
What's the name of the antipattern opposite to "reinventing the wheel"?
The "Reinvent the wheel" antipattern is a pretty common one - instead of using a ready solution, write your own from scratch. Code base grows needlessly, slightly different interfaces that do the same thing but slightly differently abound, time is…
SF.
- 5,156
104
votes
10 answers
Where is the line between unit testing application logic and distrusting language constructs?
Consider a function like this:
function savePeople(dataStore, people) {
people.forEach(person => dataStore.savePerson(person));
}
It might be used like this:
myDataStore = new Store('some connection string', 'password');
myPeople = ['Joe',…
Jonah
- 1,476
104
votes
10 answers
Has / can anyone challenge Uncle Bob on his love of removing "useless braces"?
I hate referencing paywalled content, but this video shows exactly what I'm talking about. Precisely 12 minutes in Robert Martin looks at this:
And says "One of my favorite things to do is getting rid of useless braces" as he turns it into this:
A…
candied_orange
- 108,538
104
votes
9 answers
What's the point of running unit tests on a CI server?
Why would you run unit tests on a CI server?
Surely, by the time something gets committed to master, a developer has already run all the unit tests before and fixed any errors that might've occurred with their new code. Isn't that the point of unit…
Calin Leafshade
- 1,991
104
votes
5 answers
Why doesn't Java have optimization for tail-recursion at all?
From what I have read: The reason is because it is not easy to determine which method will actually be called as we have inheritance.
However, why doesn't Java at least have tail-recursion optimization for static methods and enforce proper way to…
InformedA
- 3,001
104
votes
7 answers
Ship of Theseus applied to GPL - Can I relicense my program if I replace all of the derivative parts?
I translated a GPLv2 C program to Python, but found it was hard to extend as designed and rewrote significant portions of it. The program is now structurally completely different, but there are several verbatim translated functions in use.
The Ship…
Landon
- 1,013
104
votes
10 answers
Zero behavior objects in OOP - my design dilemma
The basic idea behind OOP is that data and behavior (upon that data) are inseparable and they are coupled by the idea of an object of a class. Object have data and methods that work with that (and other data). Obviously by the principles of OOP,…
RokL
- 2,421
104
votes
18 answers
Why is verbosity bad for a programming language?
I have seen many people around complaining about verbosity in programming languages. I find that, within some bounds, the more verbose a programming language is, the better it is to understand. I think that verbosity also reinforces writing clearer…
Fran Sevillano
- 1,559
103
votes
13 answers
What can multiple threads do that a single thread cannot?
While threads can speed up execution of code, are they actually needed? Can every piece of code be done using a single thread or is there something that exists that can only be accomplished by using multiple threads?
AngryBird
- 1,805
103
votes
11 answers
How often should I/do you make commits?
I am a recent (as of yesterday) college grad - BS in Computer Science. I've been a huge fan of version control ever since I got mad at an assignment I was working on and just started from scratch, wiping out a few hours worth of actually good work.…
Wayne Werner
- 2,360
103
votes
5 answers
With all of these services, how can I not be anemic?
Where do we draw the line between delegation and encapsulation of business logic? It seems to me that the more we delegate, the more anemic we become. However, delegation also promotes reuse and the DRY principal. So what is appropriate to delegate…
SonOfPirate
- 2,915
103
votes
6 answers
Stack and Heap memory in Java
As I understand, in Java, stack memory holds primitives and method invocations and heap memory is used to store objects.
Suppose I have a class
class A {
int a ;
String b;
//getters and setters
}
Where will the primitive a in…
Vinoth Kumar C M
- 15,565
103
votes
5 answers
What does 'Nightly Builds' mean?
I have been using open source projects for a while and been developing upon the open source applications and every so often I come across the words 'Nightly Build' and I have always been curious as to what it actually means. Does it literally mean…
dbramhall
- 1,791
103
votes
9 answers
Is putting general-use functions in a "helpers" file an anti-pattern or code smell?
Is it an anti-pattern or code smell to put "general use" functions (examples below) into a catch-all file named "helpers" or "utils"?
It's a pattern I've seen quite a lot in the JavaScript world, which I've also seen with other languages.
By…
old greg
- 929
103
votes
13 answers
How to deal with 'almost good' code from a junior developer?
I got a question about team managing. Right now I'm dealing with a junior developer who's working remotely from a coding factory. The guy is open to criticism and willing to learn, but I got some doubts how much should I push some stuff.
Right now…
Zalomon
- 1,200