Questions tagged [bad-code]
The bad-code tag has no summary.
28 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
13
votes
6
answers
6k
views
Is it bad practice create "alias" variables to not use globals or arguments with long names in a method?
Is it OK to create a variable which only purpose is to increase readability?
Example:
public class Example
{
private final HowLongCanARepositoryNameReallyBeRepository ...
0
votes
1
answer
144
views
Is a "concrete function" over "generic function" a good implementation?
I want to know others opinion about this approach that I use in a lot of projects, for example, I can show the last time that I use it:
public class DataStorageService {
private enum Keys {
...
10
votes
4
answers
3k
views
is this way of calling a function a bad practice?
I have the following code:
public void moveCameraTo(Location location){
moveCameraTo(location.getLatitude(), location.getLongitude());
}
public void moveCameraTo(double latitude, double ...
3
votes
1
answer
335
views
if null is bad how we justify the "rfc" nullable for php language?
I do not understand how you think about it:https://wiki.php.net/rfc/nullable_types
when It is widely confirmed, that using nulls is bad practice
Where am I wrong?
thanks.
I'm not criticizing !.
I ...
107
votes
11
answers
22k
views
What kind of bugs do "goto" statements lead to? Are there any historically significant examples?
I understand that save for breaking out of loops nested in loops; the goto statement is evaded and reviled as a bug prone style of programming, to never be used.
Alt Text: "Neal Stephenson thinks it's ...
3
votes
1
answer
358
views
Use a template to get alternate behaviour?
Is this a bad practice?
const int sId(int const id);
// true/false it doesn't matter
template<bool i>
const int sId(int const id) {
return this->id = id;
}
const int MCard::sId(int ...
102
votes
10
answers
56k
views
Why is "Select * from table" considered bad practice
Yesterday I was discussing with a "hobby" programmer (I myself am a professional programmer). We came across some of his work, and he said he always queries all columns in his database (even on/in ...
34
votes
3
answers
62k
views
Is it OK to return HTML from a JSON API?
On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON.
The client consistently ...
4
votes
4
answers
2k
views
What can I do to maintain respect for a poorly written codebase? [duplicate]
In my job I have to maintain a poorly written codebase which is both hard to understand, has tons of comments that are just plain wrong, has a bunch of weird decisionmaking going on in it and a whole ...
10
votes
2
answers
4k
views
Are side-effects in Array's "every", or "some" bad?
I've always been taught that having side-effects in an if condition are bad. What I mean is;
if (conditionThenHandle()) {
// do effectively nothing
}
... as opposed to;
if (condition()) {
...
7
votes
4
answers
599
views
How do you deal with discovering bad and false code in your team? [duplicate]
Every year in january we process a big task with our system. While the performance during the task was above average the maintaince follow up is currently having a lot of trouble with jobs running too ...
209
votes
4
answers
104k
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 ...
10
votes
10
answers
3k
views
What to do when a project is too difficult to continue developing?
As a developer, can you tell your project manager that an application is unworkable? Or, if you're a project manager, how would you need this presented to you in order to be compelled? This isn't ...
7
votes
5
answers
4k
views
How do I maintain a really poorly written code base? [duplicate]
Possible Duplicate:
I’ve inherited 200K lines of spaghetti code — what now?
Recently I got hired to work on existing web application because of NDA I'm not at liberty to disclose any details but ...
131
votes
14
answers
11k
views
Demonstrate bad code to client?
A client has asked me to do a redesign of their website, an ASP.NET Webforms application that was developed by another consultant. It seemed like a relatively straightforward job, but after looking at ...
Community wiki