Programming Warm Ups? 84
ResHippie asks: "No athlete or musician would think about just diving in to the day's activity without doing some series of warm ups first. Aside from starting most computing sessions with checking email and the like, I pretty much try to dive right in to the task at hand. It usually takes me a while to get going, though. Does anyone have any routines they go through before coding (or any other work-like activity) that helps?"
Re:Yea... (Score:2)
LOL. The moderator is a 'tard.
coffee (Score:5, Informative)
THEN the new code.
Re:coffee (Score:1)
funny? (Score:3, Funny)
Then again, taking a break from coding and reading the other replies: everyone else seems to be answering humorously, so maybe I can save my ego by saying:
of course I don't really do any of that, heh heh... that would be silly... I mean, coding is hard and I... Hey - look over there - the Matrix!!
Re:coffee (Score:5, Funny)
Re:coffee (Score:3, Funny)
I'd say in a given week I probably only do about fifteen minutes of real, actual, work.
The Obvious (Score:2)
Re:The Obvious (Score:4, Insightful)
My routine when I really, really need to bust out some hardcore code is
Get caffeine in my system. A big glass of ice tea consumed while I am fixing myself the second, bigger glass that I will drink on at the keyboard.
Fire up the computer.
While that is firing up, rinse my face in the bathroom sink, hot water - really hot. As my face warms up, make it hotter. With the face oils on my hands, run them under water that is as hot as I can stand without pulling them out. Two or three minutes between face and hands.
Log into my system.
Put in my ear plugs.
(Here is the important part)
Don't start a browser session.
Don't open my email client.
Don't sign in to instant messenger.
Don't check voicemail.
Don't start the Kazaa client.
No slashdot, no hotmail, no work related emails, no fark.com, no cnn.com, no tom's hardware, no ebay, no techbargains
If you follow that formula, the inertia will be to get into the zone and stay in the zone (no distractions via phone, email, IM, whatever.) In fact if success isn't optional, I have been known to unplug my machine from the network, insuring that I couldn't fire up and of the distractions 'just for a second' even if so inclined. Get some serious work done, though.
Re:The Obvious (Score:2)
success is never optional.
Re:The Obvious (Score:2)
Check some web sites (Score:3, Interesting)
Re:Check some web sites (Score:2)
The usual (Score:5, Insightful)
Read Email
Read Slashdot
Actually, the best way I've found to get into the zone is to leave a compiltation error from the previous day. It is the mental equivalent of a stack pointer from which you can pop all of your registers, reinitialize the idle process, and start cranking.
example
BadObject b = iterator.next();
Yes, I work in Java. Compiler will shout about bad object types, and I'm off.
Re:The usual (Score:3, Funny)
2. Read Email
3. Read Slashdot
4.
5. Profit!
Re:The usual (Score:2)
Isn't this a rather bad idea? What if you add something and somehow miss what you added, killing 30 minutes of your day tracking down the problem? What if something else goes wrong somehow? (Strange shit happens, says the Mikey-San, half-1337 IT worker.)
Re:The usual (Score:2)
Re:The usual (Score:1)
I do that too; I put an XXX at any unfinished bits. It's visible, and you can search for it.
Re:The usual (Score:2)
You start your day by searching for XXX?
Re:The usual (Score:1)
Warm-Ups? (Score:5, Funny)
I don't know, five years at a University?
Re:Warm-Ups? (Score:3, Funny)
My routine (Score:3, Funny)
0830: alarm goes off
0840: actually get out of bed
0842: start brewing coffee
0844: pour cup of coffee before it's actually ready
0845 (optional): small scream as I pour hot coffee on my hands since I haven't opened my eyes yet
0846: go out on deck with copy of whatever magazine is closest to hand (generally some ancient copy of Linux Journal). Smoke cigarette, drink coffee
0859: come back in
0900: log onto computer and check for emails from co-workers
0901: quick scan through various mailing lists for security alerts and the like
0903: try to remember what I was working on yesterday when I called it a day and get back onto it
Re:My routine (Score:2)
Depending on your coffee maker, I discovered a trick to saving time with this...
Have your cup ready, with milk and sugar (or whatever you use in your coffee, personally I like a single ice-cube so I don't need to wait for it to cool) already in it.
Fill the pot with water, and place the coffee in the brewing basket.
Place your cup under the brewing basket, and dump the water into the appropriate spot on your machine.
Poof, instant cup of coffee. Ju
Start the coffee maker... (Score:1)
Gradual warm ups (Score:5, Funny)
I usually start the day's coding session with a slow progression of vocal cord exercises that simulate what will be done later in the day.
Start with simple cursing. "Dammit. I can't believe I left that variable uninitialized." Then gradually build your way up to more intense grumbling, being careful not to overstrain your vocal cords. "Holy crap that goddamn idiot Jack still didn't fix that bug? That was a week ago! What does that fat sack of shit do all day long?" From loud complaining you work your way into loud yelling and screaming. "Fuck you, MSVC++! Don't tell me 'internal compiler error'! What the fuck kind of shit is this! You goddamn cocksucker! Fuck you Gates! Yeah, fuck you!" Now that your blood temperature has raised a few degrees, you can begin doing whole-body exercises. Jump up and down and scream "Fuck! Fuck! Fuck! There's no error there you shithead compiler! That's perfectly legal C++! Just compile it you fuck!" Then pick up your monitor and pretend to throw it against the wall. Start gradually at first, eventually working into really whipping your torso around. This will make sure you down strain any ligaments in your lower back when you finally do snap and start trashing your computer.
Remember people, safety first!
GMD
Re:Gradual warm ups (Score:1)
Speed (Score:1, Interesting)
Lots and lots of methamphetamine.
'nuf said.
Space out (Score:5, Funny)
Bob Slydell: If you would, would you walk us through a typical day, for you?
Peter Gibbons: Yeah.
Bob Slydell: Great.
Peter Gibbons: Well, I generally come in at least fifteen minutes late, ah, I use the side door--that way Lumbergh can't see me, heh--after that I sorta space out for an hour.
Bob Porter: Da-uh? Space out?
Peter Gibbons: Yeah, I just stare at my desk, but it looks like I'm working. I do that for probably another hour after lunch too, I'd say in a given week I probably only do about fifteen minutes of real, actual, work.
Warm ups for the entire body (Score:5, Funny)
Make sure to do exercises for each part of your body:
Hope that helps,
GMD
make test (Score:1)
Then, the next morning... I run a "make test"
Fixing the failed test usually gets me back into the flow. If not, I write more tests.
If that doesn't get the juices flowing... I write docs and refactor code.
Python (Score:5, Interesting)
A lot of Coffee and Cigarettes. (Score:1)
Use the product (Score:2)
When writing a l
Advice for writers (Score:5, Informative)
When you're being really productive towards the end of the day, stop before you're finished. Then you'll have something easy to start with at the beginning of the next day.
Re:Advice for writers (Score:1)
Re:Advice for writers (Score:3, Interesting)
I think it's usually easier to code one block (a complex method, a class or something else) to finish if I have time. If you've trouble getting on the right track the next morning, I'd suggest code reviewing previous day's changes. Do a diff -u and think why you did write that code yesterday. If you cannot figure out, then there must be
Deep Hack Mode? (Score:2)
Perhaps, but if you're (finally) in Deep Hack Mode, you shouldn't stop - I reckon.
zRe:Deep Hack Mode? (Score:1, Redundant)
Of course not!
If one's in HE-MAN 48-hour Programming-Blitz(tm), then stopping means losing some of that perfect code, right?
-shudder-
sorry, I couldn't resist that, but the concept is actually getting-at the difference between a good session and a good continuum, and the good continuum is more, long-term productive than are a couple of good sessions.
Some can easily work that way, some can't, though, and some won't validly try that, so..
Also, Deep Hack Mode doesn't stop being productive just because
Re:my routine (Score:1)
NOTE: This is acceptable only when working away from supervision
Keep the beer handy and get started. Think about it, try to do it. If it just comes crapping out, finish it and turn it in. If it doesn't come, keep working, but start drinking. Keep trying to be logical. It may get frustrating, but keep thinking about the whole problem and trying to write solutions. At some point, you'll start making progress or be forced to tempo
error logs and a fresh compile (Score:1)
I recommend the opposite. (Score:2)
Re:I recommend the opposite. (Score:2)
Re:I recommend the opposite. (Score:1)
Re:Ma maaaan (Score:2)
Re:Ma maaaan (Score:1)
Typical mood (Score:1)
Re:Typical mood (Score:1)
Re:Typical mood (Score:1)
From the Good Dr.... (Score:3, Funny)
Thompson's complete answer: "Booze and speed."
Re:From the Good Dr.... (Score:1)
Start? (Score:1)
Start away from computer (Score:2, Interesting)
I find that starting with paper and ink is a good way to get the juices flowing. If you have a bug from a previous day write out a solution on paper, nothing serious, just jot down some notes on it, or ideas.
If you don't have something specific then I generally do as someone else mentioned and test a few things; if I find there's something broken put it on paper.
For me there's just something about flowing ink and flowing ideas. Overall I think finding small issues (if lucky) to work on at first is good
Exercise (Score:5, Insightful)
That, or coffee.
booting up (Score:1)
Kata (Score:3, Informative)
little annoyances first (Score:5, Informative)
If you can't leave your development tools in a specific state between coding sessions (ie, if you are required to or prefer to shut down compilers, editors, IDEs, and the like when not in use), then, as others have suggested, leave a syntactical error at a key location which will clue you in to where you were mentally (this is not so much warm up as a token to make the process faster next time around). Even if you don't shut your tools down, it's nice to have a quick description of what you were working on before to continue from. I often will write down a couple of key phrases on a piece of paper or yellow sticky (eg, "check interaction between reduncancy check and precomputation" or "examine compute_latency() output to be sure each event is valid") left on my keyboard.
Now, to really answer the question, I don't think anyone does any mental exercises to warm up. I also don't think they're necessary -- most of the posted answers, including mine, deal with preparing your environment for work, not yourself. The most common exception to this is ingesting caffeine -- and this is well-known to initially have a sharpening effect on cognitive ability. The most difficult part of doing hard coding is recovering the mental state, and while not exactly preparation for coding, it's the biggest step when resuming an earlier coding session, and many other posters have given good tips.
Re:little annoyances first (Score:2)
Logic game (Score:4, Interesting)
Instead, I load up the project, create remote sessions, etc. -- whatever I need to do the job -- take a look at the specific thing I need to work on, then background the whole thing and bring up some kind of logic game. Lately, it's been Bejeweled Deluxe.
I've discovered that a logic game puts me into the right frame of mind while simultaneously letting me "mull over" the work I'm about to do. I stay away from reflex-oriented games, or those involving words; they make me concentrate too closely on the game. By the time I've played a game or two I've already thought of several ways to attack the coding problem at hand, and I can get started.
typespeed (Score:2)
--Robert
I usually (Score:1)
Think. Read. Eat. (Score:3, Interesting)
Before programming, thinking has a proven effect on the outcome of your endavour. I have programmed computers for about half my life (started at 15 and turned 31 last year), and thinking seems paramount when considering what to do before actually coding. It is amazing to see how many forget this basic rule of thumb [google.com].
Next, read books [amazon.com] and standards [ietf.org] . Not knowing that your problem has been (partly) solved already or can be solved better is a sure path to theeth-grinding reinventions of the wheel.
Then, when you're really set to start coding (after thinking for half a day, reading a book and three standards), eat. Real food.
Coffee & Excercise (Score:2)
Oh, yeah, I keep a large cup of coffee and a larger bottle of water next to me while I excercise.
I usually do my stretches first, then weapon practise in the backyard, then go through all my katas and sparring techniques....
Kung fu does wonderful things for the mind and body. All the physical and mental value of Yoga but about 10 times more fun.
Stonewolf
Plan your day the day before (Score:1)
CS Project Warmup: For COllege Purposes (Score:1)
When the project first comes out I look at it and determine how long it will take me. Then that night i drink precisly 2 Old English 40's (no more, no less) and determine how long it will take to do while drunk. Then i turn on some Techno and attempt to start coding. Once i forget the name of the file i close it and go play q3 or starcraft (starcraft has to be the best drunk game ever). This continues for a few more days while i have all of the files cr
GET TO WORK! (Score:1)
Online Comics (Score:1)