Forum Moderators: open

Message Too Old, No Replies

View Source Code

Using Note Pad Uncheck Word Wrap

         

pageoneresults

8:17 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I was speaking with a client on the phone the other day. We were discussing the formatting of html and how I always recommend no breaks in tags. I had him view the source code of his pages and was showing him the structure of the tags on the page.

When I asked him to look at the unbroken tag in a certain area, he responded that the tag was wrapping (broken) where it shouldn't have been.

I came to realize that the default setting for Note Pad on Windows is to wrap words. While in Note Pad, go to Edit and then uncheck Word Wrap.

Once he did this, he saw the correct html structure of the page. Do any of you give much thought to this? I mean, are you as anal as I when it comes to formatting html? How many of you have Word Wrap checked? Unchecked? Toggle between the two?

(edited by: pageoneresults at 8:25 pm (utc) on May 9, 2002)

brotherhood of LAN

8:25 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Line breaks in HTML hmmmm

Sometimes I dont have a line break period :) All just one long line of HTML. I understand what you mean, because taking word wrap off when viewing my FrontPage generated HTML it reverts to the one line HTML it was intended to be.

I wouldnt call it being anal, I try to stick to a routine, so each day I can do it better sorta thing :)

/Fancy OT suggestion

use a db, that your client can access, which can allow him to alter/create pages by using a form connected to the db. Since most HTML is repeated again, and again and again (like my long WebmasterWorld name :) .... You could leave a message in the HTML like "change tis bit". You could do this by prefilling the form with the basics of the HTML page (or indeed HTML of a template), where you could also have commonly used HTML tags on the page ready to be "cut and pasted" into a form

phew, off topic ;) My point is just that really, the lowest common denominator / least permutations is best, especially when it involves clients fiddling around with the likes of HTML!

/added

look at the URL littleman posted here [webmasterworld.com...] ...look at their source code (if thats ok).... do you think this is a common occurrence ? :) I see it a lot

sun818

8:35 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I only use wordwrap when I edit pages. Otherwise, there are no breaks to save bandwidth. The beginning of ending of sections are commented to act as a visual aid during editing. If you are anal about formatting, I read a review on a free HTML editor that includes a "beautify" feature. :)

pageoneresults

8:53 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> I read a review on a free HTML editor that includes a "beautify" feature.

Hey, all of my sites have been selected as candidates in the Miss HTML pageant!

On the Word Wrap subject, I was referring mainly to viewing source code using Note Pad. I don't think I could work in an Editing environment where Word Wrap was on. I'm just too comfortable with my current methods.

ergophobe

9:24 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



free HTML editor that includes a "beautify" feature

This is HTML Tidy, which is not an editor, but does some validation and processing. It is integrated into HTML-Kit and probably other editors but is designed as a stand-alone Unix app. Dave Ragget has now given it up and made it a SourceForge project.

no breaks to save bandwidth. The beginning of ending of sections are commented to act as a visual aid during editing

*This* seems anal. A line break is only two bytes in a Windows file (CR/LF) and one in Unix (LF) or Mac (CR). So if you have a 1KB image, that's like 1000 line breaks in Unix. If your files are 1000 lines long, I would still say that the extra 1KB is not going to make any difference. The only reason I can see for deleting all line breaks is for code obfuscation, but of course I can easily search and replace on tags and get them back. In any case, an *empty* comment is as much bandwidth as eight line breaks. If I wanted to save bandwidth, I would use regex searches to delete all comments from the file before going live. Anyway, generally speaking, text is cheap, so why bother. Get rid of one 1KB image and a single nested table, and you gain as much as getting rid of 2000 line breaks (maybe 1000 if it's a Windows file)

Do any of you give much thought to this?

It depends on context. If it is a collaborative project using revision tracking (i.e. CVS - best tool ever), you have to be careful about changing spaces or line breaks and, if you accidentally convert Unix line breaks to Windows, you're colleagues will hate you. Frankly, I like code that looks nice. I think I must be anal - I try to make my dynamic scripts generate nice-looking HTML. It helps so much with debugging when you have a complicated dynamic page.

Tom

Tom

brotherhood of LAN

9:36 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>anal line breaks

not just bandwidth, its annoying for people trying to read your source code. Actually, my average bandwidth per page view is 6.1 kilobytes (not graphics intensive).....so that kilobyte you talk about over 10 000 page views means alot, especially when I have a 3Gb bandwidth limit. Basically, 1k is like adding another 15% of defunct code to my page. I could make them more colourful for the relative cost (and rankings) of a larger page

ergophobe, im a tad OT, but you might want to check out two threads, youll find them from site search up the top. 1st search "40kb sweetspot", in regards to line breaks and another about google rankings and file size (youll have to find that one yourself ..... unless someone can chip in a URL) :) Im sure Woz and Brett discussed it, or were at least involved...

sun818

9:55 pm on May 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Tom, you're right -- line breaks save little bandwith. It is really the left spaces you trim along with the link breaks. Every bit helps especially when your web account is hosted with 800 other accounts on one server.

ergophobe

12:10 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Couldn't find it via search, but it came up right away in Google. I think you mean this thread right:
[url] [webmasterworld.com...] [/url]

that kilobyte you talk about

I was thinking of an extreme case there - a Unix page with 1000 extra line breaks.

It is really the left spaces you trim

Yeah, that was stupid... you have to count it all. That changes my calculation considerably doesn't it? An average ten-space indent suddenly makes each line break 11-12 bytes, which is 1kb for a 90-line file, which does start to add up.

Hmmm.... that has me thinking about getting rid of some line breaks.

Tom

[edited now that I found it with Google]

brotherhood of LAN

12:32 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That wasnt the thread i was talking about but it still looks useful eh ;) The thread Im thinking about was started by Tedster I believe, about 2 months ago, and was something like "whatever happened to the 40kb sweetspot" as the title....but im sure the titles etc of old posts are changed

the other thread i was talking about took a sample of file sizes in comparison to google rankings, which indicated that between around 5-10k of code used per page is best in regards to google

im good at remembering the old threads, rubbish at finding them ;) They are around, in amongst other quality similar threads

pageoneresults

12:39 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Here is one of them...

Google Document Sizes [searchengineworld.com]

brotherhood of LAN

12:48 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A1 pageone ;) thats it

A related thread to the one im trying to find
[webmasterworld.com...]

i know tedster made the one im looking for, and i know i replied in the thread, but searching for both our names doesnt produce the goods......must look harder

pageoneresults

12:51 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've been searching for the last 15 minutes for that thread, I know which one you are talking about. I participated also, and it was a very informative thread. I could of sworn that there was a 40k in the title and I'll assume that got changed somewhere along the way, I can't find it either. Arrrggghhh!

P.S. I'm finding some other good stuff though!

Web Page Size and Speed [searchengineworld.com]

ergophobe

1:06 am on May 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm pretty sure I've got it. Edited my original post, but just for future reference, the thread was in fact started by Tedster and is titled

Download speed - did the whole web forget the 40kb sweet spot? [webmasterworld.com]

Some interesting stuff and it pointed me to Brett's Page Size tool I was horrified to find a text/html ration of 40%. Doesn't seem quite right since the pages I was checking are almost nothing but text.... Yeah, that's what they all say isn't it?

Anyway, I'm going ot play around a bit. I must say that my pages, with graphics and all, were under 30K (often by a lot) and I still like the readibility bonus of neat code. On the other hand, there's no reason to have line breaks within a paragraph.

Food for thought!

Tom