Archive | GTD RSS feed for this section

Part I: Is There a Such Thing as Real World Haskell?

8 Sep

Part II:   How not to Start Your Haskell Program >

Here’s a bit of sardonic code, that I’d like to propose to any Haskell advocate out there.

data Works = Works | Does_not
computerApp a ::  Maybe a -> Works
computerApp a
     | isJust a = Works
     | otherwise = Does_not

I have been playing around with functional programming in Haskell.    I have to say that it has more than certainly improved my ability to code in other languages, and probably has reduced the number of bugs I have to fix after the fact.    On the other hand, it has driven me absolutely batty.

To be fair, I need to say that I am not a computer engineer.    I have a BA in English.    My Masters are in Public Administration and Information Management.      I engaged in Haskell code simply as a curiosity and a challenge.    I love math, and became curious about Monads and Lambda calculus.    I am probably not smart enough to be a great Haskell programmer.   However, I do understand two things.    1)  Not-smart-enough people can and want to participate in application development   2)  Coders, while making apps that do what they expect them to do, do not always understand (or care) about the sustainability and/or scalability of their code.

Web Development is an important test case.      Just about anyone, with a reasonable amount of time and effort, can learn to develop a website in PHP, probably supported by some content management system as Drupal or ModX.    Somewhere, their development goes overboard, the system does an upgrade to support some security risk or vulnerability, and ‘pop’ –>  all that likely un-documented and messy code goes nowhere and wheels need to be reinvented.

That’s why learning Haskell is probably a good idea.    Without getting into the code itself, it insists that a function always causes the same result to happen with any given input(s).    Once developed, the documentation pretty much always exists in a minimal form (via Type declarations).    So many bad habits would disappear if only people were forced into developing this way.

The problem, unfortunately, is that Haskell coding is confusing.     There is no popular development framework to use it.     Once you try to apply the examples provided in text books to real world development, things go wonky.    I won’t go into the many reasons why, but I do have an observation based on what I’ve seen in responses from various gurus to newbies like me.

It’s this ->   Users think computers do things.    Computer engineers think computers solve problems.     In Haskell terms, any interaction between users and engineers results in a type error.    Somewhere along the line, an IO() monad needs to be created to turn what engineers like about Haskell into something that users will like about it.

I would like to propose a management framework, similar to extreme programming, to manage the development of functional code for regular people.   While Programming it in Haskell is not a bad start, it uses a problem solving model, rather than a ‘how do you make the software do x’ model.    It focuses on mathematical abstractions rather than simple actions.     For instance, I would like to see a book that uses the development of a rogue-like rpg game in Haskell as an example.    Instead of worrying about efficient computation, abstractions about ‘laziness’ and recursive factorial examples, the writer would have to focus on managing complex (a tuple of a lists of tuples) types, worrying about random numbers and IO issues that are inherent to Haskell.   In approaching such a game, should I worry about creating newtypes first, or work from what I want main to do and fill in the gaps?

But while I make this suggestion, I really have no idea of what kind of advice I can offer your typical new-to-haskell coder.     But I have some hypotheses:

  • work from the main :: IO() first and build a framework of functions to develop your outputs.
  • possibly create type variables for each of your functions, making it equal in Type to a typical output you would like to see.    Then work backwards from there to create a lazy output, then involve possible recursion and so on.
  • use generic types (eg. Int, String, Char etc.) with comments first, then develop types to make your code more clear.
  • unit tests should include the System.IO.Unsafe module (cheating should be allowed when you are testing your code – let the learning happen when you are developing real code)

I’ll add what I can as I continue to learn more about coding in Haskell.    The bottom line is that I think more people should be coding in a language like Haskell, but they are unlikely to work with it if they end up spending a bajillion hours just to get it to choose randomly from a list of monsters (for example).   Especially when they can learn how to do the same in three minutes using an imperative language like Python.

For the greater good and more sustainable code overall, what high-level tips or approaches can you offer any newbie coders of Haskell, so they can develop without becoming absolutely bogged down in failure with their Haskell programs?

UPDATE:   After writing this, I found a great powerpoint tutorial by Graham Hutton that uses Hangman as an example of interactive Haskell code development.

Creative Commons Touque / Toque / Hat

