Conversation
There was a problem hiding this comment.
I may be picky, but I'd rather not hide types here.
|
I don't like those var changes. Hiding types from stuff that's not clear from the right side of the expression is just not my style. |
|
I'm not precious about these changes. Unless anybody else votes for keeping them, I could roll them back. |
|
On the other hand, you could also say the variable names are suboptimal and, therefore, the type helps understand what these really are. For example, would you still disagree with the change if we used more descriptive variable names, like so? From my point of view, it would make sense to rename these variables even if we roll back the previous change. @nulltoken What do you think? |
👍 We indeed tend to use |
75f0e85 to
4e4b1b7
Compare
|
@Therzok and @nulltoken I've rolled back those changes but renamed the variables to be more explicit about what those really are. |
There was a problem hiding this comment.
To have all fields at the top of the class. The other existing field also did not directly precede the (only) method in which it was used. In other words, consistency ...
|
I'm also a very big fan of code readability. However, this is also driven by layout and redundancy, for example.
Explicit is good, unless it is really redundant. Redundancy adds clutter. While that is not the case when you write explicitly defines two variables. The following example is less explicit: It is clearly a matter of preference or judgement whether or not you would go with the second example. It is certainly nicer on my eyes and I would, therefore, prefer it as long as the righthand side is clearly enough (which is the judgement part) an
Dropping the initialization on the same line will add noise no matter what. Changing
There is a reason why the type of integer literals defaults to
As for
Wouldn't you also have to scroll to the definition and look at the value "where it is nice on the eyes"? Again, believe it or not, I'm not precious about Personally, I now tend to use |
4e4b1b7 to
9b9d891
Compare
|
Here you go ... I rolled it back and changed |
9b9d891 to
4a27abf
Compare
|
Travis said it was "unable to fetch some archives". |
|
Build has been restarted |
There was a problem hiding this comment.
As this method is no longer used, let's just drop it.
|
Other than the nitpick above, looks pretty nice to me. Thanks! |
Rename TryDeleteDirectory(string, int, int, int) to DeleteDirectory(...) because this method can still throw exceptions and is not fully in line with the try-parse pattern. Introduce TryDeleteDirectory(string) : bool as a try-parse pattern-compliant option to delete directories recursively without throwing exceptions. Remove DeleteSubdirectories(string) method because it is not used anywhere. Use 'var' keyword consistently across all methods. Related to libgit2#980
4a27abf to
1a2528f
Compare
|
Deleted |
|
Another one in. Thanks! 💖 |
|
Thanks! |
Rename
TryDeleteDirectory(string, int, int, int)toDeleteDirectory(string, int, int, int)because this method can still throw exceptions and is not fully in line with the try-parse pattern.Introduce
TryDeleteDirectory(string) : boolas a try-parse pattern-compliant option to delete directories recursively without throwing exceptions. It doesn't need an out parameter because the basic method it wraps does not return a value.Remove
DeleteSubdirectories(string)method because it is not used anywhere (housekeeping).Use
varkeyword consistently across all methods.Related to #980.