Hacker News new | past | comments | ask | show | jobs | submit | ansman's comments login

The readme is very unclear, I've installed it but it doesn't appear that it's doing anything.


s/M/B/g


So, Boore's Law?


Yeah, you want to down vote an attempt at deciphering someone's meaning.


Done


self monitoring of blood glucose?


Isn't this the same guy who discovered the mass assignment bug in Rails last year?


> who discovered the mass assignment bug

IMO mass assignment was discovered not last year. 2006 maybe?


Yep.

Dude's been on a pretty solid streak for the past year.


If you understand programming (there is a difference between knowing how to program and understanding, a lot of people lack the latter) there is absolutely no difficulty learning CS if you know JS.

I've been coding CS for over a year now and I like it, I've never found it hard to debug and it's just easier to read.


I've made some pretty large apps in CS, by myself and in teams. So many good things in CS that I can no longer live without when writing front-end code:

1. @ = this

2. -> to => solves almost every context problem

3. Object notation by simply using colons ':'

    $('body').css
      color: 'red'
      background: 'blue'
4. statement if condition

5. jsondata?[2]?.hierarchy?.url

6. Optional brackets allow very terse/clean code:

    setTimeout ->
      statement
    , 1000
7. (function_argument = 'default_value') ->

8. Automatic return on last line

9. I also like how CS handles scoping, even though others might not. My very few globals are ALLCAPS and everything else is local scoped. I don't do things like {log, tan} = Math in the global scope just to save a few keystrokes elsewhere.

Add jQuery/Backbone/Underscore/Bootstrap to the mix and you can develop some very large, complex apps with CS in a very clean way. Of course, people may not like some of the above syntax but I love not having to write/parse 2x as much code.


CS offers a lot of nice syntax sugar, indeed. It helps with many common mistakes made in JS code (missing `var`s and use of '==' operator come to mind).

However, it also provides a few new ways to shoot yourself in the foot. Automatic return may be one example. Generally, thanks to terser syntax, the code may become illegible very quickly—especially in an environment with many contributors and little care about coding style.

IMO successful CoffeeScript usage in larger projects requires strict coding guidelines. Maybe the language would even benefit from more ‘centralized’ and opinionated approach, like Python's PEPs.


> 8. Automatic return on last line

This is all good and fine until you realize that this will bite your ass when you need to write performance-sensitive code. So you end up with lots of explicit 'return' statements at the end of your functions.

> 9. things like {log, tan} = Math in the global scope just to save a few keystrokes elsewhere.

It's not only for saving keystrokes, but may also be improving performance. Some reason people add `local _G = _G` to the top of Lua source files to speed up access to _G.


Indeed, the claim that JavaScript developers can't read CoffeeScript seems odd to me. As a novice JS developer, I could read CoffeeScript the first time I saw it and it took me a day to be fluent.

For me there's a noticeable productivity and enjoyment boost from the more terse syntax and that makes it more than worth it for me.


There's not doubt it is readable (I'm quite a fan of the language too) - the problem is with writing it as a novice. This post highlights some of the issues with magic and whitespace:

http://meta.discourse.org/t/is-it-better-for-discourse-to-us...


I don't know, you would just never write "foo = bar->". It looks bad and it's wrong.

White-space sensitive languages are great because they reward you for writing with style, plus you don't have to worry about matching and aligning braces all the time.



I greatly prefer Scheme-like lexical scoping. However, JavaScript does not implement lexical scoping properly. Given the particularities of JavaScript's inadequacies, I think that the CoffeeScript design is very reasonable. It's certainly not "broken".

Lots more discussion here: https://news.ycombinator.com/item?id=3379962


Um... I believe JS does have proper lexical scoping. Could you source any evidence to the contrary?


JavaScript's lexical scoping is function-level. There is no block level lexical scoping, so variables are "hoisted" to the containing scope. This is why people use the (function(foo){...})(bar) trick to create lexical scopes, such as when looping (CoffeeScript's `do` keyword embodies this pattern). In my opinion, "proper" lexical scope implies shadowing without hoisting.


