Comment

Comment by sync

Big, big fan of CoffeeScript and glad to see Dropbox hopping aboard.

That being said, some of their examples are lackluster.

  @originalStyle = {}
  for k in ['top', 'left', 'width', 'height']
    @originalStyle[k] = @element.style[k]
Should really be something like:

  @originalStyle = ['top', 'left', 'width', 'height'].reduce (hash, position) -> 
    hash[position] = @element.style[position]
    hash
  , {}
... though that shows off some CoffeeScript warts.

Also,

  Sharing =
    init: (sf_info) ->
      for list in [sf_info.current, sf_info.past]
        for info in list
          @_decode_sort_key info
Why aren't they using CoffeeScript classes?

  class Sharing
    constructor: (sfInfo) ->
      ...
parent sync 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton