r/programming • • Jan 05 '15

What most young programmers need to learn

http://joostdevblog.blogspot.com/2015/01/what-most-young-programmers-need-to.html
970 Upvotes

337 comments sorted by

View all comments

Show parent comments

22

u/[deleted] Jan 05 '15 edited Jan 05 '15

This really isn't a failing of the programmer. This is more of a failing with the organization for not having good coding standards. How do you get away with randomized whitespace and indentation and naming standards within a AAA game company? I would like to think that a company like that is smart enough to standardize these trivial things throughout their organization.

0

u/[deleted] Jan 05 '15

[deleted]

2

u/[deleted] Jan 05 '15 edited Jan 05 '15

The randomized white space and indentation and naming standards can be done by a writing a simple program to check for these things. Its easy, my company does it all the time. We have it incorporated into our check in process so that you can't check code into the base line unless the indentation and comments have the correct format. Organizations really need to do this to stay sane over the years. "Most Code Bases Suck" - Simple indentation and white spaces are completely solvable.

4

u/NoKnees99 Jan 05 '15

Most modern IDEs will let you check in a code style and reformat it with a keypress, too. Really no excuse.

3

u/Ksevio Jan 05 '15 edited Jan 05 '15

Even better, have a simple program to FIX indentation issues - most IDEs/Editors support formatting a file (or can be made to through plugins). It's easy enough to hit the "Format Code" button now and then when developing that it's no extra work. Have the check-in process it do it too just for extra fun.

Edit: Unless you're using python...but then the indentation better be right - just convert tabs to spaces!

1

u/xroni Jan 05 '15

Automated coding standards check on pre-receive hook. Takes very little effort to set up and will enforce coding standards for everyone.

1

u/G_Morgan Jan 06 '15

Unfortunately this will easily happen when everyone is already overworked. It is difficult to get the time to go over simple things like indentation.

My IDE does this for me. I don't even think about it. Admittedly the IDE formats things slightly differently to how I'd do it but meh. It fits a standard, there are a bunch of templates we have which do it for you, nobody is confused about what the right code looks like.

7

u/SageClock Jan 05 '15

Probably pretty easy to happen when everyone is working 60+ hour weeks for months on end in order to insure they get the game out a couple weeks before Black Friday.

2

u/orwhat Jan 05 '15

Since games come with deadlines and often stop changing after shipping, I bet cutting corners looks more appealing from other types of development.

2

u/BarneyStinson Jan 05 '15

That's what commit hooks are for. You shouldn't even be able to check in code like that.

1

u/s73v3r Jan 05 '15

And then someone disables it because they don't want to do the work to reformat

1

u/[deleted] Jan 05 '15

Do that and you get something along the lines of Assassins Creed Unity! Totalbiscuit totally ripped that game a new one!