r/AskProgramming • • Jun 19 '22

Other Why is programming so cognitively expensive?

So I run my own SaaS, I code 36-40 hours/week typically.

But after a few weeks of doing this, I almost always crash and my brain is fried.

And then I'll need to take anywhere from 3-7 days off just to recover and restart the cycle.

It's not like I'm having much fun either on those off days, you'd think I can go hike or surf or do something fun, but no I'm mentally exhausted -- sometimes even taking a shower or doing laundry is an uphill battle.

All I can do is sit on a couch and watch Netflix reruns.

Mentally that's all I can do.

Is this just me, or is programming really so mentally exhausting?

How do you guys do this sustainably over years and even decades?

78 Upvotes

29 comments sorted by

View all comments

65

u/A_Philosophical_Cat Jun 19 '22

To answer the title question, I think it's pretty obvious: Programming is abstract problem solving in it's purest form. We're constantly using and abusing a part of our brain that originally evolved to let us be slightly better hunters and gatherers via planning, and pushing it to its logical extreme. No wonder it's exhausting.

To answer the actual question of the post, work less. If you're actually putting in 36-40 hours a week of actual programming time, you're doing at least twice, if not twice again more programming than the typical full time job demands. Most SWE I know (myself included) spend maybe 15 hours a week programming, about that same amount doing random documentation and sometimes sales support type stuff, and a combination of either pretending or not even pretending to work the other 10 hours in a full-time work week.

0

u/[deleted] Jun 19 '22

[deleted]

0

u/[deleted] Jun 19 '22

[deleted]

2

u/NiceTerm Jun 20 '22

Programming is just as hard. With maths you need to be much more rigorous, but in programming, you are dealing with a function that looks like runtime behavior = f(x1, x2, ... x10^50) in terms of free variables. And not all of them well defined. x180293982473 is the API timeout you get because some network packets were dropped. The programmer tries to tame that super function with all sort of things - the compiler, types, exception handling and so on. And that is the 'getting it to work' layer. What about user expectations. Bug vs. expected behaviour. And then the deadline. Do we say to mathematicians, break down proving fermats last theorem into small JIRA tickets and then estimate each one. Chase them up if one of those tickets takes longer. And we need that initial estimate before the end of the day, and you need to stick to that plan you come up with.

Also one you 'deploy' a mathematical theorem, well I guess it gets peer reviewed. But if there is anything wrong will you have to immediately drop the other theorem you are working on, switch context in seconds, and then fix the problems otherwise your boss loses a million dollars or whatever.

I think the meta that comes with programming more than makes up for the lower rigour level compared to mathematics.