Monday, December 13, 2010

ObjectIcon HttpServer without minify-me

Here are a few notes on code in ObjectIcon 2.4 httpclient.icn and related files.
class HttpClient(NetClient)

# and in netclient.icn

class NetClient(Connectable, SetFields)

# in connectable.icn
package util

class Connectable()
My first thought is that Connectable - with no parents, no imports, would have served so much better as a Trait in a traits package. Here is the top of setfields.icn
package util

import lang
With that import, would SettableFields be a Trait?  Here is the head of that class
class SetFields()
   #
   # Generate the {Field}s for the given list.  Note that the list is
   # emptied by this function.
   #
   public static generate_fields(l)
Field is a class found in the same file.  But the problem lies in the last method of generate_fields with
suspend Field(attr, val)
Now we do not have a trait.  And then there is non-documenting code  (really not Icon-esque in 2010 ) which should at least have been
public static generate_fields( lst )
because this is not minify-me JavaScript at Google or Yahoo or qtask.com or...

This is not some stylistic quibble: in open-source code this can be decisive.  Style guidelines count as a matter of quality code.  Quality does matter.

No comments:

Post a Comment