Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge
View Poll Results: Who hates rewritting BAD code?
I HATE TO DO IT! 19 70.37%
I LOVE TO DO IT! 8 29.63%
Voters: 27. You may not vote on this poll


Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 16th, 2003, 11:40 PM
SammyK's Avatar
SammyK SammyK is offline
Happy Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2001
Location: UK (University of Kentucky)
Posts: 1,810 SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 23 h 9 m 31 sec
Reputation Power: 42
Who here HATES rewriting BAD code?

I just have to vent a second...

I HATE REWRITING RENARDO CODE!!! It's like being the "pooper scooper" that follows the animals in a parade. I wish I was able to just start from scratch on some of these projects. The database indexing is MESSED UP! There are 25 different SQL queries in the first 75 lines of code in one of these files. I packed them all into one query, and you know what? It's 1,000,000,000 times faster. What was he thinking?

Ok, I am done now.
__________________

Reply With Quote
  #2  
Old August 17th, 2003, 01:40 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 48 m 15 sec
Reputation Power: 174
I enjoy rewriting poorly written code. It provides me an opportunity to become a better programmer. It provides me an opportunity to see how another programmer approached a problem - what steps they took to solve it, their thought process(es) while solving it, the design and logic choices they made, etc. Its kind of an ego kick for me as well, because I'm usually much better at coding than the person's code that I'm rewriting, so I get that little personal satisfaction thing.

__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever.
Analyze twice; hack once.
The world's first existential ITIL question: If a change is released into production without a ticket to track it,
was it actually released?


About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect -
Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire


Reply With Quote
  #3  
Old August 17th, 2003, 11:15 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
Here is an overview of my works website that was done by a web development firm just before I joined the company.

200 or so PHP files. No templating, all non-OOP code. No database abstraction. Usage of dreamweaver templates meaning that common items (ie menu) are repeated on every page. Standard SQL queries that are ran on each page are not used in functions, they have sperate copies of them. The code is written to work with Register Globals on and variable naming is quite often cryptic and useless. It is my job now to maintain this pile of crap. Yay. Need more be said.

I really know what you are going through

Reply With Quote
  #4  
Old August 17th, 2003, 11:18 AM
computer's Avatar
computer computer is offline
echo $usertitle['computer'];
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2003
Location: UK
Posts: 6,676 computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 4 Weeks 9 h 39 m 45 sec
Reputation Power: 220
Send a message via ICQ to computer
Hey andreas if you get a copy of ConTEXT it might help you a bit. You can open the whole website in it and then tell it to do search and replace on all open files so you could get it to replace all the menu code with an include or something...

Reply With Quote
  #5  
Old August 18th, 2003, 01:06 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 48 m 15 sec
Reputation Power: 174
Quote:
Originally posted by computer
Hey andreas if you get a copy of ConTEXT it might help you a bit. You can open the whole website in it and then tell it to do search and replace on all open files so you could get it to replace all the menu code with an include or something...


Dreamweaver MX will allow for the same thing... sounds like, if they're using DW templates, they've already got it...

Reply With Quote
  #6  
Old August 18th, 2003, 06:16 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
I have dreamweaver MX and have been doing that for some sections. The thing is that none of these files have any Dreamweaver templating comments in them, they have all been removed!?!

Also some sections are slightly different which cause the search and replace not to get them so I still have to go through and check all of the files, this does take its time.

Reply With Quote
  #7  
Old August 18th, 2003, 04:35 PM
dog135's Avatar
dog135 dog135 is offline
Doggie
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2003
Location: Seattle, WA
Posts: 751 dog135 User rank is Corporal (100 - 500 Reputation Level)dog135 User rank is Corporal (100 - 500 Reputation Level)dog135 User rank is Corporal (100 - 500 Reputation Level)dog135 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 38 m 25 sec
Reputation Power: 7
Quote:
Originally posted by drgroove
I enjoy rewriting poorly written code. It provides me an opportunity to become a better programmer. It provides me an opportunity to see how another programmer approached a problem - what steps they took to solve it, their thought process(es) while solving it, the design and logic choices they made, etc. Its kind of an ego kick for me as well, because I'm usually much better at coding than the person's code that I'm rewriting, so I get that little personal satisfaction thing.



Now see, that's the difference between "poorly written code" and "BAD code".

Poorly written code has some structure and some thought process behind it.

BAD code is usually an accumilation of copy/pasted code with values changed until it stops crashing.

