Selecting good names matters, but the reality is that first and foremost, syntactically correct names, good, bad or ugly, should work at all times, unambiguously. I will do weird things as I learn any language, such as using poor variable names, intentionally or not: it’s part of the learning, it’s part of bending my mind to think like the compiler of that language.
Now for a personal opinion: Aliases and abbreviations are sugar: I ignore them as long as they don’t cause confusion, they don’t prevent valid syntax from working, and they don’t hide potential problems. But I have found a scenario where task abbreviation lets a type of problem slip through silently, so I think there should really be a way to disable it.
Here is an example of an error prone scenario involving task abbreviation. Consider this build file:
apply plugin: 'distribution'
task binaryFiles1(type: Tar) {
from('.') {
include 'file.bin'
}
destinationDir(libsDir)
}
artifacts {
archives binaryFiles1
}
distributions {
binaryFiles {
contents {
from(libsDir) {
include binaryFiles1.archiveName
}
}
}
}
Now we type: ‘’‘gradle binaryFiles’’’
:binaryFiles1 UP-TO-DATE
BUILD SUCCESSFUL
Total time: 0.959 secs
Gradle ran ‘’‘binaryFiles1’’’, but it happens that it is a user error, the user really wanted ‘’‘binaryFilesDistTar’’’. But it goes unnoticed as Gradle does not throw an error.
This error is even harder to find when Gradle is called from inside another script and the task name is a variable:
#!/bin/bash
...
gradle $theTask
...
I think that having the ability to disable task abbreviation helps find bugs faster in this kind of scenario and that this scenario is not uncommon.