TerraME / terrame

TerraME is a programming environment for spatial dynamical modelling
www.terrame.org
GNU Lesser General Public License v3.0
36 stars 13 forks source link

review name for file() #892

Closed pedro-andrade-inpe closed 8 years ago

pedro-andrade-inpe commented 8 years ago

Function file() returns the path to a file stored in a given package. The name sounds weird, as it does not open the file. Think more about it.

pedro-andrade-inpe commented 8 years ago

filePath()?

gilbertocamara commented 8 years ago

No, I prefer fileFromPackage() or fileNameFromPackage()

avancinirodrigo commented 8 years ago

filePathFromPackage() /etc/program/file.txt -> path file.txt -> file file -> file name

gilbertocamara commented 8 years ago

filePathFromPackage() is better!!

pedro-andrade-inpe commented 8 years ago

Well, filePath... seems to be agreed. The problem for me is including FromPackage. From was never used in TerraME functions as it is usually related to a given parameter, being omitted. We could have Cell:getNeighborhoodFromIdx(), but we have Cell:getNeighborhood() with idx as parameter. We could have Environment:loadNeighborhoodFromFile(), but we have Environment:loadNeighborhood() with file as parameter.

Additionally, FromPackage makes the function name too large: forEachNeighborhood (the function name with more characters in TerraME) has 18 characters + 2 shifts = 20 keys pressed filePathFromPackage has 18 characters + 3 shifts = 21 (more than the current maximum) filePath has 8 + 1 = 9 (less than half)

I'm not sure whether 12 additional keys pressed would elucidate the semantics of this function.

gilbertocamara commented 8 years ago

Hi Pedro

OK, we have a go!!

On 11.02.16 12:49 , Pedro R. Andrade wrote:

Well, |filePath...| seems to be agreed. The problem for me is including |FromPackage|. |From| was never used in TerraME functions as it is usually related to a given parameter, being omitted. We could have |Cell:getNeighborhoodFromIdx()|, but we have |Cell:getNeighborhood()| with idx as parameter. We could have |Environment:loadNeighborhoodFromFile()|, but we have |Environment:loadNeighborhood()| with file as parameter.

Additionally, |FromPackage| makes the function name too large: |forEachNeighborhood| (the function name with more characters in TerraME) has 18 characters + 2 shifts = 20 keys pressed |filePathFromPackage| has 18 characters + 3 shifts = 21 (more than the current maximum) |filePath| has 8 + 1 = 9 (less than half)

I'm not sure whether 12 additional keys pressed would elucidate the semantics of this function.

— Reply to this email directly or view it on GitHub https://github.com/TerraME/terrame/issues/892#issuecomment-182824710.

Prof. Dr. Dr.h.c. Gilberto Camara National Institute for Space Research (INPE), Brazil

http://www.dpi.inpe.br/gilberto