Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > Miscellaneous > Lounge

Notices

Reply
 
Thread Tools Search this Thread
Old 12-12-2008, 04:01 PM   #1
Snowman
Connoisseur
Snowman doesn't litterSnowman doesn't litter
 
Posts: 97
Karma: 196
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3
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>
  • One does not embed a <div> in a <p>, as any fule kno.
  • Why force justification and text size on me?
  • This layout formed most of the paras, hence the error count.
Example 2 "How not to achieve a line break":
<div style="margin-top: 1em"></div><p class="ls2"><div style="text-indent: ; text-align: center"><font size="5">&nbsp;</font></div></p><div style="margin-top: 1em"></div>
  • or to put it another way: <br><br> or possibly <br><br><br>
Example 3 "The Revolting Chapter Header":
<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>
  • *Shudder*
  • And screaming the whole thing at me IN BOLD CAPS just makes it that much worse.
Example 4 "Continue to annoy your readers":
<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>
  • This forces the first character of a paragraph to GIANT BOLD, and looks revolting.
  • I'm happy enough seeing a discrete drop cap, slightly enlarging the first word word of the first para in a chapter, or even capitalizing it. But this is beyond the pale. IMNSHO.
I've found some egregious html examples in a few other ebooks, but I think I have vented more than sufficient spleen for this post!

Snowman (with assistance from N. Molesworth, esq.)
----------------
Now playing on Winamp: Les Patineurs

Last edited by Snowman; 12-12-2008 at 04:03 PM. Reason: add to sig line
Snowman is offline   Reply With Quote
Old 12-12-2008, 04:05 PM   #2
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
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.
zelda_pinwheel is offline   Reply With Quote
Old 12-12-2008, 04:08 PM   #3
Snowman
Connoisseur
Snowman doesn't litterSnowman doesn't litter
 
Posts: 97
Karma: 196
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3
Quote:
Originally Posted by zelda_pinwheel View Post
dear god, i wish i hadn't seen that code, i think it's going to give me nightmares.
Sorry about that
Snowman is offline   Reply With Quote
Old 12-12-2008, 04:11 PM   #4
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
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.
zelda_pinwheel is offline   Reply With Quote
Old 12-12-2008, 04:17 PM   #5
DixieGal
Hi There!
DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.DixieGal ought to be getting tired of karma fortunes by now.
 
DixieGal's Avatar
 
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 ...
DixieGal is offline   Reply With Quote
Old 12-12-2008, 04:39 PM   #6
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Snowman View Post
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.
Mobipocket? Their pure-formatting HTML variant pretty much makes it a write-only format...

-Marshall
llasram is offline   Reply With Quote
Old 12-12-2008, 05:02 PM   #7
Snowman
Connoisseur
Snowman doesn't litterSnowman doesn't litter
 
Posts: 97
Karma: 196
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3
Quote:
Originally Posted by llasram View Post
Mobipocket? Their pure-formatting HTML variant pretty much makes it a write-only format...

-Marshall
Yes. However, I've reformed or created >100 ebooks so that they look good on my cybook, and normally it is quite easy, especially with a decent editor that supports regex with backreferences. Where the original html is available (thanks, baen!), there is very little effective difference between that and the calibre'd mobi.

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
Snowman is offline   Reply With Quote
Old 12-12-2008, 06:03 PM   #8
LazyScot
DSil
LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.
 
LazyScot's Avatar
 
Posts: 3,195
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.
LazyScot is offline   Reply With Quote
Old 12-12-2008, 06:12 PM   #9
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
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.
zelda_pinwheel is offline   Reply With Quote
Old 12-12-2008, 06:15 PM   #10
ShortNCuddlyAm
WWHALD
ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.ShortNCuddlyAm ought to be getting tired of karma fortunes by now.
 
ShortNCuddlyAm's Avatar
 
Posts: 7,881
Karma: 337114
Join Date: Sep 2008
Location: Mitcham, Surrey, UK
Device: iPad. Selling my silver 505 here
Quote:
Originally Posted by zelda_pinwheel View Post
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.
I wish I could remember the URL - I used to know a website done entirely in MS Word by some-one who claimed to be a professional web designer. It would have made you laugh. It also would have made you cry.
ShortNCuddlyAm is offline   Reply With Quote
Old 12-12-2008, 06:17 PM   #11
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
Quote:
Originally Posted by ShortNCuddlyAm View Post
I wish I could remember the URL - I used to know a website done entirely in MS Word by some-one who claimed to be a professional web designer. It would have made you laugh. It also would have made you cry.
i'm not sure whether to be relieved or disappointed that you can't remember the url.
zelda_pinwheel is offline   Reply With Quote
Old 12-12-2008, 06:24 PM   #12
LazyScot
DSil
LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.LazyScot ought to be getting tired of karma fortunes by now.
 
LazyScot's Avatar
 
Posts: 3,195
Karma: 6895096
Join Date: Sep 2007
Location: Hants, UK
Device: Kindle, Cybook
Perhaps predictably, I'm getting a related advert...
Attached Thumbnails
Click image for larger version

Name:	ad.JPG
Views:	156
Size:	23.0 KB
ID:	19119  
LazyScot is offline   Reply With Quote
Old 12-12-2008, 06:40 PM   #13
Snowman
Connoisseur
Snowman doesn't litterSnowman doesn't litter
 
Posts: 97
Karma: 196
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3
Quote:
Originally Posted by LazyScot View Post
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.
Could be, although I didn't see the usual plethora of "meso-x" entries. However the chapter heading stuff (I really can't call it code) changed partway through, to multiple 'blockquotes' in strange and un-natural places, presumably to try and control indentation.

Oh well, that's technology for you. At least none of the digital clocks in my house constantly flash "12:00."

Snowman
Snowman is offline   Reply With Quote
Old 12-12-2008, 06:41 PM   #14
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
Quote:
Originally Posted by Snowman View Post
Oh well, that's technology for you. At least none of the digital clocks in my house constantly flash "12:00."

Snowman
zelda_pinwheel is offline   Reply With Quote
Old 12-12-2008, 06:52 PM   #15
Snowman
Connoisseur
Snowman doesn't litterSnowman doesn't litter
 
Posts: 97
Karma: 196
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3
Quote:
Originally Posted by zelda_pinwheel View Post
heh. ms word code is what first came to my mind as well. or poorly designed wysiwyg interfaces ...
Bring back Wordstar. That's what I say.

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
Snowman is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seriously thoughtful Coding Help Requested poohbear_nc Lounge 10 08-24-2010 11:42 AM
Kindle 1 selling for outrageous prices on eBay angelbleu Amazon Kindle 15 11-23-2009 04:16 AM
Sony 1$=1€ E-reader policy is outrageous pampalini Sony Reader 21 08-28-2009 06:27 PM
python coding... alexxxm Sony Reader 8 01-31-2008 01:25 PM
Outrageous Pricing mrsp Bookeen 39 10-31-2007 07:37 AM


All times are GMT -4. The time now is 02:42 AM.


MobileRead.com is a privately owned, operated and funded community.