C# learning doubt

unhandled

#61

that may sound ironic and reflects why i am personally so stubborn about learning “just” another language. i had several guitars, but i found playing guitar very limiting… i practiced very much and very hard till my fingers where falling off also composing a lot and playing so much that i often got tired and almost falling asleep on them. but even though i composed many things i felt limited to play the same tones again and again and so i have disposed them. i never ever played since then. maybe 10 years ago or more.

i feel the same about whatever i do if i use rhino or other software, i just think generally we are using computers too much and finding another reason just to sit in front of it is maybe not a good choice. i was questioning CAD and computer for a long time… looking how architecture is being created nowadays with grasshopper and parametric systems which have beautiful but equally limiting aspects i really dont know if i should not throw this box out of the window and free myself. but ok this is becoming a very personal “esoteric” story and i apologise for consuming readers time with this.


#62

The inbuilt script editors are not really helpful for beginners. I think it is much easier to really learn C# and RhinoCommon if you use Visual Studio.

Scripting is also programming, the difference is that the code does not have to be compiled. It will be interpreted right after loading. But that does not make much difference with your approach.


#63

I’m more confused now hahaha

thank you, helpful!


(Chris Hanley) #64

One approach, (to getting started with any language), might be to make a simple definition in GH, then try to reproduce it in a code component of your choice.


#65

Very good advice. I started my GH journey by replicating the Addition component. :slight_smile:

// Rolf


#66

I agree that this is perhaps accurate for the C# script editor, however the GHPython one is really highly beginner friendly IMO (then there is the whole issue of starting out with rhinoscriptsyntax instead of RhinoCommon directly, but that’s a different concern).


#67

Long time since I used it… Had this thread in mind: Get selected Geometry with ObjectTable


#68

I find that a primary reason why Python lends itself so well for on-the-fly programming on the canvas is that one doesn’t really need breakpoints, debuggers etc. As the language itself comes with a range of functions intended for introspection etc., such as print(), type(), help(), dir(), inspect(). Not that lower level languages doesn’t, but it’s just a heck of lot faster/simpler when one doesn’t have to cast to string and jump through hoops. Also (and this is important), the GHPython editor has a console out window where all these functions print to. That, plus F5 for run, has been crucial for a good/fast development feedback loop in my experience.


#69

Yes, I also like Python and appreciate to have it in Rhino. But for extended developments I cannot really recommend it. The inbuilt editors are one reason, but there are also other weak points in python which can be a pain. And this is my current situation while working with python on very complex projects. Therefore I simply want to encourage the thread starter to learn C#


#70

Agreed, but also perhaps…

and

…aren’t really super appropriate for beginners. But again, that fully depends on the intention and requirements of the beginner (in this case, do I want to develop compiled Grasshopper plugins, or simply script on the canvas?). Just getting Visual Studio installed might break the spirit of any newcomer.


#71

Rhino Plugins, Grasshopper Assemblies, Videogames and Unity stuff I consider serious developments.


#72

Sure, as would I…

…again.


(Sean L) #73

I know this topic has long gone off-track, but when it comes to the Python vs C# for a beginner debate, I can’t see a reason to come down strongly on one side or another. If they’re up for C#, so be it; if they find Python less intimidating that’s okay too. Once you learn one language and understand its advantages/disadvantages, you begin to understand why you might want to pick up another. It’s not like we’re talking about deciding between SML and C#…
Looking further down the road: of course it’s probably true that a jump from C# to Python (or java, or many other languages…) is easier than the other way around. But is that really a big deal?


(Tom) #74

I think, the personal opinion also highly depends on which language someone has more experience in and this person has learned at first.

I usually claim my C# is better than my Python, but that might change soon for me.

Two drawbacks for both languages:

In my opinion C# totally exaggerates the concept of Object-Oriented-Programming. As soon as you read a class like “FoobarServiceProvider” you really get my point. If someone decides to learn C# from this thread, don’t listen to much to C# software architects, unless you are planing to write a complex business app.

What bothers me most on Python, is that its dynamic nature introduces a bunch of additional weirdo errors. Really pay attention on debugging.
And that virtual environment and compiling thing, and why on earths did they changed the syntax so much from Python 2 to Python 3???

Programming is solving Problems, but the more more problems you solve the more problems you get. That’s actually quite annoying sometimes…


(Graham) #75

if you have a problem, and you decide to solve it by programming, then you have two problems.
… and after 20 tries at fixing the problem you don’t know if the 21st will work, or the 40th, or …


(Graham) #76

Yes I think Guido van Rossum (Python’s creator) has said it was a mistake to change so much in one go. The good news is that, 10 years later, nearly 90 % of Python developers now use Python 3 !


(Tom) #77

I use Python on three different platforms and all are still using 2.7, including Rhino. Its not a big deal, but since I recently started doing some coding with Django, it really becomes annoying to get used to the newer syntax. And very often I don’t see real improvement, to be honest. I quite often like the older one.
Besides this, often code snippets just work for 2.7 or just for 3.5+. Well I guess the problem is just that niche coding is always limiting. I guess I’m not part of the 90% mainstream coder then :frowning: :wink:


#78

Not just newcomers.


(Graham) #79

I’ve been coding with both 2.7 and 3.5+ for the last 3 years and got pretty used to switching between the two. I really like f-strings and the easier use of generators in modern Python but I’m happy enough without them. I really miss numpy, pandas, etc with IronPython though and that problem will increase as Python 2 goes end of life and all the new toys only support 3.5 or newer…


#80

Agreed. I don’t remember who brought it up (about using VS as a beginner) but of course there are simpler alternative ways to get started with C#, if you are on the level of need to learn the basic concepts of programming, for example this:

https://try.dot.net/ :slight_smile:

// Rolf