C# learning doubt

I’m very interested in learn C# I dont know too much about programming so If i Learn C# with focus in videogames and unity those skills could help me to coding in grasshopper.

Could be considered a great start or not?

I think so. But I strongly suggest learning C# from tutorials, books or courses provided elsewhere, then when having learned the basics about C# you start playing with C# components in Grasshopper. Next step would be moving your (script) code to Visual Studio for your own compiled C# components.

I know that many people suggest using Python as a “starter”. Problem is, if you plan on coding in Grasshopper, then you still need to learn how object orientation works (in .NET) and all those general concepts. Learning Python may have other benefits (used in many other software etc.), but since your goal is to code also in Unity, then there’s no point wasting your time with Python.

In any case, another reason for skipping Python is (and some would not agree with me on this, but…) syntax is NOT the hard bit to learn about coding languages. Period.

What takes some time to learn are instead the concepts in different programming paradigms (like OOP etc), plus the importance of types (especially for precision). The somewhat simplified syntax in Python hides away many of the types, and regarding the rest of the concepts Python doesn’t add much value except for saving you from typing some extra characters here and there.

Go for C-sharp and don’t bother thinking more about it. Learning C# will also make it easier to learn other languages as well (including Python).

// Rolf

7 Likes

hi @RIL if i may ask some hopefully not too dumb questions,

is the syntax the same independently on the environment meaning Windows, macOS? is there anything specific about using C# for grasshopper, basically is C# C# where ever you use it?

I wanted to learn another language for many years but have never found a good reason to finally start with it, also because I got stuck in trying to find THE language. For a while I tended towards Java due to platform independency, but reading so often that the performance is just way too weak I tossed that again. Working on mac for almost forever I was considering Objective C for a long time either, but since friending myself with the idea of limiting platforms never worked out well, I again tossed it.

C# is from my understanding “more or less” platform independent, so I might be willing to spare some time over it, just where to start? Could you recommend some tutorials for absolute beginners?

Analysis paralysis?

Guess what? There’s no good advice about the “best car to drive” to give to rally drivers who never tried anything but kicking the tyres on cars. Honestly, to mee it seems you have no use for learning programming.

I could also put it in another way, like Lewis Carroll did, and which the top manager of Volvo Car’s did when he started his new job as the CEO. He gathered the top managers of the concern, and said that he would now recite a passage from a book which he used to read for his little daughter when he put her to bed at nights.

"Alice (in the Advantures of the Wonderland) came walking on a big field with a tree in the midst of it. In the tree sat a cat, and Alice approached the cat asking which way to go from here. The cat replied, “Where do you want to go?”. Alice answered: “I don’t know”. Then the cat answered: “Well, then it doesn’t really matter which way you go from here”.

Or in other words, if you still have not had any concrete use for programming (to the extent that you picked one language and actually started programming) then that seems to me to mean that it doesn’t really matter what language you pick.

At least there is absolutely no advice being any better than any other advice. :wink:

// Rolf

4 Likes

Hi,
There are a bunch of recommendations for learning c# in this thread.

Happy coding !

1 Like

Just go for it, there is no right way to start, as long as you start.

7 Likes

As a complete novice i’m 4 hrs into this series and really enjoying it so far. Great instruction on the overall concepts along with hands on coding.

https://developer.rhino3d.com/videos/

3 Likes

So many people don’t understand that programming is about

#1: Hands on, and #2: Coding.
:slight_smile:

Over the holidays a month ago I had a young relative staying at my home for a couple of days. For at least two years he had expressed his interest for programming and therefore I had invited him to come to my house and we would take a look at it. So he came, but he kept surprising me. He kept talking and talking (and talking) aboout all things he would program and about different languages, and what would be the best language and what not.

Then at one point I asked him what languages he had tried since last time we had been chatting about this topic. No langugages. No coding. He had tried nothing, only the talking.

So I said; Please don’t say one more word about coding before you code hands on for at least two weeks here at my place, starting now. Right now. I really don’t want to hear one more word, I only want to see your hands on the keyboard, fingers making lots of noise. Period.

The young man had no choice but to start coding (and stop talking). OK, I let him talk again after a week or so but… you get the idea. Hands on.

So he worked his way through some tutorials, including the videos in the link above (this: good tutorial to get started )

So now he’s allowed to talk with me again about coding. :wink:

// Rolf

4 Likes

I started here, detached from grasshopper to get basics on the syntax: https://www.youtube.com/watch?v=sQurwqK0JNE follow along and make sure you retype and recreate everything to get used to it and get some muscle memory, just watching is not enough.

