mitevpi / thesaurus

TT Hackathon 2018 - Autocomplete for Visual Programming Nodes
MIT License
25 stars 7 forks source link

general cleanup (post build, comments, view extension path etc.) #1

Closed ksobon closed 5 years ago

ksobon commented 5 years ago

Ok, this is yet some more cleanup. If we are going to be all chugging on this.

Changes:

I am doing this as a PR, because it's time we stop dumping things straight into the Master. Is it?

QilongTang commented 5 years ago

LGTM with one comment

mitevpi commented 5 years ago

General question - why the need for dynamic typing? I personally hate seeing var in .NET but wondering if there are benefits?

ksobon commented 5 years ago

@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 vars 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.

mitevpi commented 5 years ago

@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.

ksobon commented 5 years ago

@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

mitevpi commented 5 years ago

@ksobon well I guess I'll take your lead then