Naming Issues
Closed this issue · 4 comments
1. Spelling mistakes
In com.kingmang.lazurite.lib
i see ..Exeption
class names all around, which isn't actually correct spelling of word Exception
.
- public final class _AExeption extends RuntimeException
+ public final class _AException extends RuntimeException
- public final class _LExeption extends RuntimeException
+ public final class _LException extends RuntimeException
...
2. Confusing exception names
Also exception names seem really confusing for me. What is _AExeption
, _LExeption
, _PExeption
, etc.? They should really be renamed.
3. Names of storage classes
Functions
, ClassDeclarations
, Classes
are also a bit confusing. In my opinion, it is better to use Storage
, Resolver
or Manager
postfix:
- Functions
+ FunctionManager
- Classes
+ ClassManager
- Functions
+ FunctionStorage
- Classes
+ ClassStorage
- Functions
+ FunctionResolver
- Classes
+ ClassResolver
4. Utility classes
Take for instance a utility class, related to function arguments:
public final class Arguments {
private Arguments() { }
public static void check(int expected, int got) {
if (got != expected) throw new _AExeption(String.format(
"%d %s expected, got %d", expected, pluralize(expected), got));
}
public static void checkAtLeast(int expected, int got) {
if (got < expected) throw new _AExeption(String.format(
"At least %d %s expected, got %d", expected, pluralize(expected), got));
}
public static void checkOrOr(int expectedOne, int expectedTwo, int got) {
if (expectedOne != got && expectedTwo != got)
throw new _AExeption(String.format(
"%d or %d arguments expected, got %d", expectedOne, expectedTwo, got));
}
public static void checkRange(int from, int to, int got) {
if (from > got || got > to)
throw new _AExeption(String.format(
"From %d to %d arguments expected, got %d", from, to, got));
}
private static String pluralize(int count) {
return (count == 1) ? "argument" : "arguments";
}
}
Maybe use Utilities
, Utils
or Helper
postfix?
- public final class Arguments {
+ public final class ArgumentUtilities {
- public final class Arguments {
+ public final class ArgumentUtils {
- public final class Arguments {
+ public final class ArgumentHelper {
Case inconstancy
In COUT_Setting
, underscore creates case inconstancy with other names like AbstractVisitor
or Console
:
- public class COUT_Setting implements OutputSettings {
- public class SOUT_Setting implements OutputSettings {
It can also be seen in module names:
- Arrays
+ arrays
- GForms
+ gforms
- HTTP
+ http
java
- LFS
+ lfs
...
SOUT_Setting
can be renamed to something likeStringOutSetting
, I have no idea at the moment.
Plural and singular nouns
Going back to the previous code spinnet, COUT_Setting
implements OutputSettings
, which in my opinion creates the plural/singular inconstancy.
It can again be seen in module names:
- Arrays
+ array
- GForms
+ gform
- HTTP
+ http
java
- LFS
+ lfs
...
Ээээ! Где мои кривые названия? Я ради них живу, дышу, сплю, какаю и ем.
Претензии хорошие, но, к сожалению, в пустоту...
Претензии хорошие, но, к сожалению, в пустоту...
Почему? У меня было несколько коммитов на изменение нейминга и к следующему релизу я точно все исправлю
Претензии хорошие, но, к сожалению, в пустоту...
Почему? У меня было несколько коммитов на изменение нейминга и к следующему релизу я точно все исправлю
Хорошо, коли так