16 Nov

I love knitting.   I love the Creative Commons.   I hope wearing this hat will get people asking me about what Creative Commons is.

Do you want to learn more about Creative Commons too?   Ok.  Try:

Also, I should make a note that the Creative Commons logo is not a creative commons licensed item.   I did ask permission to use it and got a ‘no – but do you really think we would want to put the resources into suing someone who is going to knit a creative commons hat with no intention to make a profit from it?’ response.   In short, if you want to make your own creative commons hat, you should do it in such a way that will not make the CC organization want to put resources into suing you.   They are an open organization, it shouldn’t be hard to figure out how to keep that from happening!

Michael Jackson and 5 Other Things I Do Not Care About

26 Jun

I love the man’s music. I have deepest sympathies for the family, especially his kids. But that’s where it ends for me. Michael Jackson’s death is a personal matter for those close to him. I really wish the media and all his so-called ‘fans’ would butt out — like one of the characters in Gates of Heaven (one of my favorite movies) says, “Death is for the Living.”

People appear to want to draw attention to so many things that I believe should be low on the totem pole of attention.   We have such short lives, why is it that we want to spend large quantities of it worrying about what Paris Hilton and Brittney Spears are wearing (or not wearing)?   It all makes me want to be more concious about what matters and in turn, to be concious about what does not matter.   Here is my list of things I am conciously deciding not to worry about.

Domestic Poverty

Domestic poverty is off my list for two reasons:   1)  I’d rather focus my attention on World Poverty and 2) Domestic Poverty is really a symptom of other equity issues such as support for mental health, access to child care, and equity, especially for those with disabilities.   In my view, Canada is a country with tonnes of opportunity, and sufficient infrastructure to ensure that a population will not starve.   This does not mean I will not donate to organizations like Feed Nova Scotia, but it does mean that my ears will shut off if you are trying to lobby on a platform of poverty.

Preserving Heritage

The key to this statement is preserving heritage.   I think heritage is important, but because it represents a living, breathing entity – not because it is old and needs to be protected.    What I value about my elders is not that they old, but that they have a story to tell.   Some things are historically valuable and need to be preserved, sure – but certainly not everything, and absolutely not everything at the expense of a living, breathing city environment.   Librarians know all too well that an old rusty copy of War and Peace will do nothing to protect the value of Leo Tolstoy’s work.    A new, fresh, exciting-looking copy will have people reading and re-reading the book —  that’s the way you protect heritage, by helping people re-live the past.    That means you weed the old and replace it with new.

Privacy

Don’t get me wrong.  I would never spy or harrass others or want to be spied or harrassed.   Nor would I ever breach a confidentiality policy of any employer I may work for past, present or future.   But, I feel that the wholesale protection of privacy is costing us immensely in terms of service, and therefore I am just not going to pay much attention to this issue.   The lack of progress in a wide range of services in the name of privacy is astounding, and I’m sure that an audit of government would show a huge amount of time and money wasted to prevent that one case where someone discovers prematurely that their wife or husband wants a divorce, or that their young daughter or son is using birth control.   So much of this information is already available on the web if someone wants to look for it anyway – I do not think we can pretend we have private lives for much longer.

Funding for Elite Sports

OMG!   Another country might have more medals than us at the olympics!  How will the next Sydney Crosby thrive if we do not put ourselves into massive debt to provide special facilities for sports?   “Who cares?” is what I say.

What I see in a good amount of even semi-elite sports is not pretty.   The level of single-minded “win at all costs and blame the ref when you don’t” attitude in many sports is astounding.   The things that mattered to the originators of the Olympic Games concept have been pushed aside.   Remember words and phrases like “sportsmanship?” “sound mind, sound body?” and how sports was tied to education?   That seems all out the window in favor of money-making.   I don’t believe in sports anymore.  It used to be an opportunity to think about myself as a better person, now it is a crass illusion that parallels rather than promotes “success.”    There are exceptions, where sports figures are respected for both mind and body (Steve Nash comes to mind), but that’s the exception and not the rule in my view.

“We Need More Funding For. . .”

