The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
298 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 ...
82
votes
10answers
11k 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 ...
37
votes
10answers
1k views

Emotional detachment from bad code [duplicate]

We all would like to work with good, easy to maintain code that follows best practices and design patterns. However, reality is far from ideal. After all, content on sites like The Daily WTF is not ...
-3
votes
1answer
202 views

Why softwares used in factories are so poorly designed? [closed]

Why apps like Trumph's suite are so poorly designed and (without seeing the actual source, I can only guess) badly written? This question came this afternoon after a crash while doing a simulation in ...
5
votes
3answers
3k 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 ...
14
votes
9answers
2k views

What to do if a team member delivers bad quality code? [duplicate]

I work as a kind of mixture of a Scrum Master and a team lead. In my team I have the problem that one of the members delivers bad quality. The code he produces is difficult to understand, difficult to ...
4
votes
4answers
802 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 ...
6
votes
2answers
655 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()) { ...
6
votes
4answers
417 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 ...
52
votes
3answers
8k 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 ...
4
votes
10answers
696 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 ...
5
votes
5answers
1k 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 ...
121
votes
15answers
9k 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 ...
22
votes
10answers
2k views

How to prove an application is built on a bad codebase?

I'm currently reviewing a system built by some developers that previously worked at my job. The system works pretty well from a user's point of view, but when delving into code review it's a utter ...
17
votes
3answers
848 views

At the end of my rope

I am a contractor to a big company. Currently, there are three developers on the project, myself included. The problem is the other 2 developers don't really get it. By "it" i mean the following: ...
19
votes
9answers
821 views

Is it better to use pre-existing bad practices, or good practices that don't fit well with old code? [closed]

I was thinking of this because I was trying to write an extension for an existing 3rd party software, and their database is horribly denormalized. I needed to use their existing tables and add a bunch ...
17
votes
7answers
673 views

What can you do about the quality of existing integration and unit tests while being the new guy in a team ?

A recurring theme that I came across in my career is being the new developer to arrive in a team, and quickly having an inherent distrust of the existing unit and integration test suites. During the ...
16
votes
7answers
1k views

If a fluent coder disregards good practices, doesn't his fluency work against him?

I am working on a fairly large and buggy application - and due to the way it's written (I'll spare you details, but it violates rules in most areas you can think of), it is next to impossible ...
36
votes
3answers
1k views

Blaming the ills of today on the technical debt of yesterday

A surprising number of quality, scalability, and load problems have been occurring on an application I currently support that I did not originally write. Thankfully I have new projects that I have ...
4
votes
3answers
360 views

Refactoring Bittersweet PHP: How can I make this less painful?

I've just been assigned a large project. The client has had multiple developers across different companies working on their (intended to be) large, MySQL driven eCommerce site. The DB schema is ...
34
votes
11answers
1k views

How do you stay productive when dealing with extremely badly written code?

I don't have much experience in working in software industry, being self-taught and having participated in open source before deciding to take a job. Now that I work for money, I also have to deal ...
20
votes
12answers
4k views

What design patterns are the worst or most narrowly defined? [closed]

For every programming project, Managers with past programming experience try to shine when they recommend some design patterns for your project. I like design patterns when they make sense or if you ...
25
votes
13answers
16k views

Worst practices in C++, common mistakes [closed]

After reading this famous rant by Linus Torvalds, I wondered what actually are all the pitfalls for programmers in C++. I'm explicitly not referring to typos or bad program flow as treated in this ...
6
votes
7answers
3k views

What to watch out for when writing code at an Interview?

I have read that at a lot of companies you have to write code at an interview. On the one hand I see that it makes sense to ask for a work sample. On the other hand: What kind of code do you expect to ...
13
votes
0answers
605 views

How do you dive into a big ball of mud? [duplicate]

Possible Duplicate: How do you dive into large code bases? So there is a question about understanding code. Mine is a similar problem. It started when I joined my current org. and like I ...
14
votes
11answers
412 views

Should you fix preexisting defects while working on something else?

Conundrum: During the course of working on a new feature or fixing a defect, you find a legacy problem in code. What should you do? Fix it and risk altering the behavior of the code. It has either ...
8
votes
3answers
172 views

System Decoupled in the Wrong Places: Meta-Problem?

At a meta level, I often find that when I grow a codebase organically, parts of the system that I eventually find need to know about each other (at least through some interface) have been mercilessly ...
13
votes
8answers
1k views

Do you write bad code when under pressure? [closed]

When you are under pressure, the deadline is approaching, and a manager is breathing down your neck do you find yourself starting to write bad code? Do TDD and best practices slip by the wayside in ...
17
votes
6answers
1k views

How do you deal with intentionally bad code?

There are many stories about intentionally bad code, not only on TheDailyWTF but also on SO. Typical cases include: Having a useless time-wasting construct (e.g. an empty loop counting to some huge ...
35
votes
24answers
3k views

What's the scariest piece of Other People's Code you've ever had to maintain? [closed]

It's happened to all of us. Maybe the original author is no longer with the company, or maybe the boss just doesn't trust him to fix it (Kernighan's Law). Either way, they gave it to you, and you ...