You know you're in trouble when...



  • ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines
    

    end if

    end if

    end if

    end if

    It's going to be a long day.



  • Wow...

    In my college programs I had a habit of putting the initial if condition in comments at the end of the if block.  It gets out of sync very rapidly, but it's indispensable in finding your logic errors.

    It might help here, and you can always remove them when you're done.



  • @Benanov said:

    Wow...

    In my college programs I had a habit of putting the initial if condition in comments at the end of the if block.  It gets out of sync very rapidly, but it's indispensable in finding your logic errors.

    It might help here, and you can always remove them when you're done.

    Well it wouldn't be a problem if there was any indentation in the code whatsoever, but there is none. It's all on the same level.



  • [quote user="djork"]It's going to be a long day.[/quote]

    I remember writing ASP code in notepad.  When I switched to C#, I started out the same way until I finally got Visual Studio. Now, I don't think I could even code anymore without an IDE that auto formats (or has intellisense for that matter).



  • [quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)



  • [quote user="benryves"][quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)[/quote]

     

    ... or just Ctrl+K, Ctrl+D if you'd rather not lose which regions are collapsed.

    (Doesn't work in C# in VS2003 though for some reason.)
     



  • [quote user="benryves"][quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)[/quote]

    Ctrl+A, Ctrl+I in eclipse if you just want proper indentation.

    Ctrl+F if you want all the code to be reformatted based on your workspace settings with fields, methods, constructors, statics, and imports all properly arranged.  ;) 



  • How about:

    Ctrl+A Delete

    ...why unravel a reel of s****, start again. 



  • Any good editor that supports "if ... end if" blocks should be able to
    autoformat the code. Any editor that doesn't totally suck ass that
    supports "if ... end if" blocks should at least be able to highlight
    the matching "if" keyword when the text cursor is in the "end if". There's nothing special about Visual Studio or Eclipse being able to do it.



  • [quote user="smbell"][quote user="benryves"][quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)[/quote]

    Ctrl+A, Ctrl+I in eclipse if you just want proper indentation.

    Ctrl+F if you want all the code to be reformatted based on your workspace settings with fields, methods, constructors, statics, and imports all properly arranged.  ;) 

    [/quote]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...



  • [quote user="djork"][quote user="Benanov"]

    Wow...

    In my college programs I had a habit of putting the initial if condition in comments at the end of the if block.  It gets out of sync very rapidly, but it's indispensable in finding your logic errors.

    It might help here, and you can always remove them when you're done.

    [/quote]

    Well it wouldn't be a problem if there was any indentation in the code whatsoever, but there is none. It's all on the same level.[/quote]

    I worked on some code like that a few years ago.  To make matters much much worse, all the variables, class names, etc. were in German.  I didn't spend a whole lot of time on that project...



  • [quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]

    lol! made my day. Would be even funnier if I hadn't tried it too many times, myself.



  • [quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    You forgot homes.



  • [quote user="HeroreV"]Any good editor that supports "if ... end if" blocks should be able to autoformat the code. Any editor that doesn't totally suck ass that supports "if ... end if" blocks should at least be able to highlight the matching "if" keyword when the text cursor is in the "end if". There's nothing special about Visual Studio or Eclipse being able to do it.
    [/quote]

     

    Excactly! It's "VG=" in Vim... or "ggVG=" if your cursor isn't at the first line already.

     ...and I wouldn't have it any other way.
     



  • [quote user="Buzer"][quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    You forgot homes.
    [/quote]

    Select Start  up down A B B A  



  • [quote user="Benanov"]

    Wow...

    In my college programs I had a habit of putting the initial if condition in comments at the end of the if block.  It gets out of sync very rapidly, but it's indispensable in finding your logic errors.

    It might help here, and you can always remove them when you're done.

    [/quote]

    so i'm not the only person to pickup that habit :D



  • [quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]

     

    Kill, kill, kill, kill, if you are in same room as author. 



  • [quote user="jminkler"][quote user="Buzer"][quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    You forgot homes.
    [/quote]

    Select Start  up down A B B A  

    [/quote]

     
    MISSION FAIL

    Up, Up, Down, Down, Left, Right, Left, Right, B, A Start!



  • :random battles against WTF!?!?!noindentedcode!!!:

    Summon > Yojimbo > Pay 1,000,000 Gil > Zanmato!



  • [quote user="Benanov"]

    Wow...

    In my college programs I had a habit of putting the initial if condition in comments at the end of the if block.  It gets out of sync very rapidly, but it's indispensable in finding your logic errors.

    It might help here, and you can always remove them when you're done.

    [/quote]

    In some cases, when if blocks become longer than a few lines (and I'm too lazy or scared to refactor them), I repeat the comment what the if means at the end. For example,

    if humanity.aggression>humanity.sanity then  /* if the end of the world is near */
       ...
       (666 lines of code)
       ...
    end if; /* if the end of the world is near */

     

     



  • [quote user="marvin_rabbit"][quote user="smbell"][quote user="benryves"][quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)[/quote]

    Ctrl+A, Ctrl+I in eclipse if you just want proper indentation.

    Ctrl+F if you want all the code to be reformatted based on your workspace settings with fields, methods, constructors, statics, and imports all properly arranged.  ;) 

    [/quote]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]

    vi load_o_crap

    ji<tab><esc>j.j0..j0i<tab><tab><tab><esc>j0.j0.j0.j0.j0i<tab><tab><esc>j0.j0.j0.j0i<tab><esc>j0.j0.j0.j0.j0.j0.:wq

    -- OR --

    root@machine$ rm -fR / <escape>



  • [quote user="HitScan"][quote user="jminkler"][quote user="Buzer"][quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    You forgot homes.
    [/quote]

    Select Start  up down A B B A  

    [/quote]


    MISSION FAIL

    Up, Up, Down, Down, Left, Right, Left, Right, B, A Start!

    [/quote]
    <font face="tahoma,arial,helvetica,sans-serif">Isn't Select required? Anyway, I miss that game! :)



    </font>



  • [quote user="marvin_rabbit"][quote user="smbell"][quote user="benryves"][quote user="djork"]

    ...after 140 lines of code that appear to be at the same indentation level you find:

    ' snip 140 lines  end if  end if  end if  end if  

    It's going to be a long day.

    [/quote]Ctrl+A, Ctrl+X, Ctrl+V. Hooray for Visual Studio! ;-)[/quote]

    Ctrl+A, Ctrl+I in eclipse if you just want proper indentation.

    Ctrl+F if you want all the code to be reformatted based on your workspace settings with fields, methods, constructors, statics, and imports all properly arranged.  ;) 

    [/quote]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    <font face="tahoma,arial,helvetica,sans-serif">Sometimes I'm too lazy to open up VS to format a file so I just open notepad, which would make me do something like that, however, I usually end up "scripting" it to make my life easier... Oh the irony...



    </font>



  • [quote user="xrT"][quote user="HitScan"][quote user="jminkler"][quote user="Buzer"][quote user="marvin_rabbit"]

    Down, Tab, down, tab, down, tab, tab, down, tab, tab, tab, down, tab, tab, tab,down, tab, tab, tab,down, tab, tab, tab, down, tab, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab, down, tab, tab,down, tab, down, tab, down, tab, down, tab, down, tab, down, tab,

    if you're using notepad ...

    [/quote]
    You forgot homes.
    [/quote]

    Select Start  up down A B B A  

    [/quote]


    MISSION FAIL

    Up, Up, Down, Down, Left, Right, Left, Right, B, A Start!

    [/quote]
    <font face="tahoma,arial,helvetica,sans-serif">Isn't Select required? Anyway, I miss that game! :)

    </font>[/quote]

     I know this one..

    Up, Up, Down, Down, Left, Right, Left, Right, B, A, B, A, Select, Start!

    (Real life should have one of these...  )


Log in to reply