Closed ksobon closed 5 years ago
LGTM with one comment
General question - why the need for dynamic typing? I personally hate seeing var in .NET but wondering if there are benefits?
@mitevpi it's for brevity in my case. I just hate typing out Dictionary<string, int> dict = new Dictionary<string, int>(){};
where var dict = new Dictionary<string, int>(){}
is exactly the same, there is no performance decrease in compilation time. Literally var
s are still strong typed, it's just less typing.
https://stackoverflow.com/a/20391946
Ps. I guess I have been doing a lot of JS development in the last few years, and moved to using vars in C# pretty quickly when I found out that they are not decreasing performance.
@ksobon it's just so much less legible that way. I mean if you need it to keep contributing, I guess let's do it, but my vote is let the language do what the language was designed to do.
@mitevpi when you say legible, you mean that it's hard to understand what these variable types are? I would say, no, it's not harder...in most cases. So you still have all of the great benefits of strong typing using vars. Just hover over the var, and it will tell you what the inferred type will be. Also 90% of the time you can see what the return type is just by looking at the right hand side of it. I gave a Dictionary
example: var dict = new Dictionary<string, int>(){}
Right hand side tells you exactly what the type is. It's redundant to type it out twice. Compiler doesn't care either.
I didn't invent this. This is MSDN Coding Standards and Conventions: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions
Dynamo team also suggests that we use that convention in all DynamoDS and DynamoRevit submissions: https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards
@ksobon well I guess I'll take your lead then
Ok, this is yet some more cleanup. If we are going to be all chugging on this.
Changes:
\bin\
added to the path since all non DLL files will be put into theextra
folder by Dynamo automatically. @mitevpi that's probably why you could not get it to work. it only worked if the file was in the same directory as the DLLs which Package Manager doesn't do. It places XML files into extra folder.NodeAdded
event. I don't think it's a good idea to only subscribe. We might end up with multiple handlers getting called more than once. This should unsubscribe us from the event.// (Konrad) This is a comment
That way we know who left that bit of important comment in the code and it's easier to track down the right people.I am doing this as a PR, because it's time we stop dumping things straight into the Master. Is it?