Which language should a total beginner try to learn first?

Yes I can see how the lack of a lot of explicit information in python could be quite discombobulating coming from another language. There is a lot there in terms of significant white space, scopes, name spaces, multiple inheritance and composition but much of it is hidden so as a beginner you don’t need to worry about it until you need it and as you get more experience you need to know where to look. I found the book Fluent Python to be great for getting to know things like the python object model in more detail.

Slow but steady Wins the Race.

1 Like

I have found that Python, with calls to C++ for performance, is best. Initially I develop everything in Python because it is so easy to debug and has a rich collection of easy to use data structures. Then I profile the code and push the slow parts into a C++ DLL using Visual Studio. The C++ provides 10-100X speedup for my mesh manipulation code.

Having started with Fortran on an IBM 1620 computer with 0.05 MHz CPU clock back in 1966, these days I am in 7th heaven using Python with C++ in Rhino on my 4 GHz 18-core computer. C# is ok but C++ can get you a little closer to the hardware for a bit more performance.

This link rates Python as #1 in popularity.

https://www.google.com/url?sa=t&source=web&rct=j&url=http://pypl.github.io/&ved=2ahUKEwiDo97p48DrAhXJnuAKHYCLAlcQFjAMegQIARAB&usg=AOvVaw1jQQJu5oC2L92ODD0yWob-&cshid=1598717067929

Regards,
Terry.
Retired Intel engineer

5 Likes

the missing answer for me is still, why not use C++ instead of C# generally? i am reading that the speed performance is significant, dealing with tons of data which has to be processed and knowing that i rather take an extra curve or 2 to straighten out the performance. i am also reading that C++ with Qt is the more mature option to do cross platform development.

@DavidRutten does C++ not digest well in grasshopper? or what is the reason you recommend C#

If I undestand Max’s message correctly, he asked about coding scripted components in GH.
Those only exist for VB, C# and Python, AFAIK.

I’m also interested in coding entirely new components but, yes, scripted components to start.

1 Like

But with Python you can call a C++ DLL in the few places you need more performance. So C++ is still in the ring.

1 Like

Memory allocation isn’t an important programming concept. It’s only important in C and C++ because those compilers don’t do it for you.

Similarly, de-allocations, pointers, references, instances, header files, and so on are only important within the contexts of certain languages.

2 Likes

Where did you read that?

It is possible to come up with examples where C++ code outperforms the best possible C# implementation, but these are always fairly contrived. Unless you are writing a world class raycaster or graphics driver, it is unlikely that the marginal benefits really matter.

Performance improvements are almost always to be found in writing better algorithms, not in switching languages.

Especially within the context of grasshopper you definitely want to stay away from C++ unless you want to maintain an intermediate .NET project which interops between your core code and GH, or use C++/CLI. (You should want neither of those btw.)

5 Likes

i at least have filtered that in my believe here. i should add i was hunting info focused on platform independency, thinking that grasshopper should be acting in favour of it.

@encephalon that discussion seems to talk about the performance of various UI platforms, not about whether adding two numbers together is faster in C++ or C#. If you have to wrap or emulate your interface then that tends to affect the responsiveness and/or maturity of the user experience.

GTK and QT I think are cross platform UI kits.

2 Likes

Reading everyone’s suggestions here and after watching some YouTube videos, quora, blogs, article. Finally, everyone’s conclusion seems to be this.

C# it’s in-demand nowadays go for it

Hope they have to update the curriculum.

Why ?
To lock them to Microsoft ? :wink:

… In Microsoft’s world. :slight_smile:

We’re talking about Rhino /GH here.
Rhino is strongly tied to Microsoft technology.
RhinoCommon in written in C#.
I think Grasshopper is also written in C#, and using C# you can write GH add-on’s.
Then C# makes sense IMO.

2 Likes

I would try 2 or 3 languages at once and see what fits best. Performance is overrated. The level of frustration is the relevant metric. The language you feel most comfortable is the one which takes you further. And thats what it is all about. Keep it as simple as possible. To be successful you need positive experiences.
Regarding the languages, its a lot of religion…

8 Likes

Yeah i know this.

Grasshopper is written in VB.NET and C#, Grasshopper2 will be written only in C#.

By David Rutten .

Definitely not lock them in one. Just as market demands.

I go with @TomTom point and my pervious point.

2 Likes

Prof. Luis started new C# series. Weekly live streams this might helpful for learner’s.

His Discord server:

As beginner the best is PYTHON.
Surely C# has more advanced options, moreover C++ is the best for advanced specific issues.

Grasshopper 1.0 is written in VB.NET, with some of the standard component libraries in C#.
Grasshopper 2.0 is pure C#.

2 Likes

This.

Please mark that post as the answer @Max3

2 Likes

Since this discussion already seems to be a huge opinion piece, I’ll give my two cents too. :wink:

The overall performance of C# isn’t that great, compared to fully compiled, lower-level languages like C++. Even the core of Rhino is said to be written in C++, and it would probably be beneficial - performance-wise - if Grasshopper was too.
It’s no secret that C# is pretty much Microsoft’s response to Java, which nowadays is considered a terrible, yet widely used programming language.

C# as well as Python are interpreted, high-level languages, with memory and thread management, as well as a suite of other tricks that make programming “easier”. The trade-off however is performance. A good comparison might be Unity (C#) and the Unreal Engine (C++). UE excels in cutting-edge 3D graphics and Unity in usability (but that’s also why it’s mostly used for less demanding mobile applications).

Now Python surely isn’t the fastest tool in the programming language shed, but again it’s probably one of the easiest to learn. And it teaches you the basics (i.e. variables, loops, conditionals, functional programming, object-oriented programming, etc.) that apply across the board.

I have a special appreciation for Python, because it was the first scripting language that I learned a few years ago, but like @Terry_Chappell describes well above, it also allows you to conceptualize your ideas very quickly and concisely.
I think the appreciation for Python among “advanced” Rhino/Grasshopper users has become so low, because IronPython is a humongous dumpster fire and McNeel currently seems inapt to come up with a Pythonic feature set that parallels what C# can do in Grasshopper.

CPython, the regular flavour, is another beast entirely with an overall much better performance and really great libraries (aka modules) that are appreciated by many different people and disciplines. I mean in Python you can do pretty much anything, from dynamic web development, game programming, creative coding to machine learning, circuit programming, and much more.
C# on the other hand is primarily used in Windows applications, like Rhino, and some game engines.
A good analogy would probably be if you had the choice to learn a rather simple language like English or a more complex one like French (not that it’s impossible to learn both or even more).

@Max3 If you’re only desire is to make proprietary, closed-source Grasshopper components in VisualStudio, I’d say go with C#. However, if you want to add a great multi-tool to your belt that works great on many platforms - beyond Rhino/Grasshopper - go for Python (and make your code open-source and share it)! Oh yeah, and Blender, Houdini, Maya and many other apps have great Python support too.

I’m currently learning C++, which I plan to use for more performative projects. Here the possibilities are nearly endless and you can extend Python with it.

Update:
I guess the McNeel preemptive censoring apparatus struck again! Thanks, for closing this thread supreme moderator Rutten! :nauseated_face:

4 Likes