Its frustrating actually VVVVVVVVVVVVVVVVV frustrating to try to understand code written by others. I know this the best , had to struggle a lot in past few days wid it, was bizee redesigning .And believe me designing is much much easier than to redesign .Everyline u proceed with , and the smallest thing say something with the braces and you can see hundreds of errors popping up .Oh i used to be so scared (after editting ) of having a look at screen as i pressed run .....100's of errors
however , soon my immunity power satarted increasing :D .whatever editting is heck .
More so when people don't care about proper indentation and commenting. Can't really do anything about unwritten comments, but I can give you two tips to indent the code written by someone else in C my field till yet ,can't tell ya much about web designing scripting myself struggling it wid it yet but gen :
Learn to use the command 'indent' (*nix only) if its a C code. Do 'man indent' and find out the options that fit the best to your taste. They have some excellent examples in the man page.
If the code is in some other language, try this method. Open up the file in vi (or gvim). Press 'gg' (to go to the beginning of the file), then press 'v' (for visual) and then press 'Shift-g' (or 'G', to go to the end of the file). This will select everything in the file. Now comes the magic :) ... while everything is selected, press '=' and - voila! - your code is properly indented :). Of course, instead of selecting the whole document, you can select parts of it using some combination of 'v' and other keys and indent only that part.
And yes, you can be lazy too, and not indent while writing the code.. since you can always indent it later using these methods, but I wouldn't recommend it. That would be sacrilege.
2 comments:
Wow gurl
ye achanak se code gyaan kyun ?
thinking of becoming a proff kya :P
and want to have some more tips ?
hehe code gyaani ji aap thoda gyan de dijiye mujhe aur mere readers ko
n proff me
impossible is the word :D
Post a Comment