Hacker Newsnew | past | comments | ask | show | jobs | submit | 2010-12-12login
Stories from December 12, 2010
Go back a day, month, or year. Go forward a day, month, or year.
1.Staging Servers, Source Control & Deploy Workflows, And Other Stuff (kalzumeus.com)
330 points by revorad on Dec 12, 2010 | 54 comments
2.The frontpage with a threshold of 100 points (news.ycombinator.com)
256 points by pg on Dec 12, 2010 | 110 comments
3.What's really wrong with BlackBerry (mobileopportunity.blogspot.com)
248 points by macrael on Dec 12, 2010 | 74 comments
4.SimpleCDN has been effectively kicked off the Internet by its ISPs w/o warning (simplecdn.com)
125 points by archon810 on Dec 12, 2010 | 86 comments
5.10% unemployment yet every startup in NYC struggling to hire (jonsteinberg.com)
116 points by jonsteinberg on Dec 12, 2010 | 178 comments
6.Why choose Tropo over Twilio (diggz.org)
110 points by blitzo on Dec 12, 2010 | 98 comments
7.I Miss Lisp (technicat.com)
99 points by DanielRibeiro on Dec 12, 2010 | 66 comments
8.Ask HN: What is a monad?
100 points by Azuldolphin on Dec 12, 2010 | 43 comments
9.Wondering if you are getting a CR-48? Look for your zipcode here. (pastie.org)
84 points by peregrine on Dec 12, 2010 | 80 comments
10.Pornoscanners trivially defeated by pancake-shaped explosives (boingboing.net)
84 points by panarky on Dec 12, 2010 | 36 comments

Monads are red herrings, if what you're interested in is getting started with functional programming (or even Haskell specifically). It's an unfortunate flaw in the Haskell literature that makes it seem like you have to grok monads to learn Haskell; you don't.

Monads enable syntactic sugar. If you're getting started with Haskell, you'll notice that when you write code that does I/O, you use a weird imperative-looking syntax ("do notation") that looks different to the normal functional style:

    main :: IO ()
    main = do
      putStrLn "Please enter your name"
      name <- getLine
      putStrLn ("Hello " ++ name ++ "!")
'putStrLn "Hello"' doesn't actually print anything; it returns an IO value that, when interpreted by the Haskell runtime, prints something: that interpretation takes place when 'main' is run. The do notation is syntactic sugar for creating a sort of compound IO value that interprets as a bunch of actions rather than just one. The reason you can use do notation for IO but not for (all) other Haskell code is that IO values are monadic (which is another and possibly more useful way of saying "IO is a monad"): that just means that they behave in a certain way when combined (to produce that compound value) and obey certain laws to make the do notation well behaved.

Monads are a design pattern to abstract away repetitive functional code. For example, if you write a lot of pure-functional code you sometimes end up having to pass around a 'state' parameter. If a function reads or writes from the state, then any function that calls it has to pass in the state, and so on. This leads to a lot of functions with an extra state parameter, many of which don't even care about the state except to pass it down the call tree. An improvement would be to write a higher-order function which took a function which didn't care about state and wrapped it to produce one that just passed the state through. The State monad encapsulates this wrapping and lets you clean up the rest of your code.

Monads are what's between the lines of an imperative program. Bourne shell scripts have the default error-handling rule that they ignore failing commands unless it's the last one executed, or put another way, they run in a monad that ignores errors:

    cat nonexistent.txt   # prints an error message
    echo Done.            # still executes, prints "Done."
    # script returns success
But you can tell it to run instead in a monad which stops after the first error:

    set -e                # change the monad, i.e. the error-handling rule
    cat nonexistent.txt   # prints an error message
    echo Done.            # never runs
    # script returns failure
Old-school Visual Basic has the opposite default, but you can make it behave like a shell script with "ON ERROR RESUME NEXT". Yes, VB had monads.

Monads are a specific example of higher-kinded polymorphism, which is a very powerful and useful concept that's starting to enter the programming mainstream (examples are template concepts in C++ and LINQ in C# and .NET). Parametric polymorphism (List<String> in Java and C#, etc) means you don't have to write a 'reverse' function that works on lists of strings, and another 'reverse' function for lists of ints, etc; you can just write a generic reverse function that works on lists of any kind, because it doesn't need to know the details of the contained type, just how to iterate over a list. However, if you want to reverse an array, you still have to write a new 'reverse'. If your language supports higher-kinded polymorphism, you can write a generic reverse function that works on any kind of container, because all it needs to know is that the container has some well-behaved method of iteration.

(The LINQ example is a bit more subtle, because C# doesn't support higher-kinded polymorphism, but LINQ is a hard-coded exception to that rule. The cool LINQ syntax works for any type which provides certain operations and behaves in a certain way - which just happen to coincide with the requirements for the type to be monadic.)

12.Oracle VP: “We have a strategy to run Java inside a Javascript environment” (cemerick.com)
74 points by pepijndevos on Dec 12, 2010 | 55 comments
13.Sorting Algorithm Animations (sorting-algorithms.com)
69 points by drawkbox on Dec 12, 2010 | 18 comments

Um... I disagree. I worked for a large company that does just that: hire liberal arts majors with high gpas and teach them to program. It works, well, horribly. Ask any former employee about the code quality at epic systems.
15.Procedural Building Generation in Unreal Engine 3 (epicgames.com)
65 points by grinich on Dec 12, 2010 | 20 comments
16.Sam Ruby, Brendan Eich, and Jeremy Ashkenas on CoffeeScript and "JS-next" (intertwingly.net)
65 points by sstephenson on Dec 12, 2010 | 17 comments

"Fortunately, [...] a SpyHunter fan [...] had extracted the sound effects himself and put up WAV files on his web page."

"I wanted to give the guy a game credit [...]. The publisher refused....their legal team were already writing up a cease-and-desist letter ordering him to remove the assets from his fan page."

Guy saves the day and instead of a cookie he gets a CnD letter. Do things really have to work this way?

"But you have to defend your trademarks or they become worthless!" Right, because the publisher would have been so much better off if those WAVs wouldn't have been out on the Internet in the first place.


It's because "every startup" is lazy and afraid to take risks. In the programming world, for example, everyone wants to hire someone who has 150 years of experience with each of C, C++, Java, C#, Perl, Python, Ruby, OCaml, Haskell, and node.js. Problem is, that is not possible. So the position goes unfilled.

If programming shops were willing to hire people fresh out of college with English degrees and teach them programming, they would probably do really, really well. But nobody is willing to do that, so college grads go without jobs and startups go without employees.

(Also, startups expect you to really drink that Kool-Aid. They want you to work 12 hour days, skip weekends, not take vacation, and "be loyal" to the company. Why would anyone do that when they can work 9-5 for 4x as much money at an investment bank?

Ironically, even the investment banks can't hire anyone, but that is for other reasons.)

19.When Free Software isn't better (mako.cc)
61 points by vu3rdd on Dec 12, 2010 | 45 comments
20.Show HN: Flattehn: A Chrome extension to hide points / users until you've voted (chrome.google.com)
61 points by Groxx on Dec 12, 2010 | 37 comments
21.On C Linked Lists (Profiling and Optimizing) (ozlabs.org)
60 points by djcapelis on Dec 12, 2010 | 31 comments
22.The danger of having system programmers around (utcc.utoronto.ca)
60 points by preek on Dec 12, 2010 | 28 comments

I hope that's the case, honestly, and I hope that it does go to court. I'm frankly sick and tired of the 'unlimited' advertising model, wherein unlimited really means limited to some arbitrary amount that is not disclosed.

As a customer who has been kicked off of a number of unlimited hosting services for a site that only does ~30Gb or so in traffic in a month, I'd love to see hard limits advertised rather than 'unlimited'.

I know that Dreamhost oversells on purpose, and that's fine, but I think they can still do that (though perhaps not quite as effectively) by just stating their upper limit. Of course, this means that more people are likely to hit or approach that upper limit, but at least they'll know when they need to grow into another 'slice' as it were, or whether or not to relocate from Dreamhost altogether.

24.Original Macintosh Business Plan: July 12, 1981 (computerhistory.org)
58 points by gatsby on Dec 12, 2010 | 11 comments

This reminds me of what my electrical engineering friend once did when his washing mashine stopped working. He got out his multimeter, opened up the back panel, and finally traced everything to an open circuit: the lid was open.

Perhaps the reason startups are struggling to hire in NYC is not because there are too few hackers but because there are too many startups. Most hackers simply do not have aspirations to work 80 hours a week to make some MBA jackass rich off of his website which promises to revolutionize the world for apartment brokers, attempt to make print media relevant online, or sell last year's handbags at a discount.
27.Dieter Rams: Principles For Good Design (vitsoe.com)
54 points by gatsby on Dec 12, 2010 | 14 comments
28.A Secretive Banking Elite Rules Trading in Derivatives (nytimes.com)
53 points by wallflower on Dec 12, 2010 | 34 comments

MAME saved my ass too.

I was working on a coin-op game for a mid-level manufacturer in Chicago. Let's just say they were the last dinosaur in the tar pit and they didn't have a stellar hardware engineering team. They tended to copy other people's designs and not really understand the architectures, so things like in-circuit emulators and IDEs were scarce or non-existant. You debugged via trial-and-error and, if you were lucky, printf().

So I was working on this title and started working from home a couple of days a week to take care of a family member. That made things hard, and even harder since you tend to have the physical machine next to you while coding. It was frustrating to code for a day, get to work, then find half of it wasn't working.

Then I discovered that the MAME kids had already supported the platform. With a small amount of work I could develop on the emulated platform. I could work remotely and I had access to things the in-house guys didn't even have: hardware breakpoints, live RAM viewing, scripted testing for example.

Without MAME I would have seriously been suffering on this project.

30.How to Get Started with Bitcoins (pzxc.com)
52 points by pzxc on Dec 12, 2010 | 47 comments

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: