SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
-
May 10, 2002, 07:54 #1
- Join Date
- Sep 2001
- Location
- Singapore
- Posts
- 5,269
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
modified someone else's code before?
have any of you ever been given the unfortunate task of modifying someone else's code? how was the experience? did you get frustrated with the other person's bad coding practices like terrible naming conventions, arbitrary flag variables popping up everywhere, nerver-present indentation? or did you have a smooth-flowing job reading the code and fun the code very well-structured, well-commented and all in all easy to work with?
my one experience was terrible: terrible naming conventions, arbitrary flag variables popping up everywhere, nerver-present indentation like i said above and weird program logic as well... and i'm still working on it
just wanted to know everybody's experiences with working with source code thrown on you by your boss who tells you to 'work on it!'
-
May 10, 2002, 08:04 #2
- Join Date
- Apr 2001
- Location
- Sydney Australia
- Posts
- 869
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's bad enough looking at your own code after you haven't touched it in 6 months!
affordable website design
:: sydney australia ::
-
May 10, 2002, 09:08 #3
- Join Date
- Jan 2001
- Location
- Lawrence, Kansas
- Posts
- 2,066
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
As a general rule programmers hate reading code, especially code that was written by someone else. In fact, the hardest practical programming skill to develop is probably the ability to quickly read and understand code! I know that I often find myself thinking I'd rather write code from scratch than read through someone elses, although having good quality code to work with does make it a lot easier. This is why coding standards (such as the PEAR one) are a good thing.
-
May 12, 2002, 07:07 #4
I was asked to add a number of features to an existing script and it was yuck! The code was so scrambled and backwards it made my head hurt. Plus, whoever wrote it used printf() everytime they outputted something
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
May 12, 2002, 07:58 #5
- Join Date
- Sep 2001
- Location
- Singapore
- Posts
- 5,269
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
glad to see a fellow victim
you have my sympathy sean
-
May 12, 2002, 08:38 #6
- Join Date
- Jun 2001
- Location
- Adelaide, Australia
- Posts
- 6,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Lots of comments and tabbing are always appreciated
People find my coding logic -- erm a little differnt
-
May 13, 2002, 07:22 #7
- Join Date
- Jul 2001
- Location
- Western CT, USA
- Posts
- 803
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i always say.....NO! NEVER!
(did it once....ONCE!)
-
May 13, 2002, 07:33 #8
- Join Date
- Sep 2001
- Location
- Singapore
- Posts
- 5,269
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i've been modifying and improving this guy's code (it's in Perl... mostly Perl/Tk) and i spend most of my time re-indenting the code and trying to figure out what the variables mean ($count2, $d, $mm2 ?! :P)... it's been what 4 days... i'm almost tempted to rewrite the whole thing myself...
-
May 14, 2002, 12:20 #9
My experience hasn't been all that bad at work. The only problem I have had as far as maintaining somebody else's work was this loop he uses rather than ASP's built in replace function. it goes something like this:
[VBS]
for xas = 1 to len(string)
char = mid(string, xas, 1)
if char = "'" then
char = char + char
end if
char2 = char2 + char
next
[/VBS]
confusing eh? Could have easily been done like so:
[VBS]string = replace(string, "'", "''")[/VBS]
and it works in one line instead of 7. And his use of variables like xx, xas, xqo...you get my point. Otherwise it was well-structured and pretty logical code once I figured those things out. However, I do NOT touch that programmer's Perl code. Uh-uh. Way to obfuscated.
--Vinnie
Bookmarks