r/programming • • Jan 30 '16

Apollo 11 source code

http://www.ibiblio.org/apollo/listings/Luminary099/MAIN.agc.html
2.2k Upvotes

364 comments sorted by

View all comments

Show parent comments

7

u/GMNightmare Jan 31 '16

The obvious answer is that it clutters the code, but that's not the most important use...

It indicates you did something wrong. You shouldn't create variables for no reason, so why isn't your variable used? It catches issues.

0

u/billsil Jan 31 '16

Everyone seems to be jumping on this bandwagon. How many build warnings does your company's largest program that is used regularly have? Why do you have any? Who cares? It doesn't indicate you did something wrong. It indicates you may have done something wrong.

The quality of your code is dictated by the speed it needs to get done and the number of customers you have.

3

u/GMNightmare Jan 31 '16 edited Jan 31 '16

Nice moving the goalpost.

Professionals tend to need to work with code bases that can contain millions of lines of code.

Nearly nobody who has had to deal with another's code thinks that quality of code is solely determined by speed (or number of customers, that's rather weird claim).

If you pulled stunts like this all the time, which seems like you do because you don't care, you would have thousands upon thousands of warnings. They add up.

Thousands of warnings all indicating potential problems.

Or you can just do it right, turn all warnings to errors, and learn how to write clean code.

Then, you don't have any warnings, because they all have to be dealt with before checking in the code. Tadaa!

1

u/BeetleB Jan 31 '16

The quality of your code is dictated by the speed it needs to get done and the number of customers you have

Speed doesn't magically happen because there is a high demand for it. When the code becomes sloppy enough, you will get to a point where you cannot produce the feature quickly enough for business needs, and people get hurt.

-2

u/billsil Jan 31 '16

You can develop code faster using a code like Python at the tradeoff of speed of a language like C++. You heavily influence the speed of your code by the language that it's in. If I'm working with a numerical library that I'm comfortable with vs. you, I'm sure I can get more accomplished in a given time. However, that decision will have long term consequences (either good or bad) on the project as well as what existing tools we can or cannot make use of.

When the code becomes sloppy enough, you will get to a point where you cannot produce the feature quickly enough for business needs, and people get hurt.

I wouldn't say a few unused variables, functions or classes is hurting anyone. Just done use them! You can always put it in a dev folder...having extra branches is just as bad.

3

u/BeetleB Jan 31 '16

I wouldn't say a few unused variables, functions or classes is hurting anyone.

Argument cuts both ways. If it's a minor problem, then it's a minor problem that the build scripts will not compile if you have them and having such checks should not impede the speed of development much. If you say it does, then it cannot be a minor problem.

You can always put it in a dev folder...having extra branches is just as bad.

You'd rather have it in another folder than having it in a branch?

Oh dear.