Archive for the 'Uncategorized' Category

03
Feb
08

Update

Long time no blog. These are the things that happened lately.

  • School started after 3-month lecturer strike.
  • Completed MSC
  • Polished Hulz
  • Started a new project: Rub
  • Lost most of the sources for my fun/hobby coding in a HDD crash (As it happens, I do not backup those)
  • Started reading CLR via C#.
  • Started reviewing IronRuby sources.
  • Started reviewing Rotor (shared CLI) sources (oh boy).

I’ll post if I find anything interesting.

You could also check my new blog, in which I reserve the right to write (no pun intended)  in  Hebrew.

31
Dec
07

Imperative and Declerative

Some time ago, satisfied with my Algoliness, I found out that Haskell, LISP people seem a bit more intellectual, a bit more more academic. They seem to behave like they know something no one else knows. Well, they knew about grocery lists.

The Differnce

How do you iterate over a list of 10 items?

Imperative:

  1. create a temp variable i = 0
  2. loop:
  3. use THAT to process it
  4. advance,
  5. is end?
  6. terminate / return to loop.

Declarative:

  • Make me a list from 1 to 10. Use THAT to process each.
  • So the first one is imperative, just as the name suggests. Its a grocery list, and you’re the one doing the shopping. In every step of the way you’re telling the compiler what to do. Its far from the concept we’re trying to realize.

    The second one is declarative, its essentially the concept itself. Make me a list, you do the shopping. Why not let the compiler worry some more?.

    And that is the reason for the personality those people adopt. They don’t just act like they know better, they really do. They’re programming much closer to the concept.

    In a way this is somewhat like the difference between C and Assembly. You can conceptualize and write ‘if’ clauses, and you can code it out with jmps and cmps.

    Sidenote: Recursion Is Hard?

    While analyzing recursion, if you loose track, you sink. However I’ve long learned to use the “leap of faith” with recursion, because I had to – that was the only way to not sink. Originally read from a Prolog book, the “leap of faith” means “because its abstract, you should not pick into the detail”. Trust the recursion and you’ll curse away the evil.

    29
    Nov
    07

    Coderev: Genghis WindowSerializer

    Genghis is a set of extensions built on top of .NET and integrated with WinForms to provide application-level services in the same flavor as the Microsoft as the Microsoft Foundation Classes. This project seems a bit dead, and a bit buggy. However its a great repository of wisdom, since some cool people work or have worked on it.

    Starting off with WindowSerializer, this is a cool way of doing a .NET component. When you drop it on your form, it will plug into its OnClose, OnLoad, OnResize and OnMove events, as well as nick itself the form instance variable.

    When the form fires any of these events, the WindowSerializer will record the change, and when OnClose is fired, it will flush its state to disk. When OnLoad is fired, it would load that state and update the form’s properties as needed.

    They tried to provide some sort of Strategy/Provider pattern, so you can choose what kind of storage you use for the form settings, defaulting to Isolated Storage
    . I found some of the code they used there confusing. Some variables were not used at all, I think they were some ‘just in case’ code. Specifically I’m referring to the path idiom they used.

    private string ValidatePath(string path, string argumentName)

    Here, argumentName was never used in the function body. Also, path, which is seen here and previously being passed to the ctor, moved around in 4 places in the code, isn’t actually used for anything, which render this method and perhaps other path-handling methods useless.

    What I would do, is provide an abstract class like they did, but leave all those path or logical setting separation out:

    • Instantiate with the FQN for the form name
    • The abstract class will contain the get/set property convenient methods, abstract “‘main” get/set methods and abstract Serialize/Deserialize methods
    • The implementing object is a data object.
    • Which could use .Net serialization, to Isolated Storage, if we decide to use XML. Or our own if we implement a registry based serialization
    19
    Oct
    07

    First Post

    Here’s a much needed description of my interests:

    • UX
    • Agile/Pragmatic
    • Programming Languages
    • Hardware

    Hopefully, this blog will actually last.

    19
    Oct
    07

    Hello world!

    Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!