ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Originally posted by MadCactus I was wondering how do hardcore hackers manage to develop the endurance and concentration to sit for long hours in front of the screen and still produce good code?
I mean you hear of legendary 20 hour + sessions but I can only manage 3 or so hours at a time (with breaks).
So how long can you code for, and what tricks do you employ to keep your concentration up?
It really depends on what you are coding, there are some projects that just draw you in. If you imagine, someone working on a project they do not care that much about (for example, your own version of something you have written just to write it) does not really have that much inclination to work, whereas someone getting the first device driver working for a product they want to use has a lot more impetus behind them. It is also to do with concentration spans, many coders `zone' when they get into a piece of code - I can read good code (or bad code if you have to fix it) for more than 3 hours, let alone programming it. Quite often the really large sessions are not the programmer sitting there constantly typing code: there may be other programmers physically present, there may be IRC, he may be reading reference/documentation or planning out data structures and algorithms. One of the biggest problems is distractions - I have noticed that a lot of programmers who are heavily into GUI (I am a console junkie, thought I could throw a dig in ) tend to waste a lot of time trying to make their environment look more pretty and get distracted by other applications much more easily.
i dont know how you develop endurance, i just tend to get drawn into the problem, you start to code it, in what seems like 30-60 minutes later you finish whichever bit you are working on and you realise 6 or 7 hours have just gone by, thats how it seems to me, if its a problem im getting stuck with or finding difficult i take the dogs for a walk or go and watch a bit of tv.
i donno i usually have to drag myself to bed when i see the sun coming up.. but that's when im hackin away on stuff that interests me(which is about all i study ). but there is a point, at least for me, after 9-10 hours where my brain goes mushy. i start looking at statements like printf and i forget what they are - THAT is when i get up and stay away from my comp for the rest of the night
caffeine and beer...lots of caffeine, lots of beer.
Assorted junk food in convenient packages also help
I miss weekend deathmarches with my old partner trying to finish a contract for Monday morning...on friday I'd have a neat and somewhat tidy room...by monday it would be a warzone of beer, pizza boxes and coffee cups.
Basically in my opinion, there's no developping endurance, you either have it or you don't. If you find you are forcing yourself to sit a few hours and work on code...then maybe either coding or working on that particular code isn't really for you. If you are stuck and you have to do it, then you need to use some time management skills so you can do small stretches.
Myself, when I'm interested, I'm not thinking about how long I have to sit at the screen...I just end up looking out the window and seeing the dawn...usually a few days later. Although this happens a LOT less since I moved in with my gf....I get a lot less coding done
If it's a project you don't particularly want to spend 5+ hours coding for, then good luck but you should have planned better to get those 5+ hours in smaller chunks across a larger timeframe. If it's a project you love, sometimes you end up just coding for 8 hours or more simply because you keep progressing. I don't think you can force a code marathon which will produce good code, but many try.
Lots of background activity helps me. I find that a momentary distraction for a TV commercial or such will keep me recharged so I don't have to take longer breaks. It makes coding at my nice quiet work a pain though.
most of the time, the work i do in a few hours, sometimes does not get done for days. i haven't figured out my problem, but it usually is because i may not know exactly what i have to be doing. if i start working on things that i came up with, things get done reasonably fast, and i dont have a problem sitting long hours, and sometimes i dont even get up (and when i do, i am told i have a glazed look which is sometimes mistaken to be the results of other leisure-time activities). but there are times when i have to work on something told to me by someone else, and i may not exactly know how to go about it, and they are either not too keen or indifferent or it's something small/old for them - then it's a drag.
i pretty much make do without anything (audio/visual) and music on the headphones doesnt help, although it seems to keep others (and their voices) away.
Basically in my opinion, there's no developping endurance, you either have it or you don't. If you find you are forcing yourself to sit a few hours and work on code...then maybe either coding or working on that particular code isn't really for you.
Damn I suppose i'm just a coding lightweight... Having said that though anything i've worked on has been for practice, i've never really worked on an original, worthwhile project. Just as soon as i've remembered evrything I forgot at Uni, i'll make a start on something fresh
Originally posted by MadCactus Damn I suppose i'm just a coding lightweight... Having said that though anything i've worked on has been for practice, i've never really worked on an original, worthwhile project. Just as soon as i've remembered evrything I forgot at Uni, i'll make a start on something fresh
Well I hope I didn't put you off or down
What I meant was that there's no trick...no developping the "endurance" that's mentionned. You have it or you don't.
It varies from project to project...I'm a systems analyst and I do a lot of coding too around here but I find that its hard to sit 4-5 hours straight doing COBOL code. I can't do it.
But the other day a friend and I just finished up his whitepaper on a C++ project for a linux app and I got to start coding a bit....well I went 9 hours and didn't even notice!
Then there's the obligations...I mean, if a $5000 contract is due and the paycheck's on the line, the it doesn't matter if you like it or not, its gotta be done...but I'll tell you, then I notice EVERY minute and its a struggle...but that's part of being a professional I guess.
The last is why I stopped doing contracts...it was VERY lucrative a few years ago for my spare time...but it just wasn't worth the stress and hassles collecting anymore.
For me it depends on the interest in the project. On projects I have to do and am not interested in (school), I can go for a couple of hours, but on my own projects, where I have heavy interest, I code for hours. I did 14 hours on a project last year. That one is my record. When I am getting things working, and learning new things, I have trouble stopping. It is usually, as infamous41md put it. When I forget what printf does, it is time to quit.
I smoke lottsa weed as i code unlike alkyhol (someone mentioned beer) weed doesnt make you stupid so its a good choice to allow you to maintain your endurance and focus your concentration for longer amounts of time. insted of forcing you to think slowly and require you to spend lottsa time. weed can make you think around problems in a stranger-than-usual way. you can end up with really, really efficient programs (although you can also end up with a massive chunk of code nobody else can work with.)
Well, for me the problem is NOT sitting there for 20 hours. I set goals for myself, like "ok, I'm going to bed by 2am", then it becomes "ok, I'm going to bed by 5am", then it becomes "well, it's 9am, so I might as well stay up the rest of the day..." A while back I accidentally sat and coded for 24h straight, only getting up to use the bathroom and bring a snack or drink back to my computer (no stimulants or drugs either). It helps to have OCD and to have a self-perpetuating mind. Of course, I can't code on "school nights" because any coding within 6 hours of bed will make me dream in C++ (no joke) and I won't sleep for another week.
PS Also I have my alternate interest like philosophy, psychology (cognition in particular), and exercising. These are different enough from coding that they all throw off my perception so that I see things that I didn't see before (works the other way around also).