After figuring out the logic for the problem, while coding, have you guys experienced your thoughts wandering to some movies, songs, etc? It happens to me a lot, I make mistakes in the code, miss corner cases, etc. If yes, how do you stay focused?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
After figuring out the logic for the problem, while coding, have you guys experienced your thoughts wandering to some movies, songs, etc? It happens to me a lot, I make mistakes in the code, miss corner cases, etc. If yes, how do you stay focused?
Name |
---|
dont listen to any song or watch movie the last 2h. and go for a walk or maybee a quick shower then you will be sooo focused :)
I can relate 100% to it. 3 hours before my last contest, I had heard some old songs that I used to like in my childhood. That was disturbing me so much during contest.
But on other days, I usually listened to (no lyrics) music (usually anime OSTs) to amp up my mood before contests and they don't have any negative effects. So I think, only the lyrics are very disturbing.
I listen to porcupine tree to calm down before contests, otherwise I have just way too many thoughts normally. Btw I too like cold showers before contests. It really changes from person to person I feel, whatever works for you, you need to find it and do that.
I generally listen to songs/music during the contest, soft music can increase focus too. Link
I also experience these thoughts, sometimes. It can be especially dangerous during contests with high stakes (like olympiads). The best way to avoid these distractive thoughts is to relax and clear your mind before the contest/practice session (for example, you can try something like yoga). Before the contests, I usually take a walk outside, for a few minutes.
I have found that these kind of distraction occur when we procrastinate a lot or we are in stress or don't talk to others and remain isolated most of the time.
It's well said controlling mind is hardest thing.
I felt like a bullet shot through me when I read this :(
u might have adhd
its somewhat the other way around for me(at least it has been till now)
my thoughts wonder when trying to find the logic to harder problems but not when coding
so i guess yeah you can say this thing is kinda natural some may experience it less some more
but staying away from the media when coding or maybe even disconnecting from the internet(well of course not when your in the middle of the contest:)) can be helpful
I had this kind of problem, after some time thinking about how to solve it, i figured some things out(i have no proof for this, only that it makes sense to me and that it worked for me, everything i say is just an empirical assumption), i defined as "active thinking" the part when u are controlling the thinking, and "passive thinking" the part when u randomly wander off and think about stuff(we can argue if we are actually controlling it or not, but for the sake of this comment lets say we are) , so the problem was that i wasnt able to actively think without being interrupted by passive thinking, so i figured that those interruptions have something to do with subconsciousness(i mean, everything has something to do with subconsciousness) , because i wasnt even aware i went into passive thinking until i come back randomly to active thinking and realise i wasted time, and because i dont know any other way of controlling ur subconsciousness except by training it, i started to train my subconsciousness to remind itself to turn on active thinking(by repeating many times in my head to turn it on, while i was actively thinking of course) , and while actively thinking i was reminding myself to stay like that, and as time passed, i was getting more time in active thinking just by reminding myself constantly to not go passive thinking, i usually had a paper or something by my side that reminds me to go active thinking, and soon enough number of times i remember to turn on active thinking increased and the average time of 1 session of active thinking was much greater(so soon enough i didnt even need the paper by my side to remind me, my subconsciousness was doing its job) , other problem i had was that even when actively thinking i had thought noise that i couldnt control and wasnt able to think clearly bcs of that, so i figured i needed to learn how to control what i think, and how to turn off thinking, first i tried just turning off but it was too hard, i tried to simplify the problem, and came up with a new task, to try to imagine and focus on something else for as much time as i could, just to take my mind off that thought noise, so i picked unicorns and rainbows and tried to imagine them as long as i can and as vivid as they could be, and it was still hard, but easier than the previous version, so i trained myself by constantly trying to control and to imagine that stuff, and in the beninging i could do less than a second, and in some time(i didnt track how much it took me) i was able to imagine them as much as i could, and however i wanted, so now i was able to redirect my thinking, but i wasnt able to stop it yet, i still wanted to be able to turn off completely, so i wanted something that represented nothing to me, and i thought of a black board, it was harder to imagine it than the unicorns, but again, with training it became easy, and i started enlargening the board until its blackess was the only thing i see, and now i evolved to imagining only black nothingness, it was enough for me so i didnt try anything further, but somehow after some time of doing the "black nothingness" i became able to turn off thinking completely, without needing to imagine black nothingness, so at that point i was able to shut down the thought noise and actively think much more than usual, i have probably missed some explanations on the way and have probably left some stuff unclear, and this was a rather informal explanation with left out details of how i approached these problems because it would be too long for me to write everything down
Edit: u can generalise these ideas to solve other related problems like discipline related ones, or taming some of ur desires, or stage freight etc.
when you realise that the whole paragraph is one sentence.
u gotta do it in one breath
I experience that too, not only for coding but for every task that requires focus. When I catch myself drifting I just go back to thinking about the problem. I don't really have a way to stop myself from drifting in the first place.
As for songs, I generally listen to music during contests but I'm not actively thinking about the music most of the time.
This doesn't happen to me because I can't code while my thoughts are wandering.
Prepare a pen and a piece of paper and make as many drafts as you can on it. I've tried, and I found it very useful to stay focused :)