3 ms·
Yes I use blank lines. On a related note though, there's a lot of code in my current work project, and my previous one, where people separate every function de
by Ogre 16y ago
Yes I use blank lines.
On a related note though, there's a lot of code in my current work project, and my previous one, where people separate every function definition with a comment line like
//==========================================================
Some files even have two lines like that between every function. It drives me nuts, in a minor way. I don't feel like I've ever had a problem seeing where functions begin and end, so I don't understand the point of those comments.
We have a coding standard document, and there's nothing in there about doing this, yet there are several slightly different styles of it than people seem to have picked up independently. Is this a game industry quirk? Is it common elsewhere? When did it start, and WHY?
Emacs can be set up (with Cedet) to draw lines between functions without any comments needed (so no wasted space either). I've had that on before too just to see if it changed my mind, but no, I don't like that either. But at least if everyone's IDE would do that, it could be a personal preference.
- deleted 16y ago[deleted]
- zach 16y agoI know what you're talking about pretty well (I used a macro to generate those things). I always figured it was a trace of a more rigorous documentary scheme used for automatically generating scripting documentation or something. Like once you get used to seeing them, you want them between every function, or if you start writing a function you always start with the hedgerows. Not sure. I hadn't seen those specifically at other developers, but I had seen a row of slashes between functions at a couple of other PC developers. I don't recall seeing them with console folks, though.
- Ogre 16y agoMy background and current project are PC-centric, but there are some folks here who came from console development who have that style too. And yeah, the instance where there are two lines of this are actually lines of slashes, the line of = is just one of several versions. I do remember some old IDE (Metroworks on Mac? I barely used it) would recognize a particular comment style like this and create a kind of table of contents dropdown list, using these to break the list into sections. But putting them between every function would have removed the value in that too.
- zach 16y agoThat's right, the line of == is just in the engine stuff, wasn't it? The tools guys always do slashes for their Doxygen stuff. I remember seeing the == when I worked on Daikatana, but now that I think of it, it was in the Quake 2 source between sections. So actually I guess that does explain things... I never saw it in console work but that was all pre-Xbox. The Xbox was much, much nicer to program on than the GameCube or PS2 because it was all integrated into Developer Studio and fast instead of in some crazy flaky debugger. So a lot of places went to Xbox as their primary development console. As a result, I presume many recent console programmers are much less divergent from the PC-centric world anyway.