-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmetics and small refactoring #14
Conversation
telephon
commented
Jan 19, 2023
•
edited
Loading
edited
- no need to make class methods here
- move assets to a better place
- and just some formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- no need to make class methods here
In other languages its best practice to make use of static methods as much as possible if they are deterministic because they can not modify the object (and there is a neglectable speed boost)
- no need to make them private
I consider them a perfect example of something that should be private static method - they are of no concern to the actual test as they are internal, deterministic helper methods and should therefore not be exposed in autocompletion or docs.
I currently find the path layout rather confusing as the test files are at a different location (why is this a convention in SC? makes mirroring folder layouts necessary on bigger projects - java does this but this is due to their namespacing rules on filenames which SC does not have).
the asset files for the test yet remain in the classes folder.
Hm, yes, from a java perspective probably true. But in sclang it is rather unidiomatic to do it like this, because you always have to go through an extra indirection if you want to call the method from an instance ( Private methods are really only those which you can't or shouldn't call from outside because of a technical condition. They don't read that well, usually there is a wrapper for them that "speaks" better. If you like to make them private, put them in a section at the end of the class definition. That way they are not obscuring the more important things. |
yes, what else? :) The rest of the discussion (about private and class methods) we should have somewhere separately. |
I would assume that the dirname of a directory would be the dirname itself, so identity? |
ah I see! I read "the directory of a directory" |