BinaryCrazy's blog

By BinaryCrazy, history, 4 years ago, In English

Hi Codeforces,

I have been doing competitive programming for a little over a year now, but one thing has become clear to me — my typing & coding skills are a hinderance, but probably not in the way you are thinking of.

My typing speed is really slow (only 61 WPM), because I type sentences rather quickly, type one character wrong in the entire sentence, realize that 1 second later, and subsequently waste 2 seconds correcting it.

Because of that problems that I solve in virtual contests transform from 2 minutes to 20.

Still, that isn't the last of my worries. I occasionally make unconscious errors, leading me to spend a good 10 minutes of my time weeding through my code and write print statements until the cause is found.

As a result ... a "first" blood problem quickly transforms into a fiftieth blood problem.

I have tried to improve myself by practicing on websites such as typeracer, but my typing mistakes have not decreased, even after a month of daily practice for 30 mins.

And I have no idea how to improve writing clean code.

I would really appreciate if anyone can give me tips on how to improve these two problems (how to quickly improve, what to target).

Thank you very much for your time and help

-BC

  • Vote: I like it
  • +55
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I think you should try to type slowly but correctly. Then, when you can type every character correctly, you should try to type faster.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    I have tried that, but to no avail :(.

    Regardless of what speed I type at, the # of errors is constant.

    If I wish to type every character accurately, I have to look down at my keyboard, or rely on my chances that I will not type a sentence wrong.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      You should type a lot so that you can remember some of the letters' places on the keyboard. Then, you'll not need to look at it. If you type a wrong character, then delete all the characters after it. You shouldn't just change that character, it's slower.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it +16 Vote: I do not like it

        Okay, I will try that in the future.

        Would you happen to have any suggestions on writing clean code that has little / no error?

        Thanks

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Try musician's advice. If I ask you to hit "G" once, can you do it reliably? I hope, the answer is yes. The trick then is to make sure you know which key (and which finger) is next before you start to move your fingers. This is super-slow, but eventually you'll learn to do this for entire complex sequences. Also, you'll probably start to notice mistakes before you actually do them, because the ultimate source of mishits is you having wrong ideas about your hands movement.

      Though beware that all I've written is from my piano playing experience. Typing words doesn't have as immediate feedback loop as musical performance does. And of course, none of this will protect you from random hard-to-spot bugs (which is more about using well-known and reliable snippets and techniques in your code).

»
4 years ago, # |
  Vote: I like it -31 Vote: I do not like it

Shut up, and stop begging for contribution.

Nobody really cares about your personal namby-pambies.

The blog feature is to discuss actual problems and solutions, not just cry about your retarded typing speed and trash coding skills.

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it +18 Vote: I do not like it

    :(

    I apologize.

    • »
      »
      »
      4 years ago, # ^ |
      Rev. 2   Vote: I like it +6 Vote: I do not like it

      you don't have to apologize, many people on the platform are willing to help you. Just ignore these edgelords, they are suffering from the Dunning-Kruger effect.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +44 Vote: I do not like it

    Jeez. You sound like Um_nik with your whining, but you're not LGM so it's not funny.

    What's good about this blog?

    • It asks about advice about a genuine problem that affects CP performance, to some extent.
    • It's nicely written (formatting isn't disgusting, gives details & concerns, perfect English, etc.).
    • It actually shows an attempt to improve (practicing typing for a month) that didn't work out.
    • Most importantly, it shows effort. It wasn't just a random question thrown at us asking for us to fix all of the poster's problems.

    Would you rather see much more low-effort blogs like this? I don't see such a vicious comment by you on it.

    BinaryCrazy, please feel free to keep asking questions if necessary. Among the help blogs I regularly see on this site, yours are some of the nicest.

    With regard to your actual questions:

    I learned to type at 100+ WPM by initially staring at the keyboard for each character and developing my own (weird 3-finger) typing style. If you need to look at the keyboard to be accurate, you should. Go for accuracy first, since it's clearly holding you back, then build up speed as you get used to it.

    I think your code is clean/readable enough as is, if that's what you mean. As for mistakeless code, it may help to review your code in chunks as you write it (so write 5 lines or so, then check logic and everything, then move on and etc.). This will let you always analyze the code that's most fresh in your mind.

»
4 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Honestly I think your typing speed is okay, I have friends on my level that type ~50WPM and are still able to solve problems in a few minutes even compared to me and I type ~111WPM (yea I just had to mention that XD).
Your main problem is writing clean code.
Most times you might start coding a problem not even thinking at all and you just start coding shit and at the end spend more time debugging than writing code.
My advice for you is to think longer before you start coding.
Try to visualize the code and think of the best data structure/algorithm to solve the problem and after solving problems read codes of top participants look at how they did it and how beautifully they solved the problem.
You can also pick up a few C++/Python (I see you use both) tricks from them.
Lastly for your accuracy I'll suggest this since it contains symbols and it's a bit tougher than the normal typing test.

GL!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it
  • You can reduce the errors you encounter by typing less code. This can be done by increasing the size of your template by using more defines, aliases etc. Also, you can debug faster by using some debugging templates used by many users on cf (eg: neal, tourist), which allows you to print variables, containers, and other things on the output console. This can help you solve easier problems faster.
  • To write more readable code, you can follow users who write readable code (shoutout to neal once again).
  • As pointed out by many, to improve your typing speed, focus more on accuracy. The speed will come gradually.
»
4 years ago, # |
  Vote: I like it -8 Vote: I do not like it

This is such a stupid question. What do you think the answer is? Practice, duh. I can't type that fast, and I type code even slower, but I just think about what I'm typing and make sure I did not type something wrong, and the more I code the less mistakes I make. It sounds like you're problem is you need more practice and you aren't looking at what you're typing smh.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I personally think that you should learn touch-typing. It helped me gain a decent typing speed(I never measured it though) as well as no more do I need to look down while typing. Eventually (with some practice) you gain enough muscle memory that your brain doesn't even need to process where the next key is. PS — It also helps you to text faster :)

»
4 years ago, # |
  Vote: I like it +4 Vote: I do not like it

poor me at 33WPM