You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've never adopted the jquery one-function-as-getter-and-setter style in
Atom. We may be breaking JavaScript patterns, but I'd rather keep new API
methods consistent with the old ones. But if you think that is crazy feel
free to school @github/atom.
We've avoided the jQuery style ambiguous getter/setter throughout the Atom
codebase, for various reasons:
It complicates the implementation of getters and setters by making the
same function serve two roles
It consumes the most likely name you would want to use for the actual
property being set. If I want to have a @badge instance variable, I can't
because there's already a method named badge.
Getters and setters are uncommon in JavaScript. Instead of setBadge and
getBadge, can we have a badge() method that does this?
badge: (text) ->
if text
# set the text
return theBadgeText()
sets the badgedock.badge('42')
gets the badgetext = dock.badge()
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/46#issuecomment-22200340
.
Activity
zcbenz commentedon Aug 6, 2013
See https://github.com/atom/atom-shell/wiki/app#appdockbouncetype for the new dock API.
dgraham commentedon Aug 6, 2013
Getters and setters are uncommon in JavaScript. Instead of setBadge and getBadge, can we have a badge() method that does this?
probablycorey commentedon Aug 6, 2013
We've never adopted the jquery one-function-as-getter-and-setter style in
Atom. We may be breaking JavaScript patterns, but I'd rather keep new API
methods consistent with the old ones. But if you think that is crazy feel
free to school @github/atom.
nathansobo commentedon Aug 6, 2013
We've avoided the jQuery style ambiguous getter/setter throughout the Atom
codebase, for various reasons:
same function serve two roles
property being set. If I want to have a
@badgeinstance variable, I can'tbecause there's already a method named
badge.On Tue, Aug 6, 2013 at 11:30 AM, David Graham [email protected]:
Merge pull request #46 from brightray/linux-notifications
Merge pull request #46 from brightray/linux-notifications