【踏春进行时】自驾斯柯达野帝兰田水库钓鱼。
6,557 questions
353
votes
19
answers
66k
views
How would you know if you've written readable and easily maintainable code? [closed]
How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view, the code is readable and maintainable, because the ...
463
votes
19
answers
199k
views
I've inherited 200K lines of spaghetti code -- what now?
I hope this isn't too general of a question; I could really use some seasoned advice.
I am newly employed as the sole "SW Engineer" in a fairly small shop of scientists who have spent the last 10-20 ...
201
votes
32
answers
49k
views
Is micro-optimisation important when coding?
I recently asked a question on Stack Overflow to find out why isset() was faster than strlen() in PHP. This raised questions around the importance of readable code and whether performance improvements ...
50
votes
2
answers
26k
views
Choosing the right Design Pattern
I've always recognized the importance of utilizing design patterns. I'm curious as to how other developers go about choosing the most appropriate one. Do you use a series of characteristics (like a ...
144
votes
31
answers
160k
views
How do you dive into large code bases?
What tools and techniques do you use for exploring and learning an unknown code base?
I am thinking of tools like grep, ctags, unit-tests, functional test, class-diagram generators, call graphs, ...
41
votes
2
answers
18k
views
What is O(...) and how do I calculate it?
Help! I have a question where I need to analyze the Big-O of an algorithm or some code.
I am unsure exactly what Big-O is or how it relates to Big-Theta or other means of analyzing an algorithm's ...
31
votes
4
answers
10k
views
Style for control flow with validation checks
I find myself writing a lot of code like this:
int myFunction(Person* person) {
int personIsValid = !(person==NULL);
if (personIsValid) {
// do some stuff; might be lengthy
int myresult ...
441
votes
18
answers
191k
views
Why is Global State so Evil?
Before we start this, let me say I'm well aware of the concepts of Abstraction and Dependency Injection. I don't need my eyes opened here.
Well, most of us say, (too) many times without really ...
175
votes
17
answers
19k
views
How can I convince management to deal with technical debt?
This is a question that I often ask myself when working with developers. I've worked at four companies so far and I've become aware of a lack of attention to keeping code clean and dealing with ...
99
votes
34
answers
67k
views
"Comments are a code smell" [closed]
A coworker of mine believes that any use of in-code comments (ie, not javadoc style method or class comments) is a code smell. What do you think?
2181
votes
1
answer
487k
views
What technical details should a programmer of a web application consider before making the site public?
What things should a programmer implementing the technical details of a web application consider before making the site public? If Jeff Atwood can forget about HttpOnly cookies, sitemaps, and cross-...
31
votes
3
answers
61k
views
Approaches for checking multiple conditions? [duplicate]
What is the best practice for checking multiple conditions, in no particular order?
The example in question needs to check four distinct conditions, in any order, and fail showing the correct error ...
326
votes
25
answers
80k
views
When is a BIG Rewrite the answer?
Just read the question about the Big Rewrites and I remembered a question that I've been wanting answered myself.
I have a horrible project passed down to me, written in old Java, using Struts 1.0, ...
125
votes
7
answers
15k
views
What is the most effective way to add functionality to unfamiliar, structurally unsound code? [duplicate]
This is probably something everyone has to face during the development sooner or later.
You have an existing code written by someone else, and you have to extend it to work under new requirements.
...
209
votes
4
answers
103k
views
What is an Anti-Corruption layer, and how is it used?
I'm trying to figure out what the Anti-Corruption layer really means. I know that it's a way to transition/work around legacy code or bad APIs. What I don't understand is how it works and what makes ...