Just the general premise that we will only solve problem x if our governments make problem x a priority and provide it with funds is just not going to resonate strongly for me.   I believe in some of the work that John McKnight has done around asset-based community development, and agree with the general position that professionals invent problems and issues inside communities that they can solve and then use the community’s funds to solve those problems when the community had the ability to cope with those issues all along.

Here is a librarian example.  A librarian does a study on university students searching only to discover what is the most obvious thing:  university students are not the same as librarians!   That is, students do not automatically use boolean operators or advanced searches to find materials for their research.   Said librarian then uses this information to justify training sessions (ie. hire more librarians) so university students can become more like librarians.   The thing the librarian does not ponder is whether university students need to behave like librarians to be successful at their research; nor does he/she consider the impact of increase education costs (caused in part through funds spent on librarians) on that student’s capacity to learn how to research more effectively.

In short, I really dislike any movement  that blindly asks governments to give organizations more money.   I do not think professionals do it on purpose, but it is a really bad habit that I see over and over again.      Communities need resourcefulness from their not-for-profits, not funding.    And most importantly, communities need not-for-profits that shine the light on what communities already do well, so they can encourage these behaviors.

Well, that’s my list of things I am going to conciously not spend anymore attention on.     What is your list of non-issues in your view?    Am I unfairly representing any of these issues?

Three Briefs About Your Web Presence

26 Jul

I had three brief things come to mind, neither of which really need a whole post to describe.   I’ve been thinking what works for a web presence in a Microblog world, and what real competitive advantages & disadvantages websites have over other media.

Are You Ready for Your Blog?

One of the things that is overstated about web-based promotion is ROI — the idea that you put little work into a website and return pretty good results nonetheless.   With blogs, this idea has become even more apparent since with typical WYSIWYG editors, you literally just have to type into a box to make a web post happen.

The institutional side of things, it’s not so easy.  This came up at the last 4th Thursday event, in fact.  When you open a blog for yourself, there is little to no brand associated.   You can pretty much use any template and away you go.  Institutions need to manage brands, reputation, target markets and quality assurance.   If you want your business or institution to be successful, it cannot look like every other blog.   As an individual, people can perceive you poorly and you can still have a successful blog.   Not so with an institution — if your library looks like a jerk, no one will show up to your branches.   Even though web presence has little to do with product/service development, people will associate poor writing on a website with the quality of a product or service.  Libraries cannot afford to have their services downgraded because of poor web content.  In short, you need to add a whole lot of editing, design and marketing time to the denominator of your ROI.

If you are institution, you need content before you establish your web presence.   A blog that has been doing nothing for a month will look bad.   Take a look at what happened to Google when they left their Google Librarian blog to sit for a while.   This does not work the same for individual blogs.   Go away for a month as an individual and people will just think you are on vacation or something.   Those same users will have higher expectations for your library, however.   If you want to start a blog, you need to commit 52 pieces of 800 words or better per year.   Then you need to manage spam, comments etc.   In short, add the costs of content creation and management to the denominator of your ROI equation as well.

In the end, the ROI is still going to look good — just not as good as most people assume.   If you do not put some time and money into the denominator of the ROI equation, the numerator will be zero — or worse, it will do damage to your library/company.

Thinking About Metrics — Total Time Viewing?

Television ads or well-placed bulletin boards are sure to find a good number of eyeballs, but how much time do you really have to get your message across to them?   More importantly, does your website offer a better alternative to these options?

Two popular ways to measure the effectiveness of a website are total visits, and time duration of visits.   Is it possible with typical statistics packages to estimate how much total time users access a website per month?   Yes.   Does it matter?  I am not sure.

For example, my statistics package (AWStats) will tell you the percentages & number of visits in each of the following time-duration categories:

  • 0-30s
  • 30s-2mn
  • 2mn-5mn
  • 5mn-15mn
  • 15mn-30mn
  • 30mn-1h
  • 1h+

A calculation of total time visited per month would be the mean of each category times the total visits that lasted each amount of time.   So, if you had 1000 visits in the 2mn – 5mn category, you might put (210 seconds * 1000 = 210 000 seconds or 3500 minutes or a little less than 60 hours total).   You would do that for every category, except for the 1hour + category.   Although you would definitely lose some numbers, I would remove the 1h+ completely from the list.   These durations almost always mean that someone left their browser running on this page, so the number aren’t really valid.

