[Site Home] [Forum Home] [Articles] [File DB] [News Archives]

Programming -> fun with programming comments


(View original topic)


Furball - Oct-10-2004 server time
Hehe, that's true. We always tend to find the "Easy route" out of things. And for that program with tons of variables, that was just one time. That was before I knew what arrays were for tongue.gif. I don't get caught with that one anymore (Or so I think). Yes, caffeine is very good for programming. I was wired the night I had 3 A & W root beers. It was almost like a "Sugar" hangover the next morning (Or should I say afternoon). tongue.gif

wtd - Oct-09-2004 server time
QUOTE (Furball @ Oct 8 2004, 10:48 PM)
I have a knack for debugging. My programs have to be solved before I go to sleep. One time, I was working on a bug at 12 am. I finished it at 3 am and looked at the time. Then I said: "HOW DID THAT HAPPEN?!!" I have to have my programs incredibly stable as well. I can't have any runtime errors due to things the user does. That's why 80% of my variables are strings em320.gif. I tend to take string values and convert them into numbers for extra durable programs. Oh, and I comment like nuts. I've learned from my mistakes. Ever program something with 100+ variables, take a two month break from it, then return and FORGET what all the variable are? Man, that made me angry. banghead.gif

That's what caffeine is for. If you still sleep then that means you're not working hard enough. wink.gif

As for having hundreds of variables...

Break things down into functions. If you have that many variables it's a sure sign that you're not breaking big problems down into small problems, and that means you're working too hard. The really good programmers work really hard at being lazy. smile.gif

Red Squirrel - Oct-08-2004 server time
I've been so attached to php that I completly disregarded C++. I'm trying to get back in C++ but it's just so much more tedious then php. php has a nice organized syntax like C++, but it has better functions, MUCH better variable handling. There's no limit to how much data is in a string, there's no difference between a char, int etc... php treats it all as text.

But if you want to do math, it will do it too, it will consider numbers, but as a string. So you can even ad alphabet with it, it's pretty neat.

so A + A = B AB + AA = CB etc... (something like that).

And as far as I know the number limit is near 210000000 which is much higher then the one in C++. (+-32000 or something like that)

After coding allot, when I close my eyes I see the code, and see it so clearly I can make out the different colors of the syntax highlighting of my text editor. em320.gif

Furball - Oct-08-2004 server time
Hehehe, it's funny actually. I don't usually dream at night because I am a very deep sleeper, but when I used to program till 3 in the morning, I would dream up a solution to the problem and, by God, it actually worked! It's weird actually. So if you think about it, I actually program in my sleep as well ohmy.gif . Kind of spooky. Darn, I should really start programming again. I haven't programmed in about a 6 months. As soon as I started learning java, I kind of lost my love for programming. Oh, and I don't have a lot of time to program either anymore sad.gif. Ya, kind of sucks. Too bad, I had some nifty dos games. 16 colors and everything tongue.gif. All the graphics drawn by hand. I made a re-creation of frogger called "Roadrage Frog" just for fun. Pretty cool actually but it was soo good that the compiler wasn't even able to accept it. If I compiled, the EXE would be defective. Kind of sad when you program a nice game and cannot compile it successfully sad.gif.

Red Squirrel - Oct-08-2004 server time
Yep I'm like that too. If something does not work and I can't figure it out, then I can't sleep, since I try to think what could be causing the problem. So it must be fixed before bed. em320.gif

Furball - Oct-08-2004 server time
I have a knack for debugging. My programs have to be solved before I go to sleep. One time, I was working on a bug at 12 am. I finished it at 3 am and looked at the time. Then I said: "HOW DID THAT HAPPEN?!!" I have to have my programs incredibly stable as well. I can't have any runtime errors due to things the user does. That's why 80% of my variables are strings em320.gif. I tend to take string values and convert them into numbers for extra durable programs. Oh, and I comment like nuts. I've learned from my mistakes. Ever program something with 100+ variables, take a two month break from it, then return and FORGET what all the variable are? Man, that made me angry. banghead.gif

Red Squirrel - Oct-08-2004 server time
HAHAHA. True I'm like that too. I have to pee but it takes me so long to actually decide to get up, and omg turn my head away from the screen ohmy.gif to then go. em320.gif

I tend to get overly excited when I'm programming something and everything is going super good. It can be scarry sometimes. Especially security related stuff, I have some kind of fetish for security. em320.gif

Furball - Oct-08-2004 server time
Oh heck ya. I always put weird comments in my programs. If I find one in one of my programs, I'll post it. I remember once I had a list of things to do and I put "GO TO THE BATHROOM" as one of them. Which was actually a good thing to put there 'cause I had programmed for 7 hours straight and I had to pee after 5 hours (You know how it is when ur on a roll). I'll have to look through my programs for that. Unfortunately, I lost most of my good programs when I gave away my computer. Note to self, never trust a floppy sad.gifsad.gif.

Red Squirrel - Oct-08-2004 server time
Gota love funny comments found in code, or making some.

My latest is in a new module I'm making for the site's security system, after a cookie has been detected.

CODE

//if we made it here, it means we are already logged in
//(or that someone made their own cookie to try and exploit the script - they'll get wacked later...)
//...So we authenticate the session hash.


Sometimes funny comments make it easier to move around in large scripts/programs since they tend to be harder to forget. em320.gif

Anyone else here like me and like to put funny and/or weird comments? em320.gif

I'm the same with html. You'll find rather interesting stuff if you look at the end of the source for the forum. roflmao.gif

(Showing 50 last posts, newest on top)