SitePoint Sponsor |
|
User Tag List
Results 1 to 17 of 17
Thread: HTML Shrinker. Good? Bad? Ugly?
-
Apr 11, 2001, 11:18 #1
- Join Date
- Nov 2000
- Location
- Atlanta, GA
- Posts
- 35
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Does anyone have an opinion on the use of programs such as HTML Shrinker (available from http://www.thepluginsite.com )? I just tried it for the first time and it seems pretty cool, but I'm wondering if there's any drawbacks which I might not be aware of.
For anyone not familiar with HTML Shrinker, it claims:
===========================================
HTML Shrinker removes all unnecessary bytes within html files. The look of the html page won't change after it is compressed. It just looks like before. You won't see a difference, only the file size will be smaller. HTML Shrinker currently removes from html files as follows:
unnecessary end of lines
unnecessary quotes within tags
unnecessary spaces
all tabs
unnecessary comments
Frontpage webbot tags
unnecessary elements within all kind of scripts
all end of paragraphs (Pro Version only)
all end of list items (Pro Version only)
unnecessary font tags (Pro Version only)
unnecessary font face names (Pro Version only)
all empty tag attributes (Pro Version only)
... and replaces:
large tags with smaller ones (Pro Version only)
unnecessary large characters with smaller ones (Pro Version only)
======================================
Now, like I said, I just tried it out 5 minutes ago on a simple test HTML file. The file was originally created by Dreamweaver 4.0 and had some minor manual editing done to it to clean it up a bit. It was realtively small, at 12K.
I ran HTML Shrinker on it and the new file size was 10K. Not bad. If used on a larger file I can certainly see how it would reduce page load time, disk space usage, and bandwidth usage.
The only problem I have found is that the "after" HTML is all, um, "scrunched" together. That's part of how it saves space. Removing spaces, tabs, etc. Working on this new HTML would suck. But, I could see how keeping the original HTML locally for updates, then running HTML Shrinker just before uploading, would be advantageous.
Am I missing anything?
-
Apr 11, 2001, 11:49 #2
- Join Date
- Feb 2001
- Location
- Van down by the river
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Check out this related post at http://www.sitepointforums.com/showt...threadid=20273
Creole makes a good point that xHTML specs will require quotes.
Personally, I wouldn't use anything to "clean up" my code for the above reason and others. When I include comments in my code, it's usually because I want to be reminded of what the code does and I'll use the comments for future development or debugging. I'd be curious to know what HTML Shrinker considers "unneccesary" and if you can set your own rules. In any case, I really don't want a program altering my code by removing tags and reformatting it. If I'm not always at the same computer, I can't rely on editing a local copy of the page, and I'll need to grab it from the server. I wouldn't want to view my code scrunched together. For large files, maybe there's a bit of a performance difference, but for shaving 2K off of a file - no thanks.
-
Apr 11, 2001, 11:51 #3
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
With the move towards xml and xhtml (admittedly slow move) it might be a bad idea to use somthing that removes closing tags as they are non-conforming.
Another disadvantage - and I tried shrinker myself - is the output code. When it say's it removes unnecessary spaces it doesn't mess around! ALL indenting and code spacing is removed. If you ever have to go back and edit your code it will be very very hard to try and work out what you did. I think it also removes comments.
If you have a complex base page that you think not going to change then it may be a good idea.
-
Apr 11, 2001, 13:11 #4
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Personally, I code with NotePad... typing everything out myself. So anything I put in there I usually have a reason.. I never have tons of spaces or tabs after my lines, so I would really have no use for that. And as stated before, I don't think you should not use quotes in your code. Always quote your attributes!
-
Apr 11, 2001, 13:42 #5
- Join Date
- Feb 2001
- Location
- Stockport, UK
- Posts
- 729
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Humanclay,
applaud="true"
-
Apr 11, 2001, 14:04 #6
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
icedogg...
that is why most of use use plain vanilla text editors. Because we don't want machines messing with our code.
In the HTML 5 (xHTML 1) rules are going to get MUCH stricter where it relates to formatted code. Like scrubz posted, I am very picky about my code, and even I my existing sites will have problems in xHTML.
1) All tags and attributes must be in lower case.
2) All values must be quoted.
3) All tags must be closed, including tags that we are not USED to closing. ie:
*** <option></option>
*** <BR> becomes <br />
*** <IMG src="blah.gif> becomes <IMG src="blah.gif></img> or <IMG src="blah.gif />
note...tags are made upper case for display only.
That ending slash is the important thing. That is a "shortcut" closing tag for certain tags that don't normally get closed such as <br> <img> and a few others. You can assure compatibility with older browsers by making sure there is a space between the last part of your tag and the ending bracket like the image tag above. Do you see the space before the last angle bracket?Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 11, 2001, 14:11 #7
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
HumanClay...
while I applaud your choice to code by hand, you are wasting time and losing out on KEY functionality by using NotePad.
It is crap.
* No Syntax highlighting
* no Line Numbering
* no Macros (one-key tags implementation)
* a terrible find and NO find and replace.
* no bulit-in templates
* no built-in support for ANY language
In fact...the only thing going for Notepad is the fact that it comes free with Windows. But even that is not a compelling reason to use it as you can get a FANTASTIC editor in the form of EditPlus (my fave) or TextPad for $30.
not trying to knock you at all, but I hate to see people wasting their time with tools that weren't made for the job.Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 11, 2001, 21:23 #8
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Creole,
I have EditPad... it doesn't do a lot of the features that you mentioned, but it works for me, as does NotePad. I've been meaning to go and download EditPlus for awhile now (I have a little note next to my computer to go download it - hehe) but I just keep putting it off. Right after I type this I will go download it and check that outI am just so used to typing stuff and and using copy/paste for those tedious table tags that I never bothered to try something else.
Does EditPlus work well for coding PHP?
-
Apr 11, 2001, 23:44 #9
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I love EditPlus.
It is fantastic. The line numbering is great.
Regarding html shrinker programs, there are also programs available that "unshrink" html. That is to say, they insert line breaks and indents so that it is easier for a human to read. Of course, it's not the same as before it was shrunk, but it is consistent.
Perhaps there is an html shrinker that'll unshrink too.
Humanclay, EditPLUS has syntax highlighting for PHP built in. It also has many other nifty php-related features. It recognises most php functions and reserved words, etc...Last edited by mmj; Apr 11, 2001 at 23:48.
[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
-
Apr 12, 2001, 06:33 #10
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Editplus is 'da BOMB!
by the way HumanClay (hehe, that rhymes)
I hope you don't think I was being rude...just trying to make helpful suggestions.
Yes it works great for PHP!Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 12, 2001, 07:25 #11
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, didn't think you were being rude. From all the posts you make on this board that I have read, I was assuming you were trying to be helpful
And thanks for reminding me to actually download EditPlus. Time to start using that instead of NotePad !
-
Apr 12, 2001, 07:27 #12
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
heh...good. I love to help, glad that it shows.
trust me on this one, once you have EditPlus, you will NEVER need to look for a new text editor again. Unless you buy a Mac and then you MUST purchase BBEdit!Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 12, 2001, 08:08 #13
- Join Date
- Aug 2000
- Location
- Thailand
- Posts
- 4,810
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Am a huge dw4 fan, but am beginning to do more and more php dev. Have tried textpad, 1st page and a few others, but not edit plus. Any chance of a link to the download guys, ya got me interested
H~The Artist Latterly Known as Crazy Hamster~
922ee590a26bd62eb9b33cf2877a00df
Currently delving into Django, GIT & CentOS
-
Apr 12, 2001, 09:10 #14
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
http://www.editplus.com/download.html
and it's only $30 buxAdobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 13, 2001, 11:58 #15
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
creole has me hooked now. It's well wort it. I recommend you download it
Now I just have learn how to use all of it's features
-
Apr 13, 2001, 12:32 #16
- Join Date
- Nov 1999
- Location
- Brisbane, Australia
- Posts
- 682
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
what about notetab i use that and i have tried editplus and notetab seems better and cheaper - http://notetab.com/products.htm ?
-
Apr 15, 2001, 03:40 #17
- Join Date
- Jul 2000
- Location
- Singapore
- Posts
- 2,103
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i tried editplus..but i rmeoved it =)
prefer something simpler. =)
anyway,
back to the subject, i wouldn't recommend you using html shrinker..not only does it look horrible, it doens't allow you total control over the code. as with previous posts have specified, it's totally against the web standards.
stay away form it. if all it does it neaten your code, fixes errors....you might consider that.."Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
Bookmarks