12-12-2008, 03:01 PM | #1 |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Some horrible and outrageous examples of disgraceful coding
I tried to start a new [non-baen] sci-fi novel today, by an author I like. The previous ones in the series were very good. But the formatting was sufficiently bad on this one that it distracted me from my reading. So I ... um ... managed ... yes ... to extract the original html with a view to clean up the layout a bit.
Its usually quite easy to strip out the bad, and replace it with my preferred style. I normally make an initial couple of runs through 'html tidy' both to find potential problems, and to 'normalize' the html, thus making global edits easy. This time however, 'tidy' laughed so hard that after chucking out nearly 5k warnings and errors it barfed. Now I'm no html coder or design artist, I'm a sysadmin with scripting skills. However, when I took a closer look I thought that I would just have to share some examples of the mess that I found. Why spoil a perfectly good ebook with this crap? ... (I've used a horrid color for the examples because they deserve it.) Example 1 "How not to code": <p class="tx"><div style="text-indent: 1em; text-align: justify"><font size="3">Paragraph text paragraph text</font></div></p>
<div style="margin-top: 1em"></div><p class="ls2"><div style="text-indent: ; text-align: center"><font size="5"> </font></div></p><div style="margin-top: 1em"></div>
<div style="margin-top: 3em"></div><p class="ctag1"><div style="text-indent: ; text-align: center"><font><span class="bold"><span class="italic">CHAPTER</span></span></font></div></p> <p class="cn"><div style="text-indent: 4em; text-align: center"><font size="6"><span class="bold"><span class="italic">THREE</span></span></font></div></p><div style="margin-top: 4em"></div>
<div style="margin-top: 2em"></div><p class="cotx"><div style="text-indent: ; text-align: justify"><font size="3"><span class="dropcap"><font size="7"><span class="bold">T</span></font></span>ext para text</font></div></p>
Snowman (with assistance from N. Molesworth, esq.) ---------------- Now playing on Winamp: Les Patineurs Last edited by Snowman; 12-12-2008 at 03:03 PM. Reason: add to sig line |
12-12-2008, 03:05 PM | #2 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
dear god, i wish i hadn't seen that code, i think it's going to give me nightmares.
|
Advert | |
|
12-12-2008, 03:08 PM | #3 |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
|
12-12-2008, 03:11 PM | #4 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
it's okay, i blame the original coder, not you.
|
12-12-2008, 03:17 PM | #5 |
Hi There!
Posts: 7,473
Karma: 2930523
Join Date: Feb 2008
Location: Ft Lauderdale
Device: iPad
|
I will stride across their keyboards, raining down fire and heck upon their wrist braces, wondering why coders always taste like french fries, zapping them with my mighty magnets, reeking havoc upon their prized possessions by opening the Star Wars action figure packages, causing their pens to bleed all the way through the puny pocket protectors, no firewall will defend against my fury ...
|
Advert | |
|
12-12-2008, 03:39 PM | #6 | |
Reticulator of Tharn
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
-Marshall |
|
12-12-2008, 04:02 PM | #7 | |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Quote:
And lets face it, for novels on a mobile reader, the vast bulk is simply <p>text</p>. With a bit of css to set my preferred indent and margin-top (10px, 25px) its a easy job mostly - especially now I am aware of the various idiosyncrasies of the mobi format and its varying implentations. Mind you, I do hope the original mobi designers are having to endure endless torment. What were they *thinking*? Actually, don't answer that. I don't think that I want to know. Snowman |
|
12-12-2008, 05:03 PM | #8 |
DSil
Posts: 3,201
Karma: 6895096
Join Date: Sep 2007
Location: Hants, UK
Device: Kindle, Cybook
|
I have seen such hideous HTML. On one occasion I tracked it back to someone using MS-Word, but not understanding the concept of styles, so they created what they could by setting, for instance, headers as normal text, but bold, larger etc. They then just used save as HTML. Essentially, they didn't know any better and the well-know software dumbly did the rest of the damage.
So, I wonder how much is down to "cock-up rather than conspiracy". Especially with publishers cutting corners and getting rid of some of the subbing stages that might have cleaned things up. |
12-12-2008, 05:12 PM | #9 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
heh. ms word code is what first came to my mind as well. or poorly designed wysiwyg interfaces used by people who have no idea how to code. i agree it's probably incompetence but it's still pretty inexcusable. it's not that hard to do it right. publishers should make an effort.
|
12-12-2008, 05:15 PM | #10 | |
WWHALD
Posts: 7,879
Karma: 337114
Join Date: Sep 2008
Location: Mitcham, Surrey, UK
Device: iPad. Selling my silver 505 here
|
Quote:
|
|
12-12-2008, 05:17 PM | #11 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
i'm not sure whether to be relieved or disappointed that you can't remember the url.
|
12-12-2008, 05:24 PM | #12 |
DSil
Posts: 3,201
Karma: 6895096
Join Date: Sep 2007
Location: Hants, UK
Device: Kindle, Cybook
|
Perhaps predictably, I'm getting a related advert...
|
12-12-2008, 05:40 PM | #13 | |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Quote:
Oh well, that's technology for you. At least none of the digital clocks in my house constantly flash "12:00." Snowman |
|
12-12-2008, 05:41 PM | #14 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
|
12-12-2008, 05:52 PM | #15 | |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Quote:
And then what's wrong with vi? I hate to think how many mb of code I've written or corrected with that, or indeed some other line-based mainframe editors. Coders these days. I used to walk uphill to work, in the snow, both ways ... Snowman |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Seriously thoughtful Coding Help Requested | poohbear_nc | Lounge | 10 | 08-24-2010 10:42 AM |
Kindle 1 selling for outrageous prices on eBay | angelbleu | Amazon Kindle | 15 | 11-23-2009 03:16 AM |
Sony 1$=1€ E-reader policy is outrageous | pampalini | Sony Reader | 21 | 08-28-2009 05:27 PM |
python coding... | alexxxm | Sony Reader | 8 | 01-31-2008 12:25 PM |
Outrageous Pricing | mrsp | Bookeen | 39 | 10-31-2007 06:37 AM |