Most Popular

1500 questions
95
votes
15 answers

Should we design our code from the beginning to enable unit testing?

There's a debate going on in our team at the moment as to whether modifying code design to allow unit testing is a code smell, or to what extent it can be done without being a code smell. This has come about because we're only just starting to put…
Lee
  • 1,101
95
votes
11 answers

In code reviews, should the reviewer always present a solution for issues?

When reviewing code, I normally try to make specific recommendations on how to resolve the issues. But owing to the limited time one can spend for reviewing, this does not always work well. In these cases I find it more efficient if the developer…
Frank Puffer
  • 6,429
95
votes
7 answers

How do microservice system architectures avoid network bottlenecks?

I've been reading a lot about microservice architectures for server applications, and have been wondering how the internal network usage is not a bottleneck or a significant disadvantage compared to a monolith architecture. For the sake of…
James Mishra
  • 1,509
95
votes
10 answers

How and why to decide between naming methods with "get" and "find" prefixes

I always have trouble figuring out if I should name a certain method starting with getSomething versus findSomething. The problem resides in creating helpers for poorly designed APIs. This usually occurs when getting data from an object, which…
knownasilya
  • 3,194
  • 3
  • 17
  • 16
95
votes
4 answers

Differences between TypeScript and Dart

Microsoft recently unveiled Typescript, a new JavaScript-like programming language. Some time ago, I heard about Dart, a new programming language created by Google to solve problems related to Javascript like performance, scalability, etc.. The…
margabit
  • 1,266
95
votes
13 answers

What's the difference between syntax and semantics?

I've always thought that referring to the syntax of a language was the same as referring to the semantics of a language. But I've been informed that apparently that's not the case. What's the difference?
gsgx
  • 1,797
  • 3
  • 17
  • 17
94
votes
27 answers

Why do people use programming books?

I find that when someone asks what is the best way to learn how to program, people usually provide them with references to a bunch texts written by various authors. However I don't believe many people at all learn to program from books. I find that…
94
votes
11 answers

Why should main() be short?

I've been programming for over 9 years, and according to the advice of my first programming teacher, I always keep my main() function extremely short. At first I had no idea why. I just obeyed without understanding, much to the delight of my…
riwalk
  • 7,680
94
votes
11 answers

git for personal (one-man) projects. Overkill?

I know, and use, two version control systems: Subversion and git. Subversion, as of now, gets used for personal projects where I am the only developer and git gets used for open source projects and projects where I believe others will also work on…
Anto
  • 11,187
  • 13
  • 68
  • 103
94
votes
7 answers

What is the difference between these senior software engineer titles?

I'm currently a senior research software engineer at a large company and am being offered a "senior staff engineer" position somewhere else. I am not sure if the new position's title conveys a sideways move or an advancement. So, all other things…
94
votes
14 answers

How can I avoid always feeling like if I completely rebuilt my program from scratch I'd do it much better?

I have learned a significant amount of coding, however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been ... messy. I've…
Ashish
  • 359
94
votes
4 answers

What belongs in an HTTP request header vs the request body?

I'm working on a set of web services for a mobile client, and the requirements call for a unique device id to be included with all requests, to be stored in certain requests, and used to filter results in others. A suggestion was made that it be…
Mike Partridge
  • 6,647
  • 1
  • 25
  • 39
94
votes
9 answers

Over thinking development

I've been working as an app developer for a year and a half now (not long I know), and I've just been given my first big project. Needless to say it didn't go very smoothly, so I sought advice from a senior programmer involved in the project about…
sf13579
  • 1,060
94
votes
5 answers

for vs. foreach vs. LINQ

When I write code in Visual Studio, ReSharper (God bless it!) often suggests me to change my old-school for loop in the more compact foreach form. And often, when I accept this change, ReSharper goes a step forward, and suggests me to change it…
beccoblu
  • 1,041
94
votes
8 answers

Is modern C++ replacing C#? Is Microsoft pushing developers to adopt C++?

I hear about modern C++ popularity and some talks about migrating back to C++ from C# or other C-like languages. I know about C++11 features but I would like to hear your experiences, especially from developers who migrated from C# to C++. More…
Amir Karimi
  • 1,222