fholm's comments

fholm | 13 years ago | on: OOP Isn't a Fundamental Particle of Computing

The language is F#, basically the code does this:

1) Creates a type which is a discriminated union called Color, that can have three different values (RGB, HSV or CMYK).

2) Defines a function which converts a color of any value (RGB, HSV or CMYK) to HSV.

The argument, although implicit, from me was that even though this can be easily represented using OO, this approach is far cleaner and easier to read (once you know the syntax and concepts obviously - but that can be said for any language), and that the poster above me saying that the benefits of a "good abstraction" becomes apparent implying that this good abstraction can only be supplied by OO, which is not true.

The OO representation would either be one class called Color which always stores it values in one format (say RGB), and then have get/set:ers for manipulating it as CMYK, RGB or HSV. The other way would be an abstract base class called Color which subclasses ColorRGB, ColorHSV, ColorCMYK, etc.

fholm | 13 years ago | on: Bring Back the 40-hour work week (March 2012)

Again I love my country (Sweden). There are multiple laws in place that forbid companies to force people to work more then X hours per week/month/year.

There's several different averages across days, weeks and months that control how much "overtime" you're allowed to work. The max is 200 hours per year though.

It obviously varies, and not everyone follows these laws, especially in (game) development, etc. As long as you the employee agrees to working over time (often uncompensated) none is going to bat an eye. The important thing is that you have a law that will back you up incase your company is trying to force you.

fholm | 13 years ago | on: OOP Isn't a Fundamental Particle of Computing

You mean like this? :)

    type Color 
        = RGB of int * int * int
        | HSV of int * int * int
        | CMYK of int * int * int * int

    let toHsv = 
        function
        | HSV(h, s, v) -> HSV(h, s, v)
        | RGB(r, g, b) -> ...
        | CMYK(c, m, y, k) -> ...

fholm | 14 years ago | on: Want good programmers? Then pay them.

I'm late to the party, so this is probably not going to be read by anyone, but here's my 0.02$

> Some of the comments in this thread bother me, particularly the 30 days paid vacation a year. In Europe maybe. In the US? Good luck.

What's so wrong about 30 days of paid vacation per year? I have 30, I know some (rare though) people that have even more (40+). I work to live, not the other way around.

> Never working more than 40 hours a week nor staying late? It just smacks of entitlement. I'm not saying you need to kill yourself for the company but it really is a two-way street.

For me, as a someone from Europe (Sweden) this is among the most stupid things I've heard, is it entitlement just because I work as much as my job pays me for? The agreement you sign (usually) says 40 hours per week, 8 hours per day 5 days a week. If they want me to work more, then pay more?

And before anyone from the states try to say anything about the economy in Europe and it suffering because people don't work as much, etc. Yours is so much further down the drain we lost sight of it.

fholm | 15 years ago | on: My gripes with JavaScript

I'm not a fan of CoffeScript, it fixes the wrong problems. It's not the syntax that's the REAL issue, it's the fragmentation, lack of module system, etc.

fholm | 15 years ago | on: My gripes with JavaScript

I'm well aware of js.next/harmony/whateveryouwannacallit. Come back to me in 10 years when it's implemented everywhere and everyone that was on an old version of browser X has upgraded to one with those features.

fholm | 15 years ago | on: Pratt Parsers: Expression Parsing Made Easy

I love Pratt parsers (or Top Down Operator Precedence parsers rather), I recently re-wrote the IronJS lexer and parser by hand (from using one generated by ANTLR) using the techniques described in this blog post and saw some pretty hefty performance increments http://ironjs.wordpress.com/2011/03/19/new-lexer-and-parser-...

Edit, I also have a generalized version that can take pretty much any input and any output (F#) here: https://github.com/fholm/Vaughan

page 1