News for hackers. Stuff that matters.

fholm

Re:OOP Isn't a Fundamental Particle of Computing on Wednesday November 14, 2012 @08:43AM (#4783225)
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.

Re:Bring Back the 40-hour work week (March 2012) on Wednesday November 14, 2012 @04:56AM (#4782728)
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.

Re:OOP Isn't a Fundamental Particle of Computing on Wednesday November 14, 2012 @04:03AM (#4782591)
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) -> ...
Re:Want good programmers? Then pay them. on Friday May 04, 2012 @07:05AM (#3927864)
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.

Re:My gripes with JavaScript on Wednesday June 22, 2011 @11:12AM (#2683449)
Very well put, pretty much agree with it completely.
Re:My gripes with JavaScript on Wednesday June 22, 2011 @10:40AM (#2683307)
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.
Re:My gripes with JavaScript on Wednesday June 22, 2011 @10:35AM (#2683296)
Yay a dynamic language with a compiler step.
Re:My gripes with JavaScript on Wednesday June 22, 2011 @10:23AM (#2683221)
I would not consider that a dream team considering the languages/libraries they have produced.
Re:My gripes with JavaScript on Wednesday June 22, 2011 @10:18AM (#2683192)
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.
Re:1Gbps fiber for $70—in America? Yup. on Sunday June 12, 2011 @01:48PM (#2646939)
God I love sweden, 100/100 dedicated for 16$/month (~100 SEK)
Re:Pratt Parsers: Expression Parsing Made Easy on Sunday March 20, 2011 @11:40AM (#2346478)
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