HNHacker News
TopNewBestAskShowJobs

mhansen

1,616 karma · joined June 20, 2009

submissionscomments
mhansen··on The Problem with Implicit Scoping in CoffeeScript
I'll copy below jashkenas' longer answer from the old github issue about this, https://github.com/jashkenas/coffee-script/issues/712#issuec...

"""

Sorry, folks, but I'm afraid I disagree completely with this line of reasoning -- let me explain why:

Making assignment and declaration two different "things" is a huge mistake. It leads to the unexpected global problem in JavaScript, makes your code more verbose, is a huge source of confusion for beginners who don't understand well what the difference is, and is completely unnecessary in a language. As an existence proof, Ruby gets along just fine without it.

However, if you're not used to having a language without declarations, it seems scary, for the reasons outlined above: "what if someone uses my variable at the top of the file?". In reality, it's not a problem. Only the local variables in the current file can possibly be in scope, and well-factored code has very few variables in the top-level scope -- and they're all things like namespaces and class names, nothing that risks a clash.

And if they do clash, shadowing the variable is the wrong answer. It completely prevents you from making use of the original value for the remainder of the current scope. Shadowing doesn't fit well in languages with closures-by-default ... if you've closed over that variable, then you should always be able to refer to it.

The real solution to this is to keep your top-level scopes clean, and be aware of what's in your lexical scope. If you're creating a variable that's actually a different thing, you should give it a different name.

Closing as a wontfix, but this conversation is good to have on the record.

"""

mhansen··on Why don't they implement Python and Ruby on the web browsers?
Javascript has anonymous function closures - nice sugar for a non-blocking API. Python doesn't have them.
mhansen··on Samsung Galaxy Tab 10.1 Ban In Australia Overturned
The iPad is not banned in Germany.
mhansen··on It's Insanely Hard to Make a Kick-Ass iPhone App

  Photoshop’s submenus, window management, and setting 
  screens afford that software package a level of feature 
  depth I don’t believe can be achieved in a mobile 
  environment no matter how sophisticated and intuitive UI 
  conventions become.
I wonder if the author is aware of Photoshop for Android tablets - https://market.android.com/details?id=air.com.adobe.pstouch

Granted, it doesn't have all the features of desktop Photoshop, but it looks like it has a lot of the features, and it has great ratings.

mhansen··on Dartmouth computer scientists expanding diff, grep Unix tools
Check out jsonpipe, it makes json greppable.

https://github.com/dvxhouse/jsonpipe

mhansen··on Imagine a world where Bash supports JSON.
Jsonpipe is excellent for this. It makes json greppable by putting every piece if data on a new line with its key.

  $ echo '{"a": 1, "b": 2}' | jsonpipe 
  / {} 
  /a 1 
  /b 2 
  $ echo '["foo", "bar", "baz"]' | jsonpipe 
  / [] 
  /0 "foo" 
  /1 "bar" 
  /2 "baz"
https://github.com/dvxhouse/jsonpipe
mhansen··on Fuck passwords
Dropbox works for me as a one-way sync (computer to phone)
mhansen··on Only fast languages are interesting
Very well-written, but it's a non-story.

Check the comments. Mike has contributed a clojure solution using `double-array` that runs fast, without blowing up the heap with a linked list.

mhansen··on The Rest of the Story (Yammer & Scala)
A Java vs Scala post is far more interesting to me than discussing the "shut up about the tools and just work" thesis.
mhansen··on Steve Losh's .vimrc
Just watch out that you don't get a 404 one day and end up piping a whole lot of error screen HTML into your shell, it could have wildly unpredictable results.
mhansen··on Internet voting: Exactly what the 99% needs
No, bitcoin has an unencrypted audit trail.
mhansen··on Can you build beautiful sites with Twitter Bootstrap? Hell yes
I built http://markhansen.co.nz/scatter.fm and http://wirelessmap.markhansen.co.nz/ using Twitter Bootstrap.

