Dirty Code

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Dirty Code

Post by TheMoose »

So one of the people testing out a new aspect of my company's portal came to me with a bug today which was a relatively easy fix. So I open up the page in my favorite text editor Editplus, and get to fixing it. Then I realize I can't find the right DIV, for some reason it seems out of place.

Then it hits me.

Someone else opened my page in Frontpage or Visual Studio and went to Design View, because there are endless amounts of:

Code: Select all

<p style="margin-top: 0; margin-bottom: 0"><font face="Arial">MY STUFF HERE</font>
I hate how it dirties my code!

I don't understand why it would even add that inside a DIV tag that has a class with CSS styling. I don't need to make it a new paragraph, I already set the font, stop assuming I want code there :(
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'd never let anyone near my markup with a WYSIWYG editor. They do make an utter mess.
User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Post by TheMoose »

Oh how I wish, but it's my boss and he uses one of those 2 programs to publish from our dev server to our live server.

I haven't even checked my other files that I've been working on, as I've been too busy cleaning this one file, which is now almost 1700 lines long because of the dirt that was thrown in it.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

TheMoose wrote:Oh how I wish, but it's my boss and he uses one of those 2 programs to publish from our dev server to our live server.

I haven't even checked my other files that I've been working on, as I've been too busy cleaning this one file, which is now almost 1700 lines long because of the dirt that was thrown in it.
Sounds like you need subversion ;)
User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Post by TheMoose »

d11wtq wrote:Sounds like you need subversion ;)
He just recently had an epiphany of how useful XML can be. For some reason, I don't think he'll know what Subversion is, let alone be willing to use it. :(
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

TheMoose wrote:
d11wtq wrote:Sounds like you need subversion ;)
He just recently had an epiphany of how useful XML can be. For some reason, I don't think he'll know what Subversion is, let alone be willing to use it. :(
Sounds like you need a cup of tea ;)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I used to have a boss like that, except he wouldn't even have given xml a chance... he "doesn't understand why anybody would need anything but internet explorer" either. :roll:
User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Post by TheMoose »

Tea....beer....either will work :D

However on a lighter note, I also had a recent epiphany because of Begby's question about value objects and models. So now I get to implement it with some of my own projects. Luckily it doesn't involve dirty code, and does involve a decent CVS system (aka, not Frontpage or VS).

EDIT: Ninja, did you used to work for my boss? About 3 months ago I was able to persuade him to install Firefox to at least debug his code since it actually gives messages instead of the IE "Error 500: there's an error, but we don't know what it is". And as soon as he saw that I was using AJAX for some of my projects (nothing out of the ordinary, just things like search suggests, etc), he all of the sudden started trying to do it also. Except it wasn't AJAX. It was merely JS showing a "loading..." screen until the page loaded, then it disappeared. There was no data request or response.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

I hate stupid bosses :x
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I don't, stupid bosses are easy to convince - you just have to know how.

That's not to say I dislike bosses with a clue, though. They are equally great.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Jenk wrote:I don't, stupid bosses are easy to convince - you just have to know how.

That's not to say I dislike bosses with a clue, though. They are equally great.
I hate bosses in the middle. They understand some, but completely misunderstand others. I could have sworn that you could upgrade an only PHP 4 to a newer PHP 4 simply by overwriting the current files and restarting the server. He wouldn't believe me (and neither would his star ASP programmer). Then there'd be times when he'd throw around unaccepted acronyms as though anyone in the office knows what he's talking about.

I had a clueless project leader. She was fun. I could tell her anything. She was strange though... No matter what, she'd print something out. Send us an e-mail, ask us if we got it, then print it out. Look at a site as it's in production, find a mistake, print it out, and circle it. I used to think all of the printer ink messages were spam, but now I think they've requested them. :P
smudge
Forum Contributor
Posts: 151
Joined: Sun May 20, 2007 12:13 pm

Post by smudge »

Way back when, when I was just learning the basics of HTML, I was using Frontpage. Then I got to reading books and tutorials, learning the right way to do things, and decided that FP's code was the ugliest, most repulsive code on the face of the earth. Since I didn't really know my way around editors, I just used notepad for a year or two, using windows explorer to do uploads. Then I was introduced to dreamweaver. Although it's not the best programming environment, It amazingly doesn't make any dirty code! It even came with commands to cleanup microsoft code and automatically format and indent your code. So, to d11wtq, wysiwyg editors are not necessarily bad. It's just the microsoft ones that make me shudder.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

smudge wrote:Way back when, when I was just learning the basics of HTML, I was using Frontpage. Then I got to reading books and tutorials, learning the right way to do things, and decided that FP's code was the ugliest, most repulsive code on the face of the earth. Since I didn't really know my way around editors, I just used notepad for a year or two, using windows explorer to do uploads. Then I was introduced to dreamweaver. Although it's not the best programming environment, It amazingly doesn't make any dirty code! It even came with commands to cleanup microsoft code and automatically format and indent your code. So, to d11wtq, wysiwyg editors are not necessarily bad. It's just the microsoft ones that make me shudder.
I'm going to have to disagree with you. DW's looks better than FP, but it still can't compare to hand-written code. I hate working with anyone that uses design mode because I always end up rewriting the whole things since it's not in a position to simply be edited.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I agree - design mode is terrible. Dreamweaver is terrible come to think of it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

DW, like FP, suck. Of course, that is a biased opinion. I am a professional developer, so you can take that for what its worth.

DW and FP have their place, but for folks that like clean code, hand writing it is the only way to guarantee that it will be clean. I learned HTML from a magazine using notepad and have not looked back since. In fact, I have never used anything that write my code for me.
Post Reply