Then I would have pull two numbers from your stats.   The first is the total number of minutes per month that someone pulled from the sight.   The second is the total number of minutes in 30s-2mn, 2-5mn, & 5-15mn categories.   These are the categories that show the most engagement with a website (anything less could be a mistaken visit; anything more could mean the person was lost).

In the end, you can have an argument for your promotions people that you can expose your users to promotional content longer than other media.   This should shape how your make promotions on your website.

How Do People Come to Your Site?

Another misconception that many people have about a website is that a service merely has to “win the battle of priorities” and find its way to the front page of a website to get traffic.   The reality is something different.   Having a whole bunch of stuff on a front page merely gets people lost on the site.   You may get slightly more traffic to your page, but they might not be happy that they got there.   Further, you may, in turn reduce the traffic of all other pages in the mean time.   You really need to think about how people use your site before you “plop” something on a front page.

Some things people will immediately associate with your library.   These are the things that you should put on your front page.   Other things will be value-added services.   You have a logical pathway to these pages, but they should not take up the prime real estate.   THEN, you find excellent ways to ensure that these pages show up in Google and other search results.   Why?   Because if potential users do not immediately associate the service with your library, they are more likely to use Google instead.   Take advantage of common Search Engine Optimization techniques that can help you in this regard.

You can go further than this.   When I launched our website, one of the first complaints we had was that staff counted on the website to find simple things like the halifax weather, basic mapping, provincial catalogues etc.   My first reaction was “just Google it.”   But then I thought about how staff were using the site.   The website was part of their daily routine — they load up their operating system and then search the main links, most of which were already established on the website.

How are non-staff using the site?   I’d love to know.    Ideally, it would be great if key customers would have a library “visit” scheduled every Thursday morning, for instance.   In fact, I would be surprised if a few people had this exact routine.   Getting good data on this sort of thing could really help your respond to customer need on a website.   I’d like to see more of this kind of research in fact to go along with usability tests and statistics taking.

In the end, I think we still need more people thinking about web presence in all institutions.   The more librarians understand the technical benefits and limitations of the web, the more effective our services will be.

Dawn of the Dewey: What About A New Standard?

11 Jul

Tim Spalding of Library Thing has initiated an idea for an open source, crowd created replacement for the Dewey Decimal System called OSC.   On the whole, I am for starting anything.   I think entrepreneurialism like this is a good thing.   Competition of any kind cannot hurt the process of information organization — it makes everyone stronger, smarter and more productive.  There’s more discussion about it by Tim from this Wednesday’s Uncontrolled Vocabulary.

I do get a little up in arms when I hear pretentious snark about someone’s idea.    More of it was thought to appear on librarian.net, although it seems it may not have been snark after all?

Having skimmed over the forum, one of the concerns I have at the outset is that the ideas appear to be mimicing, rather than replacing the DDC.     I would like to see people using their minds more about this issue.   Mimicing is a definite no-no from an aesthetic point of view, and it makes me question what the point of such a replacement in the first place?   I say if you are going to do something new, make it new.   Make it noticeably 2008, rather than an updated 18-hundred-whatever.

The other issue I have is that thinking about book order in the abstract is quite different from action thinking.   Considering that this replacement will be largely about placing books on a relative shelf order, I think we should be developing that standard while actually shelving books.   So, here is my idea:

  • Go to your local public library’s catalogue and using any random selection process of your choice, place a hold on 20 or more books.
  • Put those books in a shelf order, that makes sense to you.
  • Try an alternative shelf-order.
  • One more alternative shelf-order.
  • Post those titles and shelf orders to the Library Thing forum on this issue
  • Explain how you came to these shelf orders, which one you liked the best and why.

Or you can do something else similar.   The broad point i want to make is that, if this thing is going to replace DDS, then it ought to be based on some sort of new foundations, hopefully considering not only what the user thinks, but how the user will eventually use the system.  The only way to get at how people use something is through action.

All in all, I love this idea and kudos to Tim Spalding for proposing it.    And by the way, he is looking for a leader for this project — someone who will facilitate the process without dominating it.   You got the guts?  Go for it!

Follow

Get every new post delivered to your Inbox.

Join 3,517 other followers