Linked Questions
11 questions linked to/from What popular "best practices" are not always best, and why?
182
votes
16
answers
21k
views
Why does automated testing keep failing in my company?
We have tried to introduce developer automated testing several times at my company. Our QA team uses Selenium to automate UI tests, but I always wanted to introduce unit tests and integration tests. ...
108
votes
12
answers
18k
views
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 ...
78
votes
14
answers
5k
views
When is optimization not premature and therefore not evil?
"Premature optimization is root of all evil" is something almost all of us have heard/read. What I am curious what kind of optimization not premature, i.e. at every stage of software development (high ...
77
votes
8
answers
15k
views
How can a class have multiple methods without breaking the single responsibility principle
The Single responsibility principle is defined on wikipedia as
The single responsibility principle is a computer programming principle that states that every module, class, or function should have ...
50
votes
7
answers
12k
views
Managing and organizing the massively increased number of classes after switching to SOLID?
Over the last few years, we have been slowly making the switch over to progressively better written code, a few baby steps at a time. We are finally starting to make the switch over to something that ...
40
votes
11
answers
7k
views
Is it bad habit not using interfaces? [closed]
I use interfaces rarely and find them common in others code.
Also I create sub and super classes (while creating my own classes) rarely in my code.
Is it a bad thing?
Would you suggest changing ...
32
votes
10
answers
5k
views
Does logging inside a class violate the SRP?
I wrote a class that takes a Logger class as one of its arguments:
class QueryHandler:
def __init__(self, query: Query, logger: Logger) -> None:
self.query = query
self.logger =...
14
votes
12
answers
2k
views
What do programmers "micro-optimize" for today? [closed]
Back in the "good ol' days," when we would copy shareware onto floppies for friends, we also used a fair bit of assembly. There was a common practice of "micro-optimization," where you would stare and ...
32
votes
8
answers
2k
views
What causes bad performance in consumer apps? [closed]
My Comcast DVR takes at least three seconds to respond to every remote control keypress, making the simple task of watching television into a frustrating button-mashing experience. My iPhone takes at ...
16
votes
8
answers
1k
views
When should I care about performance?
For the longest time in places like Java's IRC channel, SO, and other places I've been told something along the lines of "Worry about how the code looks and its readability/understandability now, and ...
7
votes
1
answer
973
views
Does unused code affects the assembly after startup (Memory for example)?
Disclaimer: I come from a PHP background.
In PHP, I could have thousands files, which are never loaded, if not needed, due to the autoloader feature (If some code is needed, it would be loaded)
How ...