andrewplummer/Sugar — Issue #46: Consider aliases for Python (and Ruby?) developers
Author: andrewplummer
Created: 2011-11-06 04:52:40+00:00
State: open

Sugar is intended as a library that is directed toward Javascript developers. A couple things are implied by this statement:

1. When native Javascript methods exist to do a job, I am not aliasing them with different names. Consistency with naming that can be considered "Javascripty" is part of an API that can be understood by newbies and veterans alike.

2. Methods with completely new functionality will be given the most intuitive names possible. If this overlaps with other languages where similar functionality exists (as in the case of ActiveSupport's DateTime calculations), then so be it, but preference to intuitive naming will take a much higher precedence to maintaining common names with other languages. This is one area where Sugar is noticeably different from Prototype.

I do acknowledge, however, that certain methods names can be counterintuitive for programmers coming from other languages (specifically Python and Ruby keep coming up), despite having more intuitive naming if you coming at it from a fresh start. I think that aliasing some methods can give us some common ground here.

Clearly I can't do that for all methods for all languages, but I think there are some "quick win" methods I can alias, specifically for Python-based methods (where there is a lot of functionality overlap) that can make Sugar more intuitive for those people. I don't speak Python or know the exact functionality of the methods in question, so I'm relying on people to help me out by adding methods they think should be aliased here. I will keep it updated... So far I've seen 2 that might make nice aliases:

```
Array#contains (for ES5 standard Array#some)
Function#partial (for Function#fill)
```

Please add to these!