Most Popular

1500 questions
132
votes
8 answers

Difference between '\n' and '\r\n'

Yes yes, I am aware that '\n' writes a newline in UNIX while for Windows there is the two character sequence: '\r\n'. All this is very nice in theory, but my question is why? Why the carriage return character is extra in Windows? If UNIX can do it…
sukhbir
  • 1,489
132
votes
7 answers

How to avoid being forked into oblivion by a more powerful contributor?

As recently reported here: Xamarin has forked Cocos2D-XNA, a 2D/3D game development framework, creating a cross-platform library that can be included in PCL projects. However the founder of the project that was forked says: The purpose of the…
Den
  • 4,847
  • 2
  • 33
  • 50
132
votes
17 answers

How does learning assembly aid in programming?

I have been programming in higher level languages (Python, C#, VBA, VB.NET) for around 10 years and I have completely zero understanding on what's going on, "under the hood." I am wondering what are the benefits of learning assembly, and how will it…
132
votes
8 answers

Why is trailing whitespace a big deal?

Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of it automatically, and many coding standards require you to eliminate all instances of it. I'm not entirely sure…
EpsilonVector
  • 10,763
131
votes
14 answers

Should the solution be as generic as possible or as specific as possible?

Say I have a entity that has "type" attribute. There could be 20+ possible types. Now I'm asked to implement something that would allow changing the type from A->B, which is the only use case. So should I implement something that allows arbitrary…
131
votes
7 answers

Clean Architecture: Use case containing the presenter or returning data?

The Clean Architecture suggests to let a use case interactor call the actual implementation of the presenter (which is injected, following the DIP) to handle the response/display. However, I see people implementing this architecture, returning the…
swahnee
  • 1,445
  • 3
  • 10
  • 5
131
votes
15 answers

Are single-character constants better than literals?

I recently encountered a class which provides pretty much every single-character as a constant; everything from COMMA to BRACKET_OPEN. Wondering whether this was necessary; I read an "article" which suggests that it may be helpful to pull…
Austin Day
  • 1,361
131
votes
11 answers

How has an increase in the complexity of systems affected successive generations of programmers?

As a "new" programmer (I first wrote a line of code in 2009), I've noticed it's relatively easy to create a program that exhibits quite complex elements today with things like .NET framework for example. Creating a visual interface, or sorting a…
Adam
  • 1,387
131
votes
10 answers

Storing a re-orderable list in a database

I'm working on a wishlist system, where users can add items to their various wishlists, and I plan to allow users to re-order the items later on. I am not really sure about the best way to go about storing this in a database while remaining fast and…
Tom Brunoli
  • 1,413
131
votes
14 answers

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 the code, it's clear that's not the case. This…
jtiger
  • 828
  • 2
  • 8
  • 11
130
votes
23 answers

Why did Git get so much hype? ...while others don't?

In the recent years, the hype around Git raised greatly. Everybody knows about Git, nobody knows about alternatives. Other ones like Mercurial seem to be unnoticed. Both have been released in 2005, and provide similar functionalities. Moreover,…
dagnelies
  • 5,465
130
votes
11 answers

Is there anything that can be done with recursion that can't be done with loops?

There are times where using recursion is better than using a loop, and times where using a loop is better than using recursion. Choosing the "right" one can save resources and/or result in fewer lines of code. Are there any cases where a task can…
Pikamander2
  • 1,269
130
votes
9 answers

The difference between "concurrent" and "parallel" execution?

What is the difference between the terms concurrent and parallel execution? I've never quite been able to grasp the distinction. The tag defines concurrency as a manner of running two processes simultaneously, but I thought parallelism was exactly…
Louis Thibault
  • 2,188
  • 3
  • 16
  • 17
130
votes
4 answers

IPv4 to IPv6. where is IPv5?

As all of us know that after IPv4 it came IPv6. How this transition happened? I just want to know was there any IPv5 also? or there is any other logic in naming this version of IP as IPv6?
Hemant
  • 1,483
130
votes
45 answers

Does giving a developer a slower development machine result in faster/more efficient code?

Suppose I give my developers a screaming fast machine. WPF-based VS2010 loads very quickly. The developer then creates a WPF or WPF/e application that runs fine on his box, but much slower in the real world. This question has two parts... 1) If I…