I'm all to intimate with rewritting BAD code.

Reply With Quote
  #8  
Old August 18th, 2003, 04:48 PM
bcyde's Avatar
bcyde bcyde is offline
Me likey breadsticks...
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2003
Location: Los Angeles
Posts: 1,189 bcyde User rank is Sergeant (500 - 2000 Reputation Level)bcyde User rank is Sergeant (500 - 2000 Reputation Level)bcyde User rank is Sergeant (500 - 2000 Reputation Level)bcyde User rank is Sergeant (500 - 2000 Reputation Level)bcyde User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 1 h 12 m 58 sec
Reputation Power: 12
Send a message via AIM to bcyde Send a message via Yahoo to bcyde
I'm all about the bad code. Call me the rebel of PHP, and don't don't even look at my C++ it'll poke your eye out...

Hah j/k just feeling goofy cuz work ends in less than 20 minutes, and it's been a decent Monday.

I've worked alongside a bad coder or two before. What irked me the most was that these were people I knew were brighter than me (though that's not saying much) or stronger in their programming background (Caltech vs a liberal arts college, which isn't the best choice for someone interested in computers ) but were just too lazy to do things the right way. Sure it worked, for the time being but a month or two down the road, they were kicking themselves for silly mistakes.

-b
__________________
PostgreSQL, it's what's for dinner...

Reply With Quote
  #9  
Old August 18th, 2003, 06:42 PM
Pasiphae1213's Avatar
Pasiphae1213 Pasiphae1213 is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Pennsylvania
Posts: 171 Pasiphae1213 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Pasiphae1213 Send a message via Yahoo to Pasiphae1213
Even though I voted for "love," I have mixed feelings about it. If the program went through an efficient design process, and analyzed requirements and feasibility efficiently, but the syntax and code organization is sloppy, I don't mind. However, if the programmer jumped headfirst into coding without planning, then s/he can get him/herself out of the mess without my assistance.

Reply With Quote
  #10  
Old August 18th, 2003, 06:58 PM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,301 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 52 m 9 sec
Reputation Power: 105
Send a message via ICQ to christo Send a message via Yahoo to christo
*ack* eeeep!!!

I have just read what some of you guys are up to - with Dreamweaver this, and MX that...

Guys, can I just draw your attention to a very useful little thing known as UNIX, and it's common x86 implementation, Linux - Which I have found actually accellerate development by such an appreciable difference, that developing enterprise-level applications on a Windows desktop would be to me about as good a torture as cutting off my hands.

</sarcastic, but serious message>


christo

Reply With Quote
  #11  
Old August 18th, 2003, 09:35 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
lol. The best code rewrite I have ever done was chopping about 300 lines of code down to about 50. The programmer was taking a large amount of info from the db and reworking it using about 4 arrays and so many string checks and ifs that it was just criminal. I then wrote out an SQL statement that did all of that in the database and removed all his code. It was still bad code but it was better. The database has been developed and everything was nearly ready for launch when the client wanted to do something extra and this was a 'hack' that meant we didnt have to change the database design.

Reply With Quote
  #12  
Old August 18th, 2003, 10:01 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 48 m 15 sec
Reputation Power: 174
Quote:
Originally posted by CHR15T0
*ack* eeeep!!!

I have just read what some of you guys are up to - with Dreamweaver this, and MX that...

Guys, can I just draw your attention to a very useful little thing known as UNIX, and it's common x86 implementation, Linux - Which I have found actually accellerate development by such an appreciable difference, that developing enterprise-level applications on a Windows desktop would be to me about as good a torture as cutting off my hands.

</sarcastic, but serious message>


christo


Don't have a choice @ work - the other 2 people in my dept are designers, and we use the check in/out aspect of MX to keep from overwriting files. I'm using Zend Studio 2.6 for all of my coding, and MX is basically a glorified FTP client.

I also have a Sun Blade 100 running Solaris 9 in my office, as my own development server... but, not *allowed* to write code on it, just run PHP/MySQL/SunONE (yes, we actually use SunONE here, not Apache. No, really.).

Reply With Quote
  #13  
Old August 18th, 2003, 10:07 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
Well I do quite a bit of WYSIWYG table work since Dreamweaver does it well and I can get it done quicker than I can if I typed out the HTML. I still do all my own code in its coding view. I also support access databases so Linux wouldnt really work.

Reply With Quote
  #14  
Old August 18th, 2003, 10:52 PM
SammyK's Avatar
SammyK SammyK is offline