It's not torture though, its a fight. Your mind is lying to you. Right now, you're not in control of your attention, and your mind doesn't want to give up that control. It's a mutiny! And you'll enjoy being the captain!
>Ok, but the problem is, _which_ book?
It seems you're a beginner programmer; you could do worse than "Eloquent JavaScript":
https://www.alibris.com/booksearch?mtype=B&keyword=eloquent+...
The tricky part is that you'll want to do some exercises, which means turning on the computer, which means a risk of distraction. Go ahead and turn off the network when you're not using it; you can also modify your hosts file (look it up) to "uninstall" distraction sites by redirecting their name to 127.0.0.1.
You may also want documentation while offline. You can do this by following the instructions here: https://developer.mozilla.org/en-US/plus/docs/features/offli...