
Fasting & Programming - mccarthyjm
http://www.mahdiyusuf.com/post/28530166837/fasting-programming
======
sambeau
As (a non-religious) someone who tried fasting while holding down a similar
job, my advice is simple: don't break your fast every night.

It only takes 24-48 hours for your body to adjust, your fat to start melting
and your blood-sugar levels to stabilise. You also stop feeling hungry. I
found that while I was generally a little 'light-headed' my powers of
concentration were fine and I returned to full productivity.

At first I tried drinking only fruit juice but that gave me an upset stomach
so I switched to water and the occasional tea. Once I'd got through the first
day of 'starving' hunger I felt great: full of energy and positivity.

As long as you have fat on your body you should be fine, however I'm not sure
it would be a good idea if you are all muscle: while shutting down your
digestive system saves a load of energy, if you have no fat your body it will
convert muscle.

Pros:

    
    
      * No blood sugar swings
      * No hunger
      * Fat loss
      * A real sense of achievement
    

Cons:

    
    
      * Greasy skin
      * Zits
    

Do:

    
    
      * Keep exercising to prevent muscle loss
      * Drink lots of liquid
      * Eat something light if the starving hunger returns
      * Be careful if you are already very skinny
      * Talk to a doctor
    

Don't:

    
    
      * Binge eat every night as you'll feel starving again the next day
      * Ignore a return to hunger
      * Drink lots of fruit juice
      * Binge at the end. Gradually introduce food back to your system.

~~~
nsxwolf
This was probably very common in the human experience prior to the development
of agriculture. People didn't eat regular meals. Hunting opportunities would
not have come along every day, and sometimes hunts would fail.

I don't think humans would become too weak to throw spears because they didn't
have their Cheerios in the morning.

When I hear people who have skipped a meal complain "my blood sugar is low", I
worry for their health. We have fat stores for a reason. Skipping a meal
should not be a big deal.

~~~
manmal
You are mistaken if you think that hunting was the primary source of food in
times before agriculture. For many tribes it was (and still is, in some parts
of the world) a secondary "luxury" which augmented the gathered food. As you
say, hunting can easily fail, or game can become rare because of environmental
hiccups. This happens more often than you should think - there are times when
deer can't be found for weeks. Blood sugar was mainly kept up with berries,
roots, and fruit - nibbling all day long. Fat stores are not so easily
accessed - if they were, then all-week-fasting would be the way to go for fat-
loss (which mostly leads to muscle wasting and short-term water loss, and a
mighty yo-yo effect). Yes, one can use intermittent fasting to lose weight,
but weight-loss usually only kicks in after 2-3 weeks.

I agree that Cheerios are a bad idea generally, but I'm not pro fasting or
skipping meals for weight loss. Fat is stored as an emergency reaction to high
blood sugar levels, and you get exactly that when eating more between the
fasts (you have to). You constantly expose your brain to too much and too low
sugar levels, resulting in highs and lows in your ability to focus (and also
your mood).

~~~
_pius
_Yes, one can use intermittent fasting to lose weight, but weight-loss usually
only kicks in after 2-3 weeks._

Citation needed. I personally know people who've lost weight long term with
quite brief periods of intermittent fasting.

~~~
pessimizer
I think he's saying after 2-3 weeks of intermittent fasting, not fasting for
2-3 weeks at a time intermittently.