If you understand hoisting as a characteristic of JavaScript, its behavior is very predictable, and thus, hardly broken -- merely tricky if you've yet to encounter a hoisting-related issue.

That said, I find almost any issue with writing JavaScript can be easily mitigated by utilizing JSHint, and you get the added benefit of sticking with the base language, which is better because if you're writing raw JS everyday, your skills are more transferable than if you're writing CS every day if only for the fact that you can still write JS in a CS-only stack, but you can't write CS in a JS-only stack.


BTW, ClojureScript has proper lexical scope.


I'm not sure if you're telling me, or telling other folks in this thread, but for the record: I've fixed bugs in the ClojureScript compiler related to preserving the lexical scoping semantics :-) It's actually quite a tricky process and involves shadow tracking, symbol generation, self-calling function wrappers, and a bunch of other nonsense to deal with JavaScript's crummy semantics.


Of course, that link author suggests adopting a Python-like design instead, and Python is even more broken (Python has the most insanely awful scoping rules I've ever seen).

Really the problem is implicit declarations of any sort; they're great for one-liners, but they really suck when you're writing real software.

[But if you've gotta have 'em, please, at least don't copy Python...]


Nope. CoffeeScript's scoping is working the way it's supposed to be ;)

It's actually a funny thing -- out of all of the folks who actually have tried playing around with CoffeeScript in earnest (participated in issues or the mailing list), I can count on the fingers of one hand the number who have actually disliked working with the scoping semantics. There's a far larger number of folks who like to worry about the scope semantics without ever having tried it.


In other words, No True CoffeeScript User dislikes the scoping rules…


That article points out a design decision that the author disagrees with. It does not prove that CoffeeScript's scoping is broken.


The whole point of lexical scoping is that code in an inner scope can't mess with an outer scope's variables without meaning to. CoffeeScript doesn't achieve that. The same code in an inner scope means different things depending on whether the outer scope uses the same variable names. It's broken.


Lexical scoping is a term to classify languages. The 'point' is to make it easier to understand how a language behaves.

If you want to have var with the same name as something in an outer scope, there are ways to do it, specifically an IIFE.

Here's an article for you: https://github.com/raganwald/homoiconic/blob/master/2012/09/...


Also, using really common identifier names (like "log") in outer scopes is a bad idea regardless of how your language's scoping works. Writing `{log} = Math` at the top of the file is just polluting your namespace for no good reason. You shouldn't do it, just like you shouldn't use `from math import *` in Python.


But a function in one part a file shouldn't be broken by the use of bad practices in a completely different part of the file. If I paste a function that works in the REPL into a file with other code, that function should always continue to work (unless it intentionally uses global variables, or another feature that is supposed to interact with other code).

Enforcing best practices by throwing errors where other languages wouldn't (like Go does) is one thing. Enforcing them by introducing difficult-to-track bugs into code that happens to be in the same file as other code which uses bad practices is another. This is a bug, not a feature.


It's not a bug, but it is an unfortunate quirk of the language. But find me a useful language without any unfortunate quirks, and I'll give you some sort of medal.

My point is that as unfortunate quirks go, this one isn't actually that big of a problem in practice, especially if you know to watch out for it and take simple steps to protect yourself from it.


And my point is that you can't watch out and protect yourself from it, because the quirk can be triggered by different code from the code you're actually writing. You can carefully write code that works just fine, and then, unbeknownst to you, someone else can modify a completely different part of the file, and break your code. How do you protect yourself from that? By making sure that every single person with commit access always follows best practices? Good luck.

Please don't say something along the lines of, 'If you hire bad coders, what do you expect to happen?' Bad coders are almost inevitable, and their harm should be confined to code they actually write. Their bad code shouldn't have spooky action at a distance on good code someone else wrote.


>And my point is that you can't watch out and protect yourself from it

Of course you can. You simply enclose the block in an immediate function (using "do") and declare your local variables as parameters to the function. Do that, and it is impossible for any outer scope to screw your code up.

If you're working on a project where lots of coders of questionable aptitude are going to have commit access, you make declaring local variables this way a required convention.

If you're working on a project where changes get approved by a small number of capable maintainers, then you:

1. Do not allow commits that create short or common names (i, x, arr, log, etc.) in high scope levels, and

2. Require that short or common names in inner scopes be declared using local scoping via "do".

Now, should CoffeeScript give some nicer sugar to encourage this kind of local variable use? Yes, probably. But it is incorrect to say that CS doesn't give you the tools to protect yourself from outer scope pollution.


Ok, you can protect yourself by doing weird defensive coding gymnastics, but you can't protect yourself by just writing good code. I'd rather use a language that doesn't make me do gymnastics.


Weird defensive gymnastics? It's just using a language feature the way it's meant to be used. How is that any more "gymnastics" than the ":=" syntax recommended by the article you linked?


So the "do" syntax is meant to be used for all local variables? That seems kind of weird, but I'll take your word for it.


It isn't only for that, and as I said, it doesn't have to be used for that. But it's an effective way to do things, and it is one of the purposes of the construct.


There are Coffeescript forks that try to deal with issues like this. Here's one that takes a different approach on a bunch of 'em, including the scoping:

https://github.com/satyr/coco


Same here, tried Chrome, FF and Safari.


Yep, on an ipad Chrome, safari and whatever instapaper uses did't work.


Very sad but I fail to see how this belongs on HN.


Isn't anyone else bothered that it only has 16GB space? I use around 13GB for music (Spotify) and 2GB for photos.

I don't see why they couldn't make a 32GB version.


Not particularly. I use Google Music streaming and only keep about 10 albums on the device itself. That, combined with a couple hundred photos, a bunch of apps, and a handful of ebooks puts me at about 3 gigs used on my Galaxy Nexus. I could probably purchase the 8 gig version and never fill it up.


Well I had having to decide in advance what I want to listen to.

And I hate interruptions in my music just because I happened to go into a house without wifi.


If you spent over €4M on a website wouldn't you want some traffic too?


I agree! On hindsight, I retract my earlier statement.



Ah, but it's all local, with something like a compressed bloom filter doing lookups. So nothing goes across the wire!


This feels like a scare tactic to get people scared, they could never go after all downloaders.


It probably is. The BBC are notorious for jumping on top of every scare tactic out there and promoting it.


Couldn't they? Letters are cheap to send.

They could simply send out a few million or so letters, maybe costing a million £ or so. Offer everyone a settlement of a few hundred £ to cover all past transgressions with the threat of suing for a much greater sum if there is a repeat offence or if they do not comply.

If you work on the basis that about 50% just pay up straight away that's quite a lot of money. This money can be used to subsidize going thermonuclear on at least a few thousand of those who don't.

Besides, they don't need to sue everyone to make people scared enough to avoid pirate sites.


Pretty sure that the justice systems of most sane nations would crack down on an effort like this. It certainly wouldn't fly where I live (Europe).


Don't forget all (well nearly all) Bit Torrent downloaders are also (by default) uploaders - seeding back to the pool while their file downloads.

MAFIAA and others don't care about downloaders (as yet I don't believe a single user who downloads only, has been sued successfully), but they DO care about those sharing their material. The fines levied so far are not for downloading tracks, but for sharing them.


And yet we see today the claim that 1m+ Apple UDIDs were allegedly stolen from a single FBI agent's laptop. We are easier to track than ever.


The key word in the article is "popular" content. It is well known that (a) relatively new and (b) relatively mainstream + popular content (especially movies) is heavily monitored.

The article title is misleading. They logged only popular, public torrent content. I'm certain that many, many other file sharers were not even seen by their study. It's all just scare tactics.


A serious journalist would have given us a link to the source. Here it's not possible to verify the claim without serious digging.


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

Search: