Grasshopper

algorithmic modeling for Rhino

David and other experts:

I know most of people here is more familiar with VB.NET than C#. I wonder if I will get same support if
I use C#?

Also, if I use converter translate C# to VB.NET, will this process change the name? For example: brepSurface to brep_surface?

Views: 315

Replies to This Discussion

Hi cmrhm,

from people like Giulio and me, absolutely. From other users, probably somewhat less. McNeel developers in the Seattle office are typically more proficient with C#. I think it hardly matters, as you pointed out, you can use online translators to convert VB to equivalent C# and vice versa.

I don't understand your second question. Both brep_surface and brepSurface are valid variable names in VB and C#. There is no need to convert those. There are a few cases where enum values in the Rhino SDK conflict with keywords in either VB or C#, but those are rare and easy to spot.

--
David Rutten
david@mcneel.com
London, UK
I think that you'll get just as good support as there are a number of us here who understand/code in C#. As I said in another thread, the code for VB/C# actually wind up looking strikingly similar, so you shouldn't be looking at VB and not be able to identify the methods that you'd need to use in C# (and vice versa)

I've use the online VB/C# converters a number of times going both ways and I've always gotten workable code. The more "excentric" things, like adding event handlers, delegate functions, and special class declarations might come out a little "odd" on the other end, in regards to the translated syntax, but it still works.

VB/C# code tends to declare variables a little differently, but since that's a preference and each "style" creates valid variable names, you won't get any translation on that level.
Hi, Damien:

Thanks for the clarification. The reason I hate VB.NET is absurd--- VB.NET use '_' alot in its naming like glass_size_big. If one class/function takes three or more inputs with each one having three or more '_', that just make the whole naming difficult to understand, artificially.

C# instead, is shorter like what java does, like glassSizeBig.

But yesterday, when I tested with GH, I suddenly realized I used alot of '_' when I saved my files like test_srfPoint.gh. So I need to change my view to VB.NET.

I guess this _' might be borrowed from assembly language. What is ur opinions about this '_'?
AFAIK VB doesn't force using underscores for anything, and therefore its a personal preference. If you don't like them, then don't use them. Personally, I do not use underscores in variable or class names. Every so often they sneak into a function name or two, but that's typically something where its the same function (more or less) that's working in a different context. I do use underscores for filenames, but that's typically as a separator between a name and a number, like "myTestFile_02" or something.

IMHO, you may be putting too much effort into worrying about what language your using. Every language is going to have things that you like and things that annoy you. Ultimately, you should be able to move from language to language and still be able to be proficient, since flow control, object oriented design, and structure are concepts that aren't tied to a single language. Pick one, run with it for a while, stumble upon something new, use that for a while.
You are right. I am beginning to test more codes in vb.net now to get me wet.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service