The experience was awesome, it made it so easy to experiment and get a prototype out the door quickly. It was great for these little visualisation projects.

mhansen··on How One Missing `var` Ruined our Launch
It's still very easy to miss a 'var', even if you know the language. Especially if you've just context-switched from ruby or python.
mhansen··on Apple acquired mind-blowing 3D mapping company C3 Technologies
Google does collect data directly, too. If you're a business owner, you can upload your business location and data here:

http://www.google.com/local/add/g?hl=en-US&gl=US#phonelo...

mhansen··on Using Google+ for Google Apps? Your admin has access to all of your data
Users are made aware of it.

I just signed up for an Apps account, and it told me that my domain admin could access all my G+ data.

mhansen··on The First Step for Ruby on Rails
RVM's overriding of cd isn't portable to other shells. I can't use it in my favourite shell (fish).

Yeah, there's http://beginrescueend.com/integration/fish/, but I tried that and it started printing errors every time I used cd due to some bug (this was over a year ago, there's a good chance it's been fixed, but it just left me really shy about overriding cd).

mhansen··on The First Step for Ruby on Rails
Monkey patching in ruby has well-known problems (what happens when two libraries patch the same object?), and now good library maintainers know not to monkey-patch standard libraries. Neither should RVM.

The monkey-patching of `cd` is the main reason I'm not using RVM. I depend on `cd` to work, every time, rock solid, especially when my system is unstable. I can't risk having a dependency or bug in their `cd` script breaking my most commonly used shell command.

rbenv has demonstrated that it's not necessary to override `cd` to manage ruby versions, so why does RVM still do it?

mhansen··on "Hello World" in Dart, compiled to JavaScript
While this is hilarious, it's exactly fair. Dart is still in a very early tech preview, and they clearly haven't optimised code generation yet.

Right now, it's probably designed to be run through something like Closure Compiler, which removes dead code and minimizes the output.

mhansen··on How Batman.js can Help you Build Apps
It doesn't matter if it's associated with the comic star, it only matters if it's in the same area as the trademark.
mhansen··on Launching Google Wallet on Sprint and working with Visa, AmEx and Discover
For me, pocket room and security. I used to have to carry around a phone,keys, CD player, wallet, and camera.

Now the camera and ipod are integrated into the phone, and I'm just carrying my phone, keys, and wallet. I really appreciate the extra pocket space, and I'd love to fold the wallet into the phone and get some more.

The extra security of having a PIN on your wallet is just a bonus.

mhansen··on Google Wallet Likely Launching Tomorrow
Signatures are a joke, nobody checks them (I used to work in retail). And even if people did check them, they're trivial to forge (there's a copy of the signature on the card telling you what it's supposed to look like!)
mhansen··on EU votes to extend music copyright to 70 years
Why? To better incentivize people to make music in the 1940s and 50s?
mhansen··on Kernel module for advanced rickrolling replaces open() call
How does strace hook it?
mhansen··on PHP will switch to git
To be fair, it's easier to commit to a project on Github. There's an 'edit' button, which lets you make changes inline on the website.
mhansen··on Why must you laugh at my back end?
Small nitpick: the customers will feel the pain if their username/password is leaked through SQL injection.
mhansen··on Contracts For CoffeeScript
How does it integrate with the `coffee` executable? Does coffeescript have a compiler plugin system, or are you patching the compiler? Will this cause me problems when I try to update my coffeescript compiler?
mhansen··on Announcing the first release of batman.js
I still don't get what I'd use it for. Is it like jquery? Is it like rails?
mhansen··on Rbenv, an unobtrusive rvm replacement
That's the main reason I'm not using RVM. I depend on `cd` to work, every time, rock solid, especially when my system is unstable. I can't risk having a dependency or bug in their `cd` script breaking my most commonly used shell command.
mhansen··on Android’s Google Maps App Automatically Tells You How to Beat Traffic
http://news.ycombinator.com/item?id=2871127
mhansen··on Secure your browsing using a home VPN
None at all?
← PreviousPage 3 of 15Next →