Hacker News new | comments | show | ask | jobs | submit login

I've spent 20 years working on various compilers, yet I still don't think it's a big deal. Undergrads just need to work on any type of large systems project: OS, compilers, distributed systems, DBs, whatever. The problem with the compilers/programming languages field is that every idiot with a computer has an opinion. It's frustrating that popular languages are arguing about features that have been analyzed in depth 20+ years ago, e.g. closures really are the greatest thing ever and should be in any modern language.

Can you expand on why closures are the greatest thing ever? I've heard this from a few places, but I've only run into a handful of real-life situations where they were the perfect solution to a problem I was having. And even then, they weren't solving an otherwise-difficult problem; they were just saving me some lines of code. I feel like I might be missing something.

Writing medium-sized projects in Javascript, I often look toward the sky and thank the originators of that language that they had the foresight to include closures and first class functions. I use them all over and save a significant amount of effort. Because my time is extremely limited, they make things possible I couldn't otherwise do.

If there are a handful of problems where they're the perfect solution, then any language should have them, simply because the overhead in implementation and linguistic style is so low.

Have you ever used jQuery?

    $(".someclass").onClick(function() {
Notice you're passing in a function to a function and `this` is a free variable.

Spend a week programming in a functional language (like Haskell or Clojure) and then go program in Java. You basically feel castrated because a) generics were added to the type system as an afterthought and b) functions are not first class citizens and c) higher order functions are simply not used in Java (they can be somewhat imitated with anonymous inner classes but it's a pain).

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact