Tagged Questions
42
votes
12answers
2k views
Coding style (do more, then simplify) [duplicate]
I'm a CS student and I have been coding for a few months shy of a year now, and I seem to have developed what I think may be a "bad" habit and I'm wondering if anyone does the same (or whether it's a ...
3
votes
7answers
273 views
Naming guard clauses that throw exceptions
I have a function evaluate() that parses a String for some variables and replaces them with their corresponding value:
public String evaluate() {
String result = templateText;
for ...
7
votes
3answers
474 views
Cleaning Up Generated Code: Refactor or Map?
Context:
I recently had to deal with a class file generated by XSD.exe. It was 3500 lines long with ridiculously-verbose class / variable names (think ...
16
votes
5answers
986 views
How do I prevent unknowningly duplicating code?
I work on a rather large code base. Hundreds of classes, tons of different files, lots of functionality, takes more than 15 minutes to pull down a fresh copy, etc.
A big problem with such a large ...
27
votes
9answers
2k views
How clean should new code be? [duplicate]
I'm the lead designer in our team, which means I'm responsible for the quality of the code; functionality, maintainability and readability.
How clean should I require my team members' code to be if ...
92
votes
16answers
4k views
Should I remove unreferenced code?
I'm working on a medium sized (100k lines) code base, it's all relatively recent code (less than a year old) and has good unit test coverage.
I keep coming across methods which are either no longer ...
25
votes
12answers
2k views
What is best practice on ordering parameters in a function?
Sometimes (rarely), it seems that creating a function that takes a decent amount of parameters is the best route. However, when I do, I feel like I'm often choosing the ordering of the parameters at ...
13
votes
3answers
294 views
Low impact refactoring and code cleaning of sloppy code while waiting for requirements
I inherited an existing code base for a product that is reprehensibly sloppy. The fundamental design is woefully inadequate which unfortunately I can do little about without a complete refactor (HIGH ...
14
votes
18answers
1k views
Why write clean, refactored code?
This is a question I've been asking myself for a long time. Thought of throwing out it to you.
From my experience of working on several Java based projects, I've seen tons of codes which we call ...
23
votes
6answers
643 views
What payoffs have you seen from taking care of technical debt?
This article on technical debt has some good points, including:
Working on the "technical matters" works best when it is driven by stories. The code base is probably in need of work everywhere, ...
