Tuesday, September 08, 2009

Duck Typing

So, in Python there's this concept of Duck Typing. First time I read about it (shortly after getting into Python,) I passed it off as a curiosity. No idea how to take advantage of the concept.

So now I'm taking a Java class (mostly because the Uni doesn't offer Python classes.)
import university

class Python:
    pass

university.CompSci.add(Python)
No not that kind of class!

Well, apparently in Java when you have a function that could just as easily work on int arrays as String arrays as float arrays, you need one copy of that function for each type. Which means in certain situations you have two otherwise identical functions (and I mean character-for-character identical, as in Ctrl-C, Ctrl-V identical, aside from the function signature.

So I'm just staring at this pair of functions now, and I really ought to be wrapping up the assignment, but I can't shake the feeling that this is wrong.

Sunday, September 06, 2009

Open Letter to all webcomic artists

And those with any other periodically updating website, and especially if it doesn't get updated on a regular basis.

Use RSS or Atom feeds on your website. If you have a webcomic, make a new entry for each new comic. Link directly to the comic. If possible and practical, inline the image directly into the entry.

Now, you don't have to roll a custom RSS feed. You could simply open a blog somewhere (Blogspot, Wordpress whatever floats your boat,) and drop a new post in when you update the comic. Hell, even Twitter would work

Now, why do I emphasize those sites that update infrequently? Nothing kills the mood like hovering over a bookmark and wondering to yourself "Is this even updated? Am I just wasting my time?" There are comics I read that update like clockwork and have no RSS feed. Glance at the clock and at a certain time chances of the site having been updated increases greatly. But there are others that post new pages seemingly at random. These comics actually have a special tag in my bookmarks: Sporadic. It exists especially for comics that are floating in the purgatory between irregular updates (which I check on Sundays) and comics that have been placed on Hiatus (which I check about every 6 months, and leave a note in the bookmark the last date/comic number I read.) I check this grouping of sporadic comics sporadically. A lot of them probably have more updates by now, but I can't remember where I left off. Shame really, since many are good.

Remember, with RSS feeds you subscribe and leave them alone, because they tell you when there is new content. You never have to look at an RSS feed and wonder if there's anything new (unless your feed is broken. Yeah, I'm looking at you Altermeta, your RSS updates, but something is wrong, new posts get inserted halfway down with bad publish dates.)

So there. Keep your readers. Bring them back regularly to bask in your stunning artistic prowess (and possibly some adverts,) build an RSS or Atom feed for your comic today.