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
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?
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.
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.
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!
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:
*** <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?
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.
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 out :) I 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?
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...
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!
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 !
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!
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 :confused:
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 :D
what about notetab i use that and i have tried editplus and notetab seems better and cheaper - http://notetab.com/products.htm ?
i tried editplus..but i rmeoved it =)
prefer something simpler. =)
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..