Anecdote alert, but I started doing alternate day fasting after I read the
study, then 22 hour a day fasts after I read that people were having results
with that. Went from 235 to 185 in 2 years (6' tall, fairly large build.) I'm
not strict, and I go off it whenever I'm bored or severely tempted.

I count any drink other than water as a snack, and watch the bread, potatoes,
and cornstuffs when I am eating. Who knew it could be this easy? I hadn't
really been an overeater for years, I just had never had time to starve.

~~~
_pius
_I think he's saying after 2-3 weeks of intermittent fasting, not fasting for
2-3 weeks at a time intermittently._

Yup, I got that and I'm challenging it.

~~~
pessimizer
Just making sure.

~~~
_pius
Thanks for the anecdote, by the way, very interesting.

------
jezclaremurugan
I am currently working in Saudi Arabia (here, fasting is a _national rule_ ,
however I eat because I'm a Indian and non-Muslim) as a programmer, and I've
noticed one funny thing - people just become nocturnal. They eat and work in
the night and sleep during the day. This is simply the normal routine
reversed. Fasting has minimal effects on them, its not fasting, just the time
in which they eat is changed! They work shorter during the day and do the hard
work in the night.

~~~
ramblerman
Humans are funny creatures. To believe on the one hand a god laid down these
rules, and then in the same thought think "Well I bet he didn't think of this
loophole"

~~~
lrs
I remember having this same thought when I learned about the existence of
"Islamic finance." Apparently, Islam has a strong doctrinal prohibition
against charging interest, and there's an entire thriving sector of Islamic
law and business dedicated to structuring transactions in ways that don't
technically charge interest but still yield a return on principal.
<http://en.wikipedia.org/wiki/Islamic_banking>

This reminds me of a little kid beating up his classmates on the playground
being told by the playground monitor to stop touching them, and then turning
around going back to tormenting them by starting to punch them and stopping
just short of making actual contact, and saying "neener neener, I'm not
actually touching you." Except here, instead of a playground monitor,
it's...an omnipotent creator deity.

~~~
jacques_chester
My understanding is that a generous portion of Rabbinic legal theory is about
tapdancing around the Mosaic law.

Because most observant jews would not, I can only assume, want their children
to be stoned to death for giving them a bit of cheek. Or have to be beaten up
because they shaved. And so on.

What strikes me odd about biblical law is how little of it is devoted to
elucidating the big questions. Such as: what about the corner cases to the Ten
Commandments? Is killing in a war forbidden? What about self-defence? And so
on.

------
quasistar
While the author of the linked article expiates the hit coding performance can
take when fasting I have personally observed an interesting phenomena during
my observation of Ramadan. Namely, I can experience moments of acute lucidity
and penetrating insight into a problem at hand.

Usually this occurs when I am in the midst of something that requires a good
bit of effort such as tackling a thorny algorithmic conundrum or analyzing a
particularly complex call stack. If I attune my mind to repress the pangs of
bodily need I occasionally feel as if the external world melts away and I slip
into an almost mystical state of oneness with the task at hand. Needless to
say, I have been surprised immensely by this development.

One theory I have is that the blood flow that would normally be assigned by my
body to the act of digestion is now free'd up to be reallocated to the ole
cranium. Plausible? Unsure, but am certainly enjoying these life experiments!

Side note: for those observing the fast I have also noticed that my immune
system is closely linked with the gut and my self-imposed starvations can lead
to immune system compromise. Make sure you supplement your Iftar goodies with
some replenishing nutrients such as pro-biotic yogurt smoothies rich in
vitamin C and home-cooked chicken consomme.

~~~
pronesmk
I also tend to notice an increase in my productivity and ability to focus
during Ramadan. A good breakfast is essential, I usually stick to yogurt,
granola and vegetable juice - say my prayers then head back to sleep for a
couple hours. I can't say I'm not hungry when 820 rolls around but I don't
find the month debilitating and most of the time my co-workers don't realize
I'm fasting until it's almost over.

------
paperwork
Very interesting, my experience has been slightly different this year.

Normally my brain is thinking 10 different things at one time. It is fairly
difficult for me to focus (more so since I work at an office that has 5 TVs
that I can see, and a couple of channels I can hear). The first few days of
fasting, I was surprised how easily I was able to focus. Frankly I was far
more productive than I normally am. Unfortunately, I've since reverted to the
natural state of affairs -- I can no longer tune out TVs, youtube clips, etc.

In previous years, the first few days would actually be extremely difficult. I
now realize that I was getting what is often called the "carb flu." This year,
before Ramadan, I was on a low carb diet (Tim Ferriss' Slow Carb). Perhaps
because of that, my body was already used to fewer carbs.

Hunger is not debilitating and if I could have water, I could probably 'fast'
for 48 hours pretty easily (such fasting is actually recommended by the likes
of "East Stop Eat" author Brad Pilon).

~~~
tejaswiy
> Normally my brain is thinking 10 different things at one time. It is fairly
> difficult for me to focus (more so since I work at an office that has 5 TVs
> that I can see, and a couple of channels I can hear).

I think a part of the reason why programmers prefer working late hours (late
as in after 12 in the night) is that the brain is sufficiently tired as to not
be able to jump all over the place. You'd focus on one thing : Your code.

~~~
enqk
Or you think you are focusing on code, and just are too tired to notice
context-switches or general slowness.

~~~
ralfn
The illusion of productivity can actually increase productivity.

The feeling of gettings things done motivates. Even when that feeling is an
illusion.

So what if it actually took 4 hours: if it feels like 30 minute, its easy to
invest another "30 minutes".

~~~
ralfn
@latch

Yes. I believe it helps with motivation, which for some people, like myself
for example, is often the bottleneck of productivity.

Off course, others may have more intrinsic motivation, or just more
discipline.

But if you are lazy like me, it helps a lot. Whenever i reach that point, i
get into a zone, and just keep going and going. Im not working better, or more
effectively, im just more motivated, and end up investing more time and
effort.

------
vimalg2
I've been trying one of the more popular Intermittent fasting protocols
-Leangains for 20 days and counting. It was uncomfortable only for the first 3
days.

16-20hr (well-hydrated) fasts ended with a heavy lifting workout and BIG meal
at 'breakfast' (6pm or later for me). FAQ: <http://examine.com/leangains-faq/>

I love it.

Increased alertness, focus, no more mid-day food comas. I'm a fat guy, so my
body is probably fat-adapted after a couple weeks of IF.

And i work at my ghetto standing desk from 9 to 5 weekdays.

I can't imagine living any other way now. It's wonderful not to be a slave to
food. I see food as just fuel now.

Note: I do take 10g of BCAAs before lifting heavy fasted. There is evidence
that they prevent catabolism of muscle.

~~~
boothead
Any figures on how your body composition has changed over that time?

~~~
vimalg2
I don't have the resources to properly estimate and track BF%.

However, i've been tracking my waistline measurement every other day after
doing my morning business and fasted. I seem to have lost 2cm since starting 3
weeks ago.

I'm inclined to not take this 'loss' that seriously because the consensus is
that IF takes about 3-4 weeks to really start showing results.

On the other hand, i know i'm metabolizing fat; family members have been
complaining of my new acetone breath. (ketosis!)

------
alinajaf
(Disclaimer: I'm a militant atheist now) I think I would find stopping five
times a day for prayer to be a bit of a distraction, though I imagine the
short bursts of meditation would be good for my concentration overall.

I tended to gain weight during Ramadan, but that's probably because my family
made a big deal of every iftar, inviting extended family members, eating out
and having big greasy Pakistani meals almost every night. I'm somewhat
convinced that the type of food in my family would go towards explaining the
early 60s life expectancy. Thankfully I married Japanese so I'm hoping that
cancels it out!

I found fasting to be generally easy, even in quite long days in Saudi Arabia.
Rather than hunger it was more the habit of snacking as a reaction to it that
catches you out. The main tactic we had for dealing with it was (as much as
possible) sleeping during the day and working at night, though I imagine you'd
need a very understanding employer (or sufficient litigation) to pull that off
as a full-time dev.

~~~
AjithAntony
> I would find stopping five times a day for prayer to be a bit of a
> distraction

(Disclaimer: Not a muslim)

I think that is exactly what the prayers are for. They remind you that the
only thing that matters in this life is submitting to God and to thank Him for
His blessings.

------
gwern
> Let’s just say fasting isn’t one of them. All of my co-workers; I have
> worked with past and present have been extremely understanding and
> respectful of the [month-long] fast. Also as a by-product of this kindness
> they have coined the term: "Ramadan code".

If I were an employer, after reading this...

~~~
irahul
> If I were an employer, after reading this...

There isn't much you can do; at least you can't make religious fasting the
reason for your actions unless you are interested in lawsuits and tons of
negative publicity.

What does it take to start a new religion? What if I start a new religion
which says working more than 4 hours a day is against my gods? Can employers
deny me jobs? Or if they don't deny it, are they bound to pay me full salary
even though I work half the hours? If not, why am I being discriminated
against when you are accommodating others(prayers 5 times a day, month long
fasts, pregnancy etc).

~~~
alinajaf
> What does it take to start a new religion? What if I start a new religion
> which says working more than 4 hours a day is against my gods?

It would be somewhat easier to just start your own company if you wanted to
work four hours a day. Though with a good marketing department, some cold
reading and a truthy sounding manifesto I'm guessing you could probably pull
it off if you wanted to.

> prayers 5 times a day, month long fasts,

IME, not many muslims outside muslim countries actually pray five times a day,
and as demonstrated by this thread the ones that fast seem to do as much as
possible to align their religious obligations with their employers interests.

> pregnancy

Why is this a problem? Would this extend to paternity too? It doesn't really
count as discrimination in my book, as barring any social or biological
obstacles in your path, applicable to you should you choose to have children.

If I were a full-time employee and by implication not independently wealthy, I
would expect an employer to fund some time off to deal with babymaking. I
think this is one of the primary benefits of being a full-time employee
(especially since as I'm a consultant now, it costs five figures in potential
fees to take two months off).

~~~
irahul
> It would be somewhat easier to just start your own company if you wanted to
> work four hours a day.

I do own my own company, and I work more than 4 hours a day. Let's say my
religion permits working 2 jobs regardless of state laws(they permit multiple
wives, multiple husbands. What's the big deal with multiple jobs), but you can
work for more than 4 hours only for your company.

Let me try this:

 _The lord sayeth thou shall not work more than 4 hours; except for the
company you have more than 35% stake in._

> IME, not many muslims outside muslim countries actually pray five times a
> day,

That's not the point. The thing is you are allowed to do so, and the employer
doesn't have a say.

EDIT: So let's assume my religion is an exclusive one, and there is only one
member - me. Does that mean I should be allowed to work 4 hours a day, come in
drunk etc. because only a few people(exactly 1) does that; or else I shout
_persecution_ and give my life savings to a legal team.

> pregnancy >> Why is this a problem?

Sorry about that. That was my failed attempt at political correctness. My
examples were particularly about Islam, and I thought I should include
something non-Islam.

------
Killah911
I suffer mainly from the caffine withdrawal. But this is good in a sense. By
the end of Ramadan, I typically rid my system of a lot of junk that I'm used
to putting into my body. Also, the effects of "performance enhancing"
chemicals not being there also means you just have to work harder at what you
do. While this may be hard in the beginning, it gets much better as time goes
on.

Despite all of this, I know all about Ramadan code. After 5pm my blood sugar
drops low enough that I can barely write a line of code without introducing
serious bugs or typos. So, I try to get most of the coding done in the
morning.

~~~
ramblerman
Fasting is actually very healthy. Not drinking any fluids, not so much.

~~~
Killah911
I drink 3 glasses of water in the early AM meal + 1 glass of milk and then 4-6
glasses in the evening. I even fit in a light workout before breaking fast in
the evening. So, dehydration isn't too much of a issue (at least if you're
working indoors).

------
sharjeel
On the other hand, I find myself a lot more focused and productive in Ramadan.

Knowing that I'm not supposed to eat or drink, I don't have to think every
other hour what should I gulp down my stomach. This is a distraction which is
a bit difficult to get rid of in normal days.

Also, meal timings become strict which automatically instills disciplines. In
normal routine I would adjust the meals by few hours just to get some part of
code done. Having such flexibility also allows some buffer to visit Social
Media or Hacker News. However with empty stomach, one stays relatively bound
to complete the work rather than procrastinating.

~~~
mishmax
EXACTLY my thoughts. The reduction of snacking distractions and washroom
breaks has always been a productivity boon for me in Ramadan. Nothing to do
but pray and code. I love it.

------
jperras
There is quite a lot of science and study behind fasting, and it can actually
be good for your health. I say this as someone who does a caloric fast (read:
no caloric intake at all, fluids allowed) 6-7 times a week for intervals of
16-20 hours, in addition to my 3x weekly heavy weightlifting programme and my
full-time job as a programmer/devops.

As of right now I'm the healthiest I've ever been in my life (physical
strength and cardiovascular health), and my mind is as sharp as ever,
_especially_ when I'm fasting.

~~~
primodemus
Could you detail your diet and exercise routine? I'm new to intermittent
fasting and could use a little bit of advise.

~~~
jperras
Sure. It's incredibly simple, even if there are a lot of concepts to grasp.

Diet:

The macro-nutrient decomposition I tend to follow can be calculated for your
bodyweight, height and level of physical activity here:
<http://www.1percentedge.com/ifcalc/> . Note that your level of physical
activity is most likely sedentary, even if you plan on exercising. The higher
levels are for people who have physically demanding day jobs. The rest/workout
split toggle in the top left of the "Macro Calculator" tab will give you
different total caloric requirements based on if you want to
gain/lose/maintain weight. Remember: a ~500kcal/day deficit from your TDEE
(total daily energy expenditure) translates to losing 1 lb/week, and vice
versa for a caloric surplus. You can play around with the 4th tab to see what
goes on.

The tl;dr version of this calculator is basically: eat more carbohydrates on
workout days, and eat more fats on rest days. Eat 1g of protein per lb of
body-mass on all days, and try to hit your daily caloric goals on all days.

Meal Timing:

Here's a typical day for me:

    
    
        * 6:30am. Wake up. Do morning things.
        * 7:15am. Take 10g of BCAAs with water, 4000IU of Vitamin D, and 10ml of concentrated (high levels of EPA/DHA) fish oil.
        * 7:30am. Take public transport to gym.
        * 8:00am. Double-shot of espresso. Sometimes I skip this - I purposely cycle on/off of caffeine every few weeks.
        * 8:15am. Start exercise routine. Lift heavy things. Lasts about an hour.
        * 9:15am. Finish workout. Ingest 10g of BCAAs.
        * 9:30am to 2:00pm. Work.
        * 2:00pm. First meal of the day. No significant calories (< 50kcal) before this.
        * 6:00pm. Second meal of the day.
        * 9:00pm. End of caloric intake window.
        * 11:00pm. Bed time.
    

For rest days, I skip the BCAAs and the gym (obviously).

Of course the above isn't written in stone, and sometimes I break my own rules
by going out with friends, having a drink or two past 9pm, and so on. But you
get the general idea.

Exercise:

Lift heavy things, and perform compound movements. My exercise regime consists
of heavy squats, bench press, standing overhead press, Pendlay rows and
deadlifts. Any other exercises are incidental, and I try to avoid muscle-
isolating exercises in general.

I would highly recommend reading Starting Strength by Mark Rippetoe (even
though some disagree on his precise methodologies, it's still the best
introductory book out there), and perusing the <http://stronglifts.com> site
as well. Once you've gotten past the point where those programmes are
effective (which will take months, if not a year), there are many intermediate
to advanced compound-lift based programmes that you can switch over to.

Sorry for the long post. I could go on for ages about this stuff; it's
incredibly interesting, and is actually quite formulaic. If you eat what
you're supposed to eat and do the exercises you're supposed to do, your
desired results just... happen. Makes the scientist in me very happy ;-).

[Edit: formatting]

~~~
jacques_chester
Fittitor, I take it?

~~~
jperras
Indeed – I try to avoid the hive mind (when it isn't backed by science) and
form my own opinions, though. The great thing about personal fitness and
nutrition is that everyone has got a great laboratory at their disposal at all
times.

------
bevan
For those of you who feel clear-headed after fasting for a day or two: you
might have a delayed food allergy (google "IgG food intolerance"). The most
common such allergies are to gluten (not just coeliac sufferers are sensitive
to gluten) and dairy products. I believe these delayed-onset allergies are
fairly common in western societies, and are due to a "leaky gut", or permeable
intestinal lining, that results in an immune system response when those foods
get absorbed. Because IgG allergies can manifest themselves up to three days
after you eat the offending food, some people may never figure out the cause
of their fatigue or foggy-headedness. IgG allergies might be worth looking
into if you have those symptoms.

------
pizza
Fasting _helps_ me stay focused. I wake up at 8:30 am and have my first meal
at around 4pm-5pm, and I just don't get hungry, and the lack of blood sugar
level spikes doesn't get in my way.

~~~
rsl7
I think I have always been better when I'm slightly hungry. When I'm satiated,
I don't do much of anything.

------
HSO
IANAN (I am not a nutritionist) but I strongly suspect that the physical and
mental exhaustion is primarily related to dehydration (as Mahdi Yusuf himself
indicates by bolding "drink"). Looking at some of the comments here, the main
difference between those who describe positive experiences with fasting and
what the author describes is that the former drink water throughout the day.
In that light, let me quote from a very good article [1]:

 _A normal average human body is made of approximately 60% of water. Water is
the natural transport fluid involved in all important communication networks
of the body. Drinking a lot of water (medium to low mineralization) ensures
that the organs responsible for filtering and cleansing have sufficient
carrying capacity and can eliminate toxins and wastes. You can see the
argument as just plain good sense that we need sufficient water for dilution
of wastes. Chemists and physicists know water as a truly exceptional fluid on
many accounts. It is not by chance that life emerged and organized itself with
water. Water is the best solvent that can dissolve an astonishing number of
solid substances. Dehydration is a dominant cause of tiredness, pain and
chronic diseases. Drinking about two liters per day plays marvel to keep
energy and remove fatigue. Indeed, unknown to or often forgotten by the public
is the fact that many chronic diseases may be associated with an insufficient
intake of water. Such a simple gesture as drinking water regularly during the
day may go a long way towards avoiding fatigue and remaining healthy._

 _I emphasize drinking pure water and not sodas, cokes, processed juices,
coffees and so on. Just plain water. The drinks that are processed by agro-
business are in general provided with added sweeteners that are known to
promote malignant cell growth [Servan-Schreiber, 2009]. In addition, drinking
with sugar (glucose, saccharine) prevents the body from strengthening its
metabolic pathway of storing fat in time of surplus and burning fat
efficiently in case of need. By feeding our body continuously with sweet
drinks and sugar, we saturate our blood with sugar and we weaken considerably
the metabolic processes of storing and retrieving sugar, making us more
vulnerable to hypoglycemia in the rare cases where external sugar intakes
stop. The consequence is to easily feel weak and tired. In contrast, letting
the body be just flushed by plain water for hours ensures the build up of its
metabolic capacities to burn fat efficiently. This is like muscle build-up by
training. Art de Vany [2010] develops convincing supportive arguments for
this. He correctly argues that our body is basically inherited from our
hunter-gatherer evolution and we are thus adapted to strive in a patchy and
varying environment for which our metabolism has derived efficient solutions
to the energy flow problem. This backfires with our modern caloric and sugar
rich, but nutritionally depleted, foods that are available at little
expenditure of energy [de Vany, 2010], in the form of chronic diseases, an on-
going so-called epidemic of obesity and many other modern so-called developed
country diseases [Campbell and Campbell, 2006]._

 _For the determination of the amount of needed water, a rule of thumb is to
keep urine transparent. Do you feel a bit tired? Drink water. The effect is
almost instantaneous. I constantly keep one or two liters on my office desk
and drink when I feel like it and outside meals. I always carry water with me
on trips. A minor nuisance is to drink it all before going through airport
security._

_Of upmost importance is to drink our water outside meals. Most people use
breakfast, lunch and dinner times to fill their body with both the liquid and
solid nutrients that their bodies require. This is logical since meals are the
times when we re-fuel our body. However, this behavior constitutes a
fundamental mistake. Ponder this question: what other mammals in the whole
animal kingdom drink their water together with their solid meals? None! We are
the only one among about 5500 known mammal species who do it. The convenience
of tools and the development of technology have put bottles on our meal tables
to consume at the same time we ingest solid food. This apparent gain of
civilization collides against a healthy diet for at least three reasons:_

 _(i) Drinking lubricates and help swallow insufficiently chewed morsels; but
digestion in the stomach requires the comminution of our food into particles
that should be as minute as possible in order to maximize surface over volume
ratio and therefore facilitate the digestive chemistry performed by the
gastric secretions. This is just plain and simple good sense chemistry. When
digesting unbroken food morsels, the stomach and the whole digestive system
has to secrete more, takes more time to process our food, all this
cumulatively increasing tiredness and fatigue on the body over the long run. I
therefore recommend chewing so that you “drink your food”. Similarly, water
and liquids should stay a while in the mouth before swallowing to warm up and
mix with saliva so that you “eat your drinks”. A difficult digestion starting
in the mouth is probably significant contributor to the feeling of tiredness
after a meal._

 _(ii) Starch and other vegetable substances start their digestion with the
help of enzymes found in the saliva; lengthy chewing ensures optimal chemical
reactions with these enzymes and saves energy for the rest of the process in
the stomach and intestines._

 _(iii) Ingested fluids dilute the stomach secretions, thus hindering the
digestion process. Again, plain and simple good sense chemistry._

The article was originally written by a true scientist for his Ph.D. students.
I think the physical dangers of our work is quite similar in that programmers
and phd candidates or scientists will tend to get absorbed in front of a
screen, sit for too long at a stretch, forget about or get negligent about
food and drink, etc etc. I recommend this article.

________________________

[1] D. Sornette. Optimization of brain and life performance: Striving for
playing at the top for the long run. Schweizer Monat, pages 38–49, Dec 2011.

(I believe the article is available on Arxiv.)

~~~
no_more_death
Yes, fasting really isn't bad if you drink plenty of water. I fast and pray
semi-regularly (I'm a Christian). It is rough at first but you get into the
groove about half-way through the day. Fasting never hurt by ability to code.
Fasting sharpens sensitivity; my body kicks into "prayer" mode and I can focus
better. On the other hand, it is really hard to fast and stay up late! I
usually end up going to bed early.

~~~
etruong42
As a former wrestler, I have had very similar experiences. On days where I
could drink water, I assessed no difference in my productivity between days
that I fasted and days that I ate, except when my fasting lasted over three
days. Even then, my decline in productivity in relation to the duration with
my fasting was not very steep.

However, I found that my productivity is very strongly correlated with my
hydration, and going an entire day without water showed immediate,
significant, and negative effects. I strove to manage my time in such a way to
get all my work done without needing to spend those days programming.

------
reat2012
Hi, HN readers!

As a Christian I would like to tell you my opinion on this subject. Very often
people tend to forget that fasting differs from dieting. Hence, there are all
these advices on various "tricks" and "optimizations" :-)

What is missed here is that when you are fasting - you are not trying to
reduce your body weight or improve your mental abilities :-) In fact, the
fasting has nothing to do with you - this is done by you only to praise The
Lord, who has created you, is looking after you and forgives your sins.

And if one finds fasting too hard and starts making a shortcuts, it is better
not to fast at all - there will be no value in this "eating trickery" for you
:-) (or anyone else).

The fasting is all about God and He gives you the strength to fast - but you
need to ask Him by praying, reading The Bible, caring about your brothers and
sisters, helping other people, giving to poor. And if you find fasting too
hard - most probably you are trying to fast for wrong reason or your dieting
has nothing to do with The Lord.

Personally, when fasting four times a year, I try doing good Christian things
- helping people around me, charities, those in needs. Trying to put my own
interests even further away, making peace with enemies, asking for forgiveness
of people that I hurt somehow. Working on my project "Read and Think: The
Bible for command line people" :-)

This is what fasting is for me and these are my "special tricks" :-)

The best source to read about fasting is The Bible:

................ == THE GOSPEL ACCORDING TO SAINT MATTHEW ==
................... === Chapter 6, Verse 16 === 16 Moreover when ye fast, be
not, as the hypocrites, of a sad countenance: for they disfigure their faces,
that they may appear unto men to fast. Verily I say unto you, They have their
reward. 17 But thou, when thou fastest, anoint thine head, and wash thy face;
18 That thou appear not unto men to fast, but unto thy Father which is in
secret: and thy Father, which seeth in secret, shall reward thee openly.

Thank you,

------
jibjaba
How about life without nonsensical ancient superstitions? I am very much not
being purposefully offensive when I say that. The initial premis of needing to
fast is highly flawed when looked at rationally.

------
ramadan-fast
I know this is the complete opposite for most people, but my experience
fasting is very different. for some reason (maybe someone can help explain
why?), I find that while fasting I actually become significantly more
productive and enter a state of extreme mental lucidity. the best way I’d
describe it as is being on a high-dose of adderall (if you aren’t a regular
user), but with a clearer head.

this usually kicks-in after the second day of fasting and stays pretty
consistent throughout the month. I really feel it peak at about midway through
my conscious fast each day (about 7hrs after waking-up) and it lasts up and
through the time I eat.

I should just note that, in case someone’s thinking this, I’m pretty sure it’s
not attributed to some sort of increased spirituality or something like that
(I’m not particularly religious; more-so fast as a personal challenge and use
the opportunity as a sort of annual ‘reset’ to physical habits)

as for how my fast goes, I think it may be considered somewhat extreme
compared to others I know: beyond a fairly large iftar (dinner) at around
8:30pm I don’t really eat much else; I still keep vegan when I do eat; never
wake-up pre-dawn to eat (though I sort of subconsciously wake-up throughout
the night and drink water); and I don’t change any of my habits outside my
time fasting (i.e. still go to gym after dinner most days, still go out at
night, still drink (alcohol), still wake-up early for work, etc...)

------
stephengillie
_Don’t skip meals to save time. 5 good hours are better than 10 bad ones._

Can we apply this to sleeping too?

------
dfischer
I fast everyday. By not worrying about food while I do web-development I've
noticed not only am I less distracted and get more done, but I am also less
tired because my body isn't diverting energy to digesting food. I'd get really
sleepy after lunch usually.

I practice Intermittent Fasting. I typically fast for 16 hours and eat for 8.
I've been doing it for about a year now and I love it.

------
kanamekun
I fast regularly and if you already on a low carb diet, then the transition is
much easier on your body. I don't notice a a diminishing of mental capacity,
but I do notice that I need more sleep.

There are a lot of things you can do to prepare for a fast. For example, cut
back on caffeine, sugar and even salt in the days or weeks ahead of your fast.
Also, gorging on food the morning of a fast is not really healthy and is a
sure recipe for "Ramadan code."

There was a fantastic article on fasting in Harper's Magazine this past March
that covers the history of fasting, "Starving your way to vigor: The benefits
of an empty stomach." Sadly, you have to be a subscriber to read it online:

<http://harpers.org/archive/2012/03/0083829>

Fasting doesn't have to devastate your mental faculties. I actually find that
it helps me focus, and I have started doing it a few times a year.

------
manmal
I'm currently on Ferriss' low-carb diet and I have found constant carb-
withdrawal hard to bear on days on which I do much programming (basically
every working day). There are some tricks though which help me keep up focus:

\- MSM,

\- Caffeine (less is more - just a sip of coffee, or half a cup of green tea;
too much of it actually downs me after the first high),

\- and regular consumption of "allowed" carbs (lentils being my favourite) and
fat (peanut butter, olive oil,...). Native coconut oil is a real brain
booster, I feel super-focused after having eaten a spoonful.

MSM does really do much in this regard for me, it feels as if it's helping my
body renew its energy stores. I can go a lot further with less food when
having taken it - and I do need to take it in order to seriously lose weight.

Eating nothing for more than 4 hours shoots my focus down for hours, and is
hard to rebuild with low-carb food.

~~~
shurane
The carb withdrawal is only for like, the first week, right? Then you'll be
scot-free! Or so I thought.

~~~
count
In low-carb diets, one of the major withdrawal symptoms is actually from a
lack of sodium. Your body starts emptying it's water stores when there is no
carbohydrate intake to process (carbs need a lot of water to work with), and
that takes tons of potassium and sodium out of your body.

Eat or drink something with lots of sodium, and it should hep with the carb
withdrawal symptoms quite a bit (the 'keto flu').

------
ahmedaly
Here is my experience: I am in Egypt, and I decided to stop working at all in
Ramdan's day.. I work only during night, because its very very hot here, which
you start feel you need to drink by 11 am, and our stupid government keeps cut
electricity during the day, so we can't even use air conditioning most of the
time, because there is no electricity, and if you don't know, using air
conditioning helps so much reduce the need of water.. which is the main
problem in a very hot weather like in Egypt.

I spend all the day sleeping, and start working after Iftar.

------
rokhayakebe
HN is truly a community of many nations, cultures, religions, etc...

I changed my schedule for the past few days and it's working very well. I get
home from work at 5 or so, sleep for 1.5 hours, get up and ready myself to
break fast. Afterwards I am operational until 2AM. I eat several times during
this period and I go to sleep, waking up again at 8-9. (Yes, you guessed it, I
am still not able to make Fajr on time).

The above beats going to sleep at 11 or 12AM then waking up at 3:30 to eat
before going back to sleep.

------
sodafountan
I personally can't relate to this specific religious practice however this is
very similar to the feelings experienced when trying to quite smoking. The
second time I tried quitting smoking I was unable to concentrate on my code
which unfortunately drove me back to cigarettes for another three years. If
you're a software developer it's even harder to quit (words of advice for
anyone reading this that might be heading into college this coming fall)

------
cmaxwell
That sounds like a lot of fun. I am glad I am not religious.

I have no problem with people having the right to do this type of stuff
because I enjoy my right to laugh about it.

------
fabiandesimone
I started working out recently (about 8 weeks ago) and I'm now following this
protocol: <http://leangains.com>

My energy is up, I'm loosing weight (I work out very morning) and feeling
great. I do find that I'm having a bit of trouble concentrating, but is
getting better everyday.

If I manage to concentrate as I did before using leangains, this is by far the
best I've felt in years.

------
krmmalik
Have to say i've not suffered too much. I think it's a combination of what i
choose to eat at fasting (suhoor) time, abiphasic sleep pattern and limiting
sugar intake when breaking the fast.

I do a light sleep / nap for 2hrs at night, and then eat suhoor and make sure
i stay awake for a fixed period of time before going back to bed. i wrote a
dedicated post about this last year if anyone is interested.

------
gtirloni
I've fasted multiple times and it was straight days with only water. Never had
any problems, in fact, I've always felt much better than before. I feel serene
and can do my tasks just fine (or even better than before).

The author must be suffering from dehydration, not fasting.

------
jgrahamc
Fasting appears in many of the world's religions. I'm curious about the roots
of fasting that have been codified into religious practice. Did the ancients
discover that fasting was good for you?

~~~
icebraining
The fact that it was popular doesn't mean it was good. Bloodletting was an
extremely popular practice too, but it's now a consensus that's it's harmful
except in very specific situations.

~~~
philbarr
Although people did bloodletting because they _thought_ it was good for you.

------
everlost
In my case, it's ironic that I feel lethargic right after breaking fast
(probably due to digestive system kicking in), while the rest of the day is a
breezy peacefulness.

------
tamersalama
Fasting is a mental exercise rather than anything else.

------
tamersalama
Strangely, I usually put on more weight during Ramandan. I think it's a
combination of work/food/sleep-pattern.

~~~
irahul
> Strangely, I usually put on more weight during Ramandan.

If you are starving, your metabolism slows down to conserve energy. I assume
you eat heavy meals(high carb? sugar? oil?) when you break your fast(dinner?
before morning prayers?). Slow metabolism, coupled with high calory intake
when your body doesn't need it(if you go to bed after a heavy meal, what would
your body use the calories for?) would be the reason for the weight gain.

