Because I am learning Python, I was thinking today, which programming language is used for building a plugin for Rhino; C, C#, or Python?
get some basic infos here:
Hope this bullet point comparison help you clarify at least some of your doubts :
- Personally, I use Python for most modules and C# for CPU-consuming tasks.
- Both Python and C# can be used for similar tasks as they share the common SDK (rhinocommon).
- Python can also work using RhinoScriptSyntax, which is beginner-friendly.
- If you’re new to programming, Python is suggested due to its less verbosity, fewer keywords, and human-friendly syntax.
- C# is also easy to pick up, but may require some time to get accustomed to. One advantage is the ability to use NuGet packages.
- Rhino7 Python may not allow the use of other libraries, unlike C#.
- Python is crossplatform, C# is windows only
- Avoid using C++ as a beginner script developer due to its verbosity and lack of human-friendliness.
My personal suggestion would be to start by experimenting with Rhino script syntax if you’re a beginner. Keep in mind It’s painfully slow, but you can do so many things already if you already rs, which is extremely easy to pick up, even for people without a programming background
Thank you so much, sir
There was no better answer than this for me; short but comprehensive.
Your guidance took me the right way, but I still hesitate about which one of the languages is more professional and useful to create a plugin (like what is in Food4Rhino).
I ask this question because I want to choose the best language for this purpose in the future. If I spend my time learning Python and then realize it has some shortages for creating a plugin, I think I have lost a lot of time.
I would not look at it like that. Learning Python will never be a waste of your time, in my opinion.
As I said, C# and Python can both accomplish the same tasks, unless you need external nuget packages for complex ideas.
Learning Python is very useful in my opinion.
There you can see what you can do when you use C# and Python, but keep in mind It could all be accomplished using Python.
That was to say, Python is extremely useful and would most certantly not be a waste of time, I’d suggest learning rhinocommon if you are worried about limitations and skip rhinoscriptsyntax entirely.
Thank you, sir
I am so glad and honored to see you
Does this mean such plugins can not be written in Python at all?
I had no such intention. Python is great. It is an advanced programming language and is used in numerous fields. As long as I learned it up to this point, it is sweet and excellent! If we even look at Rhino, we will see Python is a part of the body of this gigantic software. So my purpose was not to consider it as a lower language.
I did mean; I am eager to create a plug-in for Rhino in the future (of course, it is now a dream), and I questioned which machine language is used for producing such plug-ins. I expressed, ‘if Python is not suitable for such plug-ins (that are operated by Rhino), it will be better, in the first stage, I spend my time learning the relative language that senior Dale pointed out, those are C# and C++’
This is not true. C# can be used on macOS to accomplish all the same Rhino / Grasshopper tasks you would use it for on Windows.
After being enlightened by the masters, I decided to leave Python temporarily and go to C#. All night up to morning ( now I am napping LOL), I studied C# tutorials in “w3schools.com” that is an excellent instructive reference for all programming languages.
After that, I tried to choose a light IDE for C#. The new Visual Studio IDEs have massive volumes, and I couldn’t download one of them and have to use a prepared one on a CD later.
Unlike Python C# needs a compiler, though its syntaxes and methods are similar to Python.
This case seems problematic, because using Python with a simple IDE without compiling was so easy and comfortable.
Nevertheless, my desire to create a plug-in with C# in the future overcame the hardship of working with C# and Visual Studio IDE and compiler. Generally, I think Python has a better location in simplicity, modernity, and universality, while C, Java, and similar applications do their essential jobs. C and Java are the basis of so many applications, and Python is getting high like a young eagle to reach them.
I don’t know whether someday Python can reach the universality of C and Java or no, but it has become a popular programming language that does everything except some essential jobs that are particular to C and Java.