Most Popular

1500 questions
124
votes
9 answers

Are design patterns really essential nowadays?

I was reading "Coders at Work" and have faced the fact that some of the professionals interviewed in the book are not so enthusiastic about design patterns. I think that there are 2 main reasons for this: Design patterns force us to think in their…
Sergey
  • 2,703
124
votes
12 answers

Why would Square inheriting from Rectangle be problematic if we override the SetWidth and SetHeight methods?

If a Square is a type of Rectangle, than why can't a Square inherit from a Rectangle? Or why is it a bad design? I have heard people say: If you made Square derive from Rectangle, then a Square should be usable anywhere you expect a…
user793468
  • 1,373
124
votes
16 answers

When is unit testing inappropriate or unnecessary?

It seems to be generally assumed (on Stack Overflow at least) that there should always be unit tests, and they should be kept up to date. But I suspect the programmers making these assertions work on different kinds of projects from me - they work…
123
votes
5 answers

What's the difference between using dependency injection with a container and using a service locator?

I understand that directly instantiating dependencies inside a class is considered bad practise. This makes sense as doing so tightly couples everything which in turn makes testing very hard. Almost all the frameworks I've come across seem to favour…
tom6025222
  • 1,004
123
votes
12 answers

Why are multiple programming languages used in the development of one product or piece of software?

I am a recent grad student aiming to start my Master's in Computer Science. I have come across multiple open source projects that really intrigue me and encourage me to contribute to them (CloudStack, OpenStack, moby, and Kubernetes to name a few).…
Parth Patel
  • 1,029
123
votes
4 answers

When to use a Parser Combinator? When to use a Parser Generator?

I've taken a deep dive into the world of parsers recently, wanting to create my own programming language. However, I found out that there exist two somewhat different approaches of writing parsers: Parser Generators and Parser…
Qqwy
  • 4,799
  • 5
  • 32
  • 45
123
votes
15 answers

Should I fully parenthesize expressions or rely on precedence rules?

Let's say I have a boolean condition a AND b OR c AND d and I'm using a language where AND has a higher order of operation precedence than OR. I could write this line of code: If (a AND b) OR (c AND d) Then ... But really, that's equivalent to: If…
Jeff B
  • 838
  • 2
  • 9
  • 14
123
votes
9 answers

Am I too young to burn out?

I feel like I have burned out, even though I am only out of college for 5 years. For the first 3 years of my career, things were going awesome. I was never anything special in school, but I felt special at my company. Looking back, I could tell that…
123
votes
21 answers

Is there a way to combat Sales perpetually overcommitting?

I seem to be repeatedly stuck in a situation where release dates are set not based on anything technical, but because someone in Sales has committed to a customer by then. Based on discussions with friends in development at other companies, the…
Shawn D.
  • 1,361
  • 1
  • 12
  • 14
123
votes
36 answers

Programming with ADD/ADHD

I have diagnosed ADD. Mild but enough to affect my work: Easily distracted Can't concentrate on one project at a time Addicted to the web Procrastination etc. What strategies do you use to compensate? One clarification I have real ADD. I was…
lamcro
  • 1,421
  • 2
  • 12
  • 14
122
votes
8 answers

RESTful API. Should I be returning the object that was created / updated?

I'm designing a RESTful web service using WebApi and was wondering what HTTP responses and response bodies to return when updating / creating objects. For example I can use the POST method to send some JSON to the web service and then create an…
iswinky
  • 1,323
122
votes
4 answers

Which way are downstream and upstream services?

For a system that consist of multiple services calling each other (e.g. Front End -> Backend -> Storage), I often heard people using terminology such as "downstream" or "upstream" services. I'm not clear which direction these mean. Data flows in…
user69715
  • 1,329
121
votes
19 answers

What is the point of unit tests?

I've been a software developer for 20+ years, although it's been an unusual career. I've mostly worked on either legacy projects, or small standalone, non-public-facing apps and so only a couple of times has it been mandated by my employer to…
Edwardo
  • 947
121
votes
8 answers

How exactly should unit tests be written without mocking extensively?

As I understand, the point of unit tests is to test units of code in isolation. This means, that: They should not break by any unrelated code change elsewhere in the codebase. Only one unit test should break by a bug in the tested unit, as opposed…
Alex Lomia
  • 1,311
121
votes
5 answers

What are the advantages of using branching as a solo developer?

First off, I am aware that many questions have been asked about VCS as a solo developer, but they are often too broad. This concerns only branching, and still it has been marked as a duplicate...the supposed duplicate is, again, marked as another…