Taking a break in programming: the poll!

How often do you take a break when programming?

  • Every hour
  • Every two hours
  • Every 3-4 hours
  • Wait, you take breaks?

0 voters

4 Likes

Its just until I quit when I cant figure out an error

14 Likes

It depends sometimes it can be after 2 minutes of programming other times 7 hours of it, your more likely to produce better code if you feel happy while doing it

4 Likes

Same thing here lol, my automation:

if (brain.state == "🤯") {
  throw new Error("Taking a break...");
}
4 Likes
if "The meaning of life, the universe, and everything" != 42:
    raise FatigueError("Can't the perform operation in current state: paradoxical examination")
4 Likes

My brain works a little more like this:

let errs = [];

while (true) {
	if (brain.state === "🤯") {
		errs = errors.locate();
		console.log(errs.length); // x
		errors.fix(errs[0]);
		errs = errors.locate();
		console.log(errs.length); // x+1 ...
		continue /*s staring at screen cluelessly */;
	} else {
		console.log("We never make it to here lol");
		/* takes a break */ break;
	}
}
9 Likes

Breaks are for casuals. Professional programmers code ASM all day, every day.

section	.text
	global _start
_start:                     
	mov	edx, len
	mov	ecx, msg
	mov	ebx, 1
	mov	eax, 4
	int	0x80
	mov	eax, 1
	int	0x80

section	.data

msg	db	'Breaks are for casuals.',0xa
len	equ	$ - msg
4 Likes

I never quit until like 1 hour later then I would shut down my laptop and do something else, and continue the next day.

4 Likes

you shut down your laptop?

5 Likes

Fixing the error takes all of eternity for me

4 Likes

Until my PC gets a BSOD

2 Likes

My brain doesn’t work that way, where I can plan to take X number of breaks in Y amount of time. I’m just really bad at organizing things in timetables. If I try to live that way it is like inviting problems in. :upside_down_face:

I simply set myself a goal that I believe is realistic to achieve in one day, based on what I need to accomplish. If I realize that it’s not feasible to complete it in one day, I then set a more realistic goal (this happens quite often in programming when you realize that a problem is more challenging than initially thought). :face_with_monocle:

If I manage to reach my goal and there’s still time remaining, I use that time to improve my solution. In programming, there’s always something you can do to enhance code.

2 Likes

For me, I code random things, until I encounter an error, which is when I try to solve it, end up giving up because I’m bored and then I just code something else, and if I encounter an error, I just take a very short break.

So essentially:

if error == True and bored == True and errorIsUnfixable == True:
    giveUpAndCodeSomethingElse()
    if errorEncountered == True:
        takeABreak(15, ‘minutes’)
5 Likes

I don’t really take breaks because I want to but I have other things to do…

1 Like

I was trying to take a break from programming… until I saw this monstrosity:

@lambda _: _()
class _:
    def __format__(_, __):
        _.__class__._ = property(lambda _: print(__))
        return ""

def __() -> f"{_:Hello, world!}": ...

_._

And had to know how it worked

5 Likes

I’m goana pretend I don’t see that :neutral_face:

2 Likes

Wdym?

3 Likes

My brain works more like this:

for (;;) {
  const errors = [], ideas = [];
  if (errors.length) fix(errors);
  if (ideas.length) implement(ideas[0]);
  else findIdeas();
}

Edit: For loop instead of recursion.

4 Likes

Javascripter confirmed

Mine works more like:

while ideas != []:
  def doSomethingWithIdeas():
    codeIt(ideas[0])
    if not codeIsWorking:
       cryAboutIt()
       possiblyHaveMentalBreakdown()
       think("Oh wait it was just a typo")
       doSomethingWithIdeas()
    else:
       getBoredAndDoSomethingElse()
       returnToItAfterOneWeek()
       nearlyFinishIt()
       finishIt()
       ideas.pop(0)
  doSomethingWithIdeas()

Btw I think that is literally those are the ugliest and most descriptive functions I’ve ever written in my entire life…

edit fixed weird indentation
edit 2 i just realized the function was never called in the loop :no_mouth: and i “enhanced” a few other things

6 Likes

This code is not as performant though, and longer, depends on the py interpreter tho.

1 Like