Closed pedro-andrade-inpe closed 8 years ago
filePath()?
No, I prefer fileFromPackage() or fileNameFromPackage()
filePathFromPackage() /etc/program/file.txt -> path file.txt -> file file -> file name
filePathFromPackage() is better!!
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.
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
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.