How DW codes VS How I hand-code
Alright, here's my beef with WYSIWYG and other 'design programs'
My partner I'm writing a progam with uses DW to do HTML coding and I do it by hand. Dreamweaver seems to add a bunch of JUNK to it
Ex:
DW:
<tr>
<td width="127"><p align="center"><small><strong><font color="#FFFFFF"><<</font></strong>
<a href="javascript:history.go(-1)" class="back"><strong>Go Back</strong></a></small></td>
<td width="245"><p align="center"><font color="#FFFFFF"><strong><small>Logged in as:</small></strong>
</font></td>
</tr>
Me:
<head>
<style type="text/css">
TD.class {
color: #FFFFFF;
font-weight: bold;
font-size: 10pt;
}
</style>
</head>
....
<tr>
<td width="127 align="center" class="class"><<<a href="javascript:history.go(-1)">Go Back</a></td>
<td width="245" align="center" class="class">Logged in as:</td>
</tr>
I know, right there mine may be longer, but if making a nav-bar or a page with the same size TD and alignment with text and all about 20 times, wouldn't it make more sense to do it the second way?
That's just a quick example, but at another point, Dreamweaver has 8 nested tables with something that could have EASILY been aligned using divs and CSS
As is above, it has a lot of or is this any different from ???
I'm no HTML expert but I'm just giving it a shot here...
Thanks!
Suzanne posted this at 03:25 — 18th June 2003.
She has: 5,507 posts
Joined: Feb 2000
You could trim it up even tighter!
<head>
<style type="text/css">
td.class {
color: #FFFFFF;
font-weight: bold;
font-size: 10pt;
text-align: center;
}
td.otherclass {
width: 245px;
}
td.stillotherclass{
width: 127px;
}
</style>
</head>
....
<tr>
<td class="class stillanotherclass"><<<a href="java script:history.go(-1)">Go Back</a></td>
<td class="class otherclass">Logged in as:</td>
</tr>
In some cases, you could use contextual selectors as well, or id instead of class, depending on what you're doing.
So, yes, you can really streamline the code, get it all controlled by the CSS.
nike_guy_man posted this at 03:31 — 18th June 2003.
They have: 840 posts
Joined: Sep 2000
I'm so tired I forgot to post my question!
Why does DW do this??
This is such a waste!
Or am I missing something?
The Webmistress posted this at 07:06 — 18th June 2003.
She has: 5,586 posts
Joined: Feb 2001
DW can code exactly like you have but it all comes down to what it is told to do rather than what it does. The DW code you have there isn't utilising CSS but yours is so you can't compare the two!
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Suzanne posted this at 12:03 — 18th June 2003.
She has: 5,507 posts
Joined: Feb 2000
DW doing it all on its own makes for some massively bloated code. If you treat it like a tool instead of a robot or artificial intelligence, it will do a solid job, I think.
I remember earlier versions that would add rows and columns of shims -- rows and rows and rows and rows... Aiyee!
I understand it's WAY improved now.
But understanding why the second option is better should help you get DW to do that for you?
The Webmistress posted this at 12:33 — 18th June 2003.
She has: 5,586 posts
Joined: Feb 2001
My point is that looking at those two sets of codes the DW one isn't even trying to do what the hand coded one is! You can use DW to produce exactly the same code as the hand coded code.
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Megan posted this at 13:00 — 18th June 2003.
She has: 11,421 posts
Joined: Jun 1999
Exactly, Julia. DW is just a tool, it isn't an automatic code creator or a psychic. It all comes down to what the user tells it to do. If the user tells it to use font tags, it will. Similarly, if the user creates style sheets, that's what DW will output. IT can't force you to do something different. DW didn't write that code by itself, your partner made it do that. YOu want to see some stuff I've done with DW? Clean as clean can be.
Megan
Connect with us on Facebook!
ROB posted this at 00:09 — 19th June 2003.
They have: 447 posts
Joined: Oct 1999
if you really want to see bloated code try saving a ms word doc as html
Suzanne posted this at 01:09 — 19th June 2003.
She has: 5,507 posts
Joined: Feb 2000
Hee hee...
Any tool that's automated can create bloated code because they only care about making it look as the person on the other side intends. WYSIWYG applications are a bit black-box-ish in that way -- you can't see *while you're making the changes* what's happening with the code, so going into the code later is just perplexing (to those who don't understand how it works in the first place).
That's why I think it's really important for people to gain a solid understanding of how the language works when they do this professionally. If it's a hobby, or a personal site, does it matter? I don't think so. Then it's solely display. If their audience complains, they will learn more about it, of course, and evolve and learn along the way.
nike_guy_man posted this at 01:12 — 19th June 2003.
They have: 840 posts
Joined: Sep 2000
Thanks y'all
How do I tell dreamweaver to use CSS and code the way I want it to? I have tried using the style functions to create the CSS but it still puts in unnecessary code
Thanks
The Webmistress posted this at 07:17 — 19th June 2003.
She has: 5,586 posts
Joined: Feb 2001
In DW though you can see what's happening to the code as you use it!
DW makes it easy to use CSS by using the CSS panel, then to attach a class to something you just click on the relavant element at the bottom and click on the style in the panel. I don't know what unnecessary code it's adding for you, can you show an example?
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Suzanne posted this at 11:51 — 19th June 2003.
She has: 5,507 posts
Joined: Feb 2000
Simultaneously? Coooooool.
taff posted this at 20:00 — 19th June 2003.
They have: 956 posts
Joined: Jun 2001
yeah. I have to admit, I've found myself using Dreamweaver a little more often lately. I keep the screen at about 3/4 wysiwyg and 1/4 code so I can keep an eye on how it's coding. If you don't like something, give the code window the focus and edit manually.
I've still yet to create anything from scratch in DW but it is becoming a very handy editting tool.
I create HTML from Word all the time. Just run it through the MS Office HTML Filter afterward and you've actually got pretty clean code just waiting to be formatted again.
.....
Megan posted this at 20:12 — 19th June 2003.
She has: 11,421 posts
Joined: Jun 1999
Does that do a better job than DW's "Clean up Word HTML" command? Is it a stand alone thing or what?
It doesn't help that most people don't know how to use Word properly either...
Megan
Connect with us on Facebook!
taff posted this at 21:39 — 19th June 2003.
They have: 956 posts
Joined: Jun 2001
oh yeah, much better. It strips away almost everything and then I just make a few global search/replace sweeps to get what's left behind.
It is a standalone tool...
http://office.microsoft.com/Downloads/2000/Msohtmf2.aspx
It supposedly works for Excel also but I've had mixed results there.
.....
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.