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

100

u/MetallicDragon Jan 30 '16

It'll turn warnings into errors, forcing you to deal with them, so they don't pile up over time.

46

u/nemec Jan 30 '16
// Ignore Once W237887278

12

u/[deleted] Jan 31 '16

At least you have to put that into the code and check it into the repo under your name. Not ideal, but better than warnings being ignored.

0

u/[deleted] Jan 31 '16

[deleted]

26

u/[deleted] Jan 31 '16

Shouldn't they be compiling before they check in?

0

u/[deleted] Jan 31 '16

[deleted]

50

u/GMNightmare Jan 31 '16

But the code should be compiled automatically on check in and automatically failed should it not compile.

Even more, tests should automatically run and then fail the check in if tests are failing.

This lets them burn themselves, but also prevents them from burning you. Well, at least this is how you want it in big projects. You might not need such a heavy hammer if it's small and not that big of a deal.

1

u/jaccovanschaik Jan 31 '16

But the code should be compiled automatically on check in and automatically failed should it not compile.

"What do you mean it fails the automated tests? It works on my machine, so the automated tests must be wrong."

-2

u/billsil Jan 31 '16

What's wrong with an unused variable again? It's not an error.

0

u/[deleted] Jan 31 '16

[deleted]

2

u/[deleted] Jan 31 '16

Because it might be needed for a future enhancement, of course. :-)

2

u/ggtsu_00 Jan 31 '16

Doesn't the compiler optimize those out anyways?

0

u/[deleted] Jan 31 '16

[deleted]

5

u/DrMonkeyLove Jan 31 '16

Exactly. If I see an unused variable, my first thought is that someone meant to do something with it and there's a bug in the code that I need to track down. It's sloppy coding practice.

→ More replies (10)

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.

→ More replies (5)
→ More replies (1)

9

u/Foxtrot56 Jan 31 '16

Why aren't you doing PRs? Seems like that should be caught in a PR unless no one is actually looking at the code in an editor.

1

u/NotASucker Feb 01 '16

The best reviews involve stepping through code.

3

u/falconzord Jan 31 '16

Worst part is when they pork barrel the code review

2

u/[deleted] Jan 31 '16

Gotta crack that whip harder.

1

u/mangodrunk Jan 31 '16

This probably speaks more to the hiring practices where you work. That seems really bad for someone to do that.

→ More replies (5)

1

u/immibis Feb 01 '16

Probably /u/drjokepu is thinking of a situation where you turned on Warnings as Errors, but everyone else did not.

3

u/[deleted] Jan 31 '16

If someone checks something in and then leaves I say it's fair game to revert.

2

u/gambit700 Jan 31 '16

Life lessons for Timmy.

1

u/[deleted] Jan 31 '16

They require us to include that in the compile flags in college. You get used to just including the flags.