------
nacker
Fasting is good for your immune system as it stimulates phagocytosis. Here's a
paper on Ramadan fasting:

<http://www.ayubmed.edu.pk/JAMC/PAST/21-4/Latifynia.pdf>

An amusing book on complete fasting by vintage american novelist Upton
Sinclair here:

<http://archive.org/details/fastingcure00sinciala>

Personally, I fast regularly up to two weeks at a time, both for weight
control and because I believe in it's overall long term health benefits.

~~~
Jd
Up to two weeks at a time of a total (water only) fast? I've done this before,
but it was quite difficult to maintain in the midst of work pressures and I'm
curious to know how you manage it.

~~~
CodeMage
I'm very interested in this. I've never tried fasting before -- and I'm 33
years old, which means I've had a lot of time to get used to eating a lot --
so I imagine that I would have a feeling of "starvation" that would be awfully
distracting. Plus, I'm a bear when I'm too hungry and I wonder what I could do
to avoid taking it out on the people who surround me (especially my 5 year-old
kid).

~~~
MattJ100
I find that passes, as long as I've slept well, drunk enough (water) and am
otherwise feeling fine.

I often go all day without eating while I work, and contrary to the OP and
more in line with several of the other posters here I do find myself more
productive, able to concentrate and focus, and feeling more energetic (I know
it's counter-intuitive).

However the slightest inkling that I'm feeling worse for it, or that my
productivity is beginning to slip, I'm feeling unusually tired - I'll simply
eat. I'm not entirely sure losing much weight would be good for me (I don't
have much to lose) and I'm not trying to take things to extremes. I just side
with folk who agree that 3+ regular meals a day is not necessarily the only
healthy way to do things.

Note well that this is all simply my own experience, and I'm certain people
differ. I do this because I'm happy, comfortable and feel better for doing so
- if you try it and don't, perhaps it isn't for you. I know I wouldn't do it
if that were the case.

------
recoiledsnake
>Also another little thing. This entire blog post was written using the
dictation feature in Mountain Lion.

So that explains the mistakes in the post I was wondering about. For example:

>(not that I wouldn’t I love parks).

