Ivan Krivyakov's Blog

Premature optimization is the root of all evil

July 20, 2008

F#: Must fully qualify class members, even inside the class

It is not the end of the world, but somewhat annoying: class members must always be referred by their fully qualified name, even inside class methods:

type Foo =
 class
  static member Method(x) = ...
  static member Field = ...
  member self.FooBar() =
    Method(42) // won't work: "constructor Method is not defined"
    Foo.Method( Field ) // won't work either
 end

Boolean operations in F#: spec gone bad

The F# language specification does not talk much about Boolean operations, but it does say that ~~~ is op_LogicalNot and &&& is a “bitwise and”, also called land. The && operator is said to be an “address-of” expression.

In reality if ~~~condition does not work: it complains that bool does not define operator ~~~. What works is if not condition.

If if a &&& b does not work either. What works is if a && b. So much for the address-of operator. I am not sure why it is not possible to keep the spec straight and why I should second-guess such simple things…

July 9, 2008

The Spiral of Progress, or All New Is Actually a Thoroughly Forgotten Old

I am reading a book on WPF (“Programming WPF” by Chris Sells if you want to know), and it says that storing “behavior” and “look” in two different places is a good idea, and this is where XAML files come in. It is a little funny how an idea of having a “graphical resources” file comes on and off with a period of several years [read more...]

My hard drive is fried

My old 80GB Maxtor D740X-6L is kaput. He was 6 years and 4 months old. May he rest in peace.
[read more...]

July 3, 2008

Original XP install CD does not understand SP2 NTFS partition

My computer crashed today and would not reboot. I.e. windows starts booting and then says it cannot find c:windowssystem32configsystem file. It suggested to boot from the install CD and use the repair console, which I did. Then I was up for a surprise.
[read more...]

WPF Initial Focus

A violation of rule of least astonishment: in Windows Forms the focus is automatically set to the first element in tab order. In WPF (and in ASP.NET) it’s not the case. You need to specify the initial focus element explicitly.
[read more...]

WPF : Renaming the Main Form

Finally, after reading books about WPF I started to actually work with it. As usual, I start with complaints :-) It turns out that renaming a WPF form, especially main is a) inevitable and b) tedious.
[read more...]

July 1, 2008

FLAP: the Four Letter Acronym Proliferation

It used to be LAN, WAN, SAN, COM, DOM, ROM, TCP, UDP, FTP, CPM, IBM, JVM, then URL, XML, UML, … But it looks like the era of the TLAs is over. After all, there are only 17,576 possible combinations of three English letters, and this is definitely not enough.

So, welcome to FLAP. There used to be a couple of lone warriors like LISP and ISDN, then we’ve got HTML, SOAP, OLAP, MSDN, FQDN, ASDN (well, I made this one up, but then found out it actually does mean something), and now it’s a deluge. Everything I look at is a FLAP. WSDL, BPEL, BPMN, WSCI, …

Well, hopefully ~446K combinations ought to be enough for everybody :-)