70
Konsole
6y

People always say how they lost couple fucking hrs because of a bloody ';'.

You know what.. '!' are mush worse.

I just lost 2.5 hrs debugging because i had written if(x){} instead of if(!x)

semicolons you can find at compile time.
! are the true morons

Comments
  • 6
    If( x === false ){}

    Live a happier life already.
  • 11
    Your editor usually screams at you when you have a missing semicolon. Unless you use notepad or something 🤷‍♂️
  • 1
    @M1sf3t Why?
  • 2
    No debugger, huh? Been there, done that.
  • 2
    @cprn Oh I was using debugger. Just wasn't setting the right break points.
    That 'if' looked really innocent
  • 1
    This is not even a syntax error or a typo. If your logic is false, it doesn't necessarily have anything to do with the code.
  • 0
    I have been there and it was not nice at all.
    Absolute hell.
  • 0
    @C0D4
    Good luck doing that in C#
  • 1
    That's probably why Python suggests one uses "not". More clearly visible. ;P
  • 0
    I've once lost a hour, because of
    for (var i=0; i++; i<x) {....
  • 1
    dont say bad words here, please
  • 3
    I once lost a day because of
    if (x == y);
    do_stuff();
    And I'm still salty to this day 🙃🙃🙃
    (Because of my vs code theme I can hardly see semicolons)
  • 0
    @Gregozor2121 And you need that in C# because...
  • 0
    @beggarboy
    Konsole never said what launguage he is using and because === is a JS thing that code wouldnt work in C#
  • 4
    @Gregozor2121 but it's not just a JS thing 😏

    But yes C# doesn't have a ===
    But you could still do if(x == false){}

    The only difference is Js and others use "==" as comparison, where "===" is type checked as well in order to prevent the following:

    let x = 1;
    If(x == true) // this is true
    If(x === true) // this is false
  • 1
    @C0D4 @Gregozor2121 @beggarboy Well I was actually doing it in Java 😂
  • 1
    @Konsole fine.
    Java is strict typed anyway so use "==" 😉
  • 1
    You cannot find semicolons like this...
    if ( x ) ; {
    Thing() ;
    }

    ...In java and eclipse does not report it as an error.

    Lots of time wasted on that one.
  • 1
    @c3ypt1c Intellij highlights that I think
  • 0
    @Konsole eclipse does not.
Add Comment