Блог пользователя MarcosH911

Автор MarcosH911, история, 2 года назад, По-английски

While I was looking for some solutions to hack I came across some unreadable code, this made me wonder if unreadable code that was done on purpose should be banned or at least penalized. With this I mean replacing for example each space with 100 spaces after finishing writing the code. I haven't seen anyone do this yet, but I think there should be an option to report it in case someone does it.

What do you guys think?

  • Проголосовать: нравится
  • +21
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You may "format on save" it on your editor maybe so that its readable... VSCode has an option for that I believe, and other alternative platforms might have it as well.

  • »
    »
    2 года назад, # ^ |
    Rev. 2   Проголосовать: нравится -8 Проголосовать: не нравится

    The editor beautifying code usually generates an excessive amount of whitespace, and some people (i.e. myself) hate that a lot due to several reasons. (i.e. they may hate their code rolling off to the next line but excessive whitespaces make it worse) So, well, while the feature has a good intention, it isn't always a good solution to issues

»
2 года назад, # |
Rev. 2   Проголосовать: нравится +43 Проголосовать: не нравится

Yes, it's against rule 16, which everyone who registers for a contest agrees to.

Solution code obfuscation and creation of obstacles to reading and understanding the solution is prohibited. It is forbidden to use any special techniques designed to complicate the reading of the code, to understand its workflow.

My source.

Also worth mentioning is that it's usually a good idea to write readable code for contests where hacking happens during the round. You usually want to be hacked (except for someone breaking your hash usually), because if your solution is hackable, you're likely going to fail system tests, so it's better to be hacked during the contest when you can still fix it.