Then I went here to get into using C# and Rhinocommon with Grasshopper: https://icd.uni-stuttgart.de/?p=22773 Same as above make sure you retype and recreate everything. Pause often, take notes.

Then I started trying to recreate Grasshopper components that already exist as practice.

Afterwards, I forced myself to start making a Plug-in (Pufferfish). I mapped out in writing first what things I wanted to make, then I started struggling through making them, it is much easier to learn when you have a goal, for me it was the plug-in.

While making the Plug-in I researched a lot on this forum, the old grasshopper forum , Stack Overflow , Rhinocommon SDK, Grasshopper SDK . Chances are any problem you have had, someone on the internet has had it before.

During the whole process, I had a few key friends much more experienced than I who I asked questions when I got stuck (won’t mention them here in case they don’t want to be bothered by a bunch of people also asking them questions), so try to find an expert or two you can rely on. The most important thing here though is I asked only very specific questions, that’s how you get answers. Vague questions like “How do I code in C#” won’t get great answers. Try and figure stuff out by searching first and ask someone or asking on this forum when you run into something specific or an error you can’t debug.

TLDR;
Learn basic syntax in general (You need to know the words before you can form sentences), define a goal and work towards creating it (Trying to learn by shooting in the dark isn’t going to help you at all), search online (Google is your friend) and ask specific questions.

9 Likes

Nobody was born knowing how to code. Not a lot of people were born with a builtin understanding of the basic math and logic concepts that are fundamental to coding.

Everyone here who has had success writing a script or program that works has spent many hours getting to the point where they can do that. Probably a full work week for a short script that will be used a lot. Hundreds of hours for those that have written relatively simple programs. Thousands of hours for more complicated programs.

Most people get interested in programming because they have discovered a repetitive task that they would like to automate. Then they discover it would have taken them less time to just do the task over and over. But they have learned the basics of programming so the next set of tasks goes quicker. And so it goes. And it becomes fun.

Once you start learning to program you never stop, no matter how many programs you’e written, unless you stop writing programs.

Even if you do stop you will carry with you forever a much more refined way of thinking logically and methodically that will serve you well in general.

As Rolf says, you don’t learn by just talking about it.

1 Like

So true, so true. Very good summary there.

True at least for normal (let others say that) regular deadly people like me. I’ve done my hundersds and thousands of hours, and I’m still having fun learning. Which is part of the charm with programming. Progamming is more stimulating than any game, since you never stop learning. There’s always a “next level”. Just plain fun.

But only if you get past the talking.

// Rolf

It all comes down to this.
giphy

10 Likes

Ha ha. I think you are bragging using only three digit bug tracking identifiers. :slight_smile:

// Rolf

gfb2a0ptbbv01

2 Likes

thank you all

we apparently stop for a moment, to apparently proceed again, maybe forgetting that there is no such thing as a halt or even progress? only apparently in our understanding, while further seeking for an answer.

when i was born, i had no sense of “driving”, living or generally of any goals other than to feed my mouth and to spare some excrements. being surrounded by people who all “found” their sense in life caused a subsequent impression on me almost forcing me to believe in what i cant describe. at some point of my life i became a plumber then a cook, then a graphic designer, then an architect to find out there is no clear yes or no for whatever you do its just a constant progress. you can headlock yourself into something believing you have understood it all and have found a goal but you didnt, only kicking holes into time and space yourself.

learning something new may not for all be an utter urge to fulfill a path, but to see it as a part of being, worthwhile enjoying even in the process of evaluation.

some things change faster then we see. blindly jumping down a rabbit hole sounds to me rather like escaping from the reality which some destine themselves trying to avoid understanding. to me it always matters where you go and what you do. call it esoteric if you wish and feel better then.

If you want to travel, and then trying to walk a distance, or go by car, or by train, or fly, or by boat, and you actually travel, then none of the alternatives would be to blindly jumping into a rabbit hole. That’s what I am saying.

Being paralysed, never actually trying to travel, is blindly sitting in a rabbit hole refusing to open your eyes and thus forever staying blind to travelling. And to programming.

That’s what I am saying. Go travel. Start programming. And when your eyes have ben opened about travelling, and about programming, then we can continue talking. :slight_smile:

// Rolf

-> there is a subtle but pristine difference in (blindly) jumping down the rabbit hole.

Don´t focus on the programming language but focus on your goals. If you want to become a web developer, learn HTML, CSS and Javascript. If you want to program nodes in Grasshopper, learn either Python or C#. Learning a programming language by itself won´t get you anywhere, you must first establish a way, find the application that you want to give your knowledge and then learn.

learn C, you need nothing else