37

I was at the robotics group of our school when suddenly two other students (both 2 grades above me) started talking:

P1: I always forget the brackets when writing code

P2: I always forget the return statements

P3: yeah, always takes ages to find out why your code doesn't work

P4: haha, in the end it's just something missing that you didn't notice like a semicolon or a bracket

Me (thinking): do you use a fucking toaster to code? Even if you don't use an ide the compiler tells you what's wrong

Comments
  • 9
    IDE doesn't work for logical error
    Scenario 1:
    if(some condition)
    print 1;
    print 2;
    print 3;
    Output:
    Condition is true: 123
    Condition is false: 23

    Scenario 2:
    if(some condition) {
    print 1;
    print 2;
    }
    print 3;
    Output:
    Condition is true: 123
    Condition is false: 3

    Compiler won't throw error for such and it takes ages to find out such mistakes. I wasted 45 precious mins in a coding competition which resulted in my team rank going from top 10 down to 44th.
  • 9
    @ThatDude yup. Chilled out. Dude. It's past now, almost 3 years back. Now, I always use braces even for single line inside ifs. Precautions. Haha.
  • 6
    @github braces and indentation helps a lot !!
  • 2
    @rui725 yup. I completely agree.
  • 2
    In my Alma mater, we had to use vi editor/gedit and shell compilers. No IDEs. So don't be surprised, anything can happen
  • 2
    @dtaposh almost all compilers including gcc tell you about a missing semicolon and the line number
  • 1
    @bdhobare yes, but not at real time. You gotta do the compile to get the errors.
  • 2
    If(condition){

    }

    Only then I write the code inside.

    Even if the IDE or whatever gives you insight to what's wrong there is a series of good practices you can adopt in order to improve you time and quality.

    I understand juniors complaining about juniors mistakes, its OK.
    But if a senior comes to me with this behavior he is gonna have a bad time.

    I'm sorry for being this sharp I'm just in a mood of being allergic to bullshit from professionals.
Add Comment