Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Anybody else have coding "in-jokes"?  (Read 3650 times)

0 Members and 1 Guest are viewing this topic.
Anybody else have coding "in-jokes"?
« on: May 08, 2010, 03:10:39 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Let's face it, we all like to amuse ourselves when doing tasks like programming. And we all have a style and notation system of some description. I, for example, got called 'weird' by my teacher for beginning all my private variable names with _pv_, but it helps me keep things separate so...yeah ^^

Another thing I'm betting is lots of us have some kind of in-joke or habit we repeat...My main one is when I'm documenting my code (via Doxygen's notation) and want to add a warning, and actual the description of the warning is only one or two words, or the unsafe nature of the code is obvious from the name/description, I sometimes add "Crazy, Loopy and Unbritish" to the end.

/*! \brief Get the naked pointer the smart pointer is wrapped around
 *
 * \warning Crazy, Loopy and Unbritish
 */
Type* NakedPointer();

That kind of thing. Anybody else do this kind of thing? =P
« Last Edit: May 08, 2010, 05:06:51 pm by TheDarkJay »
Logged

DJvenom

super-sage
Re: Anybody else have coding "in-jokes"?
« Reply #1 on: May 08, 2010, 03:33:00 pm »
  • Colbydude was here.
  • *
  • Reputation: +7/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2898
I don't use ;'s at all.
Logged
I do art
I ermmm... DID do art
I do art
Re: Anybody else have coding "in-jokes"?
« Reply #2 on: May 08, 2010, 04:06:10 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
Not really much to it, but I've always put "// Goodnight" right before the line to close the program is.
Logged
  • https://colbydude.com
Re: Anybody else have coding "in-jokes"?
« Reply #3 on: May 08, 2010, 06:39:40 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I don't really have a joke comments

I, for example, got called 'weird' by my teacher for beginning all my private variable names with _pv_, but it helps me keep things separate so...yeah ^^
Looks like a small form of hungarian notation. I use it also sometimes when I get completely lost in my code.

Other things I use to make sense of my code is to make exit comments like:

// exit function_name
// exit class_name

And when an if/switch statement or a loop gets to long, then I repeat the start again

// exit if( exp )
// exit switch( exp )
// exit for(...)
Logged
Re: Anybody else have coding "in-jokes"?
« Reply #4 on: May 08, 2010, 07:44:49 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Yeah, I think most programmers will use Hungarian notation or something very similar...at least in the C languages ^^ Except of course in circumstances where it's not desired...Using it in function decelerations has always struck me as pointless and more counter-productive than productive.

_pv_ also helps me speed up with autocomplete since you can type _pv_ and see every private variable in the class ^^ Plus _pv_ just screams "private" to me XD

Clever hacks that are hard to explain, read and/or understand but work (like the Fast inverse square root) I'll comment with something like MAGIC!!! which pretty much means "It works. Let's just leave it at that..."...
« Last Edit: May 08, 2010, 07:49:00 pm by TheDarkJay »
Logged

Xiphirx

wat
Re: Anybody else have coding "in-jokes"?
« Reply #5 on: May 08, 2010, 08:30:53 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
I have some very oddly named variables in my current project.
Code: [Select]
hurr = 0;
durr = 0;

they are actually used... I don't even remember when I named them that :P

I also like to put a //here wherever I stop programming.
Logged
  • For The Swarm

Antidote

>.>
Re: Anybody else have coding "in-jokes"?
« Reply #6 on: May 08, 2010, 08:40:16 pm »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
i have a QPushButton object named blarg.

Code: [Select]
        QPushButton* blarg = new QPushButton;
        blarg->setText("Save");
        blarg->setParent(m_tabRoomProperties);
Logged
  • Axiomatic Data Laboratories
Re: Anybody else have coding "in-jokes"?
« Reply #7 on: May 08, 2010, 09:39:23 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
I have some very oddly named variables in my current project.
Code: [Select]
hurr = 0;
durr = 0;

they are actually used... I don't even remember when I named them that :P

I also like to put a //here wherever I stop programming.
That reminds me. When I have a variable that I do not know what exactly to use it for or when I cannot come up with a decent name for the variable or function yet, I have the tendency to use Bob.
Logged

Mamoruanime

@Mamoruanime
Re: Anybody else have coding "in-jokes"?
« Reply #8 on: May 10, 2010, 02:27:52 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I don't do that because it gets a bit confusing in the long run. I try to stay as intrinsic and uniform as I can when I'm coding.

I do however leave somewhat humorous messages when I have to comment out a chunk of code that's become obsolete.
Logged
Re: Anybody else have coding "in-jokes"?
« Reply #9 on: May 11, 2010, 07:36:16 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Owh yeh, got lots of these. My source code is usually littered with random messages and jokes.
Logged

DJvenom

super-sage
Re: Anybody else have coding "in-jokes"?
« Reply #10 on: May 11, 2010, 09:34:54 am »
  • Colbydude was here.
  • *
  • Reputation: +7/-0
  • Offline Offline
  • Gender: Female
  • Posts: 2898
I also name my random variables pretty much whatever weird word I'm thinking about, or has to do with I'm coding.

Example:
Code: [Select]
burbin=offset
offset=burk.offset
if burbin>offset { shadow-=0.01 }
else
if burbin<offset { shadow+=0.01 }
That has to do with a weapon bobbing up and down and displaying a shadow.
Logged
I do art
I ermmm... DID do art
I do art
Re: Anybody else have coding "in-jokes"?
« Reply #11 on: May 14, 2010, 12:12:55 am »
  • Modrill made the avatar. I command you to like it.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1159
Personally, if something was really stressful to code or come up with, I would write a sentence fragment about it... Like "Jeez, this was crazy" or something.

Sometimes, if I feel like the outcome of something is going be simply amazing, I write about it too, like "and this is THE ONE" or something.
Logged




My Brawl FC is 1289-8196-4511. Don't expect me to be on all the time though.
  • Super Smash Karts
Re: Anybody else have coding "in-jokes"?
« Reply #12 on: June 18, 2010, 08:42:04 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
I usually throw this into all of my projects' main/WinMain functions since I've started playing with C++0x:

Code: [Select]
// ... main()...
[](){}(); // C++0x Check! :D
// ... main()...

>.>

Other than that, I don't really have any coding oddities. Also, Jay, it's not all that strange to have a specific way of marking private member variables - though I follow the more standard use of m_variableName (m_ followed by camel-case naming) for private/protected members. :P
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Anybody else have coding "in-jokes"?
« Reply #13 on: June 18, 2010, 11:14:28 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I know, personally my main method is like this:

Followed by camel case:
_pv_ = private variable
_ = protected variable, never use them for some reason
_spv = static private variable
__s = static protected variable, never use them really

Followed by Class names (Camel case except beginning with a capital)
I = interface
SI = static interface (i.e provides access to static variables or a singleton)
B = base class (i.e usable by itself in some form, but mostly intended to be inherited from. Rarely used I admit but...)
C = a class (durr)

I never mark global variables because I never use them. Not differentiating between protected and private variables is why I started using the _pv_ and _ instead of m_.
« Last Edit: June 18, 2010, 11:32:25 pm by TheDarkJay »
Logged
Re: Anybody else have coding "in-jokes"?
« Reply #14 on: June 18, 2010, 11:35:54 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
I know, personally my main method is like this:

Followed by camel case:
_pv_ = private variable
_ = protected variable, never use them for some reason
_spv = static private variable
__s = static protected variable, never use them really

Followed by Class names (Camel case except beginning with a capital)
I = interface
SI = static interface (i.e provides access to static variables or a singleton)
B = base class (i.e usable by itself in some form, but mostly intended to be inherited from. Rarely used I admit but...)
C = a class (durr)

I never mark global variables because I never use them. Not differentiating between protected and private variables is why I started using the _pv_ and _ instead of m_.
Ew, Hungarian Notation. <.<

I stopped using it because every modern IDE will be able to tell you the type of a specified variable, member or otherwise, which makes things so much less of a pain in the ass, because now I don't have to prefix my variables with five different characters meaning five different things. ;)

I use protected variables a lot more often with ZEngine (my current in-progress engine) than I ever have before. There's no real need to differentiate between the two - the only difference being that private members variables aren't directly available to subclassed objects, whereas protected member variables are. I note my static and const variables just the same, but I capitalize the first letter of the actual variable name/descriptor. As far as classes go, I used to prefix them with CClassName, but I stopped doing that and instead opted to stick with using namespaces. Makes things so much easier to deal with - although I do prefix interface classes (all of which I make pure-virtual) with an I, however.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Anybody else have coding "in-jokes"?
« Reply #15 on: June 19, 2010, 12:05:30 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I mostly do it for the autocompletion, really. By typing _pv_ it instantly eliminates everything but the private variables of the class. Having the autocompletion sorted alphabetically into sections just feels neater too, ya know? :P

The n for integers, f for floating points, p for pointers etc. is also reminder for me, on top of nice to have all of them grouped alphabetically by ac, because even if the IDE tells me the type; if all I want to make is a quick glance through a function it just helps :P

The amount of times I forget a variable name and go
"Hmm, now I know it's an integer and private so... _pv_n ah, there it is"

The I/C/B/SI layout helps me keep things organised in my mind more than anything else. Wanna limit the amount of times I have to open the class or my half-baked design plan file, so anything which acts as a quick reminder helps XD I don't always make what I mark as an interface pure virtual though because.

Of course, both of us will have to abandon our ways if we get involved in team professional projects XD They always have an agreed-upon notation system :p
« Last Edit: June 19, 2010, 12:11:00 am by TheDarkJay »
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.068 seconds with 70 queries.

anything