Which first? Tcl or C++ ???


#21

Yeah, it looks like you have the right idea JLV in your summary of suggestions. I would say that if you are pressed for time and you really need to prioritize, learn C first. I really believe that even though C has pointers, if you have good introductory texts in C you can start in C no problem. C has been around for awhile now and many of the new authors are aware how to properly teach the concept of pointers and their appropriate usage.

I would get atleast three texts on C. Get one reference text which just lists all the functions of C, one layman’s text which attempts to ease the pain of learning basic C concepts, and one other advanced C learning text which gives exhaustive in depth explanations for C concepts. This way, you read the beginner text on C. If there is something you still don’t understand, you go to the more in depth text. Once you are programming in C, you use the reference text to get to functions that even an advanced teaching text would not include(perhaps the functions come too close to redundancy). I think C++ is a bit over-hyped these days. Yes, Object Oriented (OO) programming has some advantages, but procedural programming for the most part can accomplish many of tasks done in OO languages with less confusion. I believe we lose many potentially great programmers because they took an OO class like C++ as their first class instead of C and became hopelessly confused or discouraged. For your own sake, learn things one step at a time. Learn C before you learn C++.

As mentioned earlier, C is the language which many other graphics-specific languages resemble. RSL looks like C, the original renderman scene description is C, and I believe Mental Ray is C. If you were to read the “Renderman Companion” without knowing C, you would most likely be lost. By learning C, you would be killing the most birds with one stone - so to speak.

Next I would learn either RSL or C++. C++ will allow you to work more with 3d software API’s. I believe both Maya’s and 3ds Max’s SDKs are C++ oriented. You may not get tangible results as fast as scripting, but again, you shouldn’t have trouble moving from one software API to another because they both will be using C++. With scripting, you are almost going to have to start from scratch again, because you can’t make any assumptions about the nature of the scripting language. MEL is not Maxscript. Eventually, you will want to learn scripting because it’s often faster to throw some scripted code together. By the time you have learned C and C++, learning scripting will be a piece of cake.

As Rendermaniac has said," - there is almost no way of getting away from it!(RSL)". Since you just learned C you would easily flow into RSL and the C API for renderman scenes. There are so many influential computer scientists(who are suprisingly accesible) that use renderman and many renderman compliant renderers strive to include the newest rendering technology. On top of that, the renderman support base is strong. Renderman also seems to be the best of the few open doors leading to visual effects production house techniques. Many effects houses use renderman compliant renderers for their shots and speak in renderman-ese when they give behind-the-scenes technical presentations and explanations. Renderman is probably the closest thing to a postscript/universal language for rendering.

If you are not pressed for time then I would start at the beginning (or close to it). Get a text on the basic workings of a primitive computer and how assembly language/machine code works with the microproccesor. You don’t have to study this in detail, just an elementary understanding will do. Once you have this knowledge, C pointers and addresses will make more sense. What’s the point in all this? If you want to understand the core of programming, eventually, you have to study hardware.

Before you study C++, read a book on the Object Oriented philosophy. By studying the philosophy separate from the rules of grammar and syntax in a particular programming language, the student can more easily pick up any OO language. Why? because the underlying OO concept is the same for all OO languages. Unified Modeling Language (UML) is a way (sort of) to study the philosophy of programming, but it can get into cumbersome rules as well. It is a good way to approach programming design though.

So I recommend:

A.Bare minimum

  1. C
  2. C++
  3. Renderman

B.With all the time in the world

  1. Hardware/Software general knowledge
  2. C
  3. Object Oriented Philosophy
  4. C++
  5. Renderman
  6. Scripting

#22

rendermaniac -
Thanks for that link.

artistx -
Thanks for that very informative post. Your suggestions pretty much parallel the plan I’ve started with. I get a little confused when I hear such amazing rants about Python, Ruby, etc., and how that is the best/easiest way to get your feet wet in this stuff.


#23

A.Bare minimum

  1. C
  2. C++
  3. Renderman

Sorry, but I totally disagree here. From programming point of view it is completely nonsense to learn C if you want to learn C++! C is a subset of C++ anyway, means it is still possible to write C in C++ (though not recommended at all ;), but this is has several reasons (also marketing, so the old C-gurus can turn to C++ more easily). Well, C++ is actually not based on C! but was developed as an own language. The programming paradigms are either object oriented and procedural/structured. C++ isn´t meant to be a pure OO-language because it MUST be possible to write systemprogramming with it!

Stopping this programming stuff, what I want to say is, if you want to learn C++, then do it right away and do NOT!! learn C before. This does not help you understanding OO and C++, it even prevents you from better getting into it. (Actually Stroustroup once even said that it´s kind of a mistake letting C-Coders programm in C++, because they cannot get away from their old C-Stuff). Stroustroup clearly says: DO NOT CODE C IN C++ if you want to code real C++. And I can only support this!

Why you should not learn C if you want to learn C++ is shown well here (a clear remark that C++ is meant to be independant, but containing a C-subset because of strategic reasons):
http://www.research.att.com/~bs/bs_faq.html#prerequisite
http://www.research.att.com/~bs/bs_faq.html#how-to-start

And maybe an interview with Stroustroup (pretty up-to-date):
http://www.artima.com/intv/goldilocks.html

Well, didn´t mean to hijack anything here (cause usually I do not look into this forum at CGTalk but that one was interesting :slight_smile: )

Just my 2 Cents…

Good luck!
Best
Sam

Btw.: I think python is a good deal too. Very good OO language IMO!


#24

Originally posted by rendermaniac
Sorry to be offtopic, but anybody wanting some Ruby references can find a good introduction here http://www.linux-mag.com/2002-04/ruby_01.html.

That link is dead.

For the introduction to the language, check:
http://www.rubycentral.com/book/

For general questions:
Newsgroup comp.lang.ruby
It is an active community with knowledgeable people (including matz, the language creator and two other Japanese implementers all of whom speaks good English)

For good comparison/transitions from other languages, check:

Python:
http://raa.ruby-lang.org/list.rhtml?name=pythontoruby
http://www.ruby-doc.org/RubyEyeForThePythonGuy.html
http://www.rubygarden.org/ruby?RubyFromPython

C/C++/Perl/Python
http://www.informit.com/isapi/product_id~{A76D1D1E-AD7D-483E-AB8D-38FB188396C5}/element_id~{F35419F2-DABB-4CDE-9347-98A5092F0778}/st~{58BD298A-1CB6-4590-B92D-95DFC1EA9331}/session_id~{29B134D0-2DC8-4469-AD1A-23BD4E2364E3}/content/articlex.asp
http://www.rubygarden.org/ruby?RubyFromOtherLanguages

Perl
http://www.theperlreview.com/Issues/The_Perl_Review_0_6.pdf

I think it’s definitely worth having a look at by people out there (but not really as a first language - hence offtopic). I’m warming to it.
[/B]

I’d not consider it off-topic. I’d rank ruby as one of the best introductory languages, even if its docs currently suck. O’Reilly and others now have books on it (albeit about the much more inferior 1.6 version). Some universities in the States are now starting to teach it either together or as an alternative to python.
I’ve been using the language for about a week now and have absolutely fallen in love with it. I don’t know. It just clicked with me. It is everything I wished python and perl were.
It’s the second language I’ve learned in one day (TCL was the other, albeit of course TCL’s syntax is silly) and the first one I became proficient within a week.
I’ve now removed python from my hard drive (a language I always hated) and will only keep perl around for its great docs on regex.
Ruby’s phylosophy going around the net is that is a language with a Principle of Least Surprise (ie. what seems to logically work, usually does).

Here’s a good description that echoes my own.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/79533


#25

This is all fantastic stuff - I’m not sure I want to delve so far towards Technical Direction if I have to learn .NET etc… This may be career-counter-productive, but I think I want to learn enough to be able to supervise productions, but still be able to work on the creative side of production. I don’t want to be an IT guy, even if it is a gfx IT guy. That aside, I believe I will continue to pursue C++ and add Python to that list. I completely understand the importance of RenderMan and will return to my reference books on the subject once I feel I have a better control of C++. Quick questions though. If I want to write my own shaders from scratch, do I need to learn C, or is C++ sufficient?

Thanks for all the replies!!!

Sean Looper


#26

Hello Designer. I agree with you wholeheartedly. Perhaps my wording was off a little, but my message was already getting long. In my defense I just want to clarify the matter. Unfortunately, this will lead to another long post.

One should learn C first, but not so much because of its similarity or ~encasement in C++, even though both these things are contributing factors. Yes, C programmers often try to hack through C++ by using C methods. This goes to show that you can’t halfway learn or use any language. By the same token, you can’t learn C++ and go backwards and expect C to perform the way C++ does. Many of the functions do the same thing, but the keyword is different. I would guess, hacking through C with C++ wouldn’t be a fun experience either. So our poster should thoroughly learn C and then completely learn C++ and its etiquette. This provides a conceptual and historical progression of learning. This will prevent the horrible C/C++ hybrid code.

I chose C as the first one to learn because it is fairly straight forward (withholding the pointer) and will give our poster the broadest application area. That is, he/she can apply C to RSL, the renderman C api, etc. C++ will also give you a broad application area, but there is more to swallow in terms of language and concept. It caters more to a modeler’s api (i.e. Maya SDK or Max SDK). C resembles other rendering languages more so than other full languages like Java, Visual Basic, etc. In addition, C has a wide-spread general usage in the programming community. So with ease of use and broad application, C is giving you the best bang-for-your-buck so to speak.

Slooper, I think C is sufficient the majority of the time if you want to write shaders. On occasion C++ may be needed. It’s good to learn both. I would choose C first.

It is a tough decision. I hesitated myself even as I was typing the first post on whether to recommend C or C++ first. If you want to ease into programming and you want to work with shader programming, I would go with C. If you want to work more with scene manipulation and plug-in work, go with C++. One eventually will call on the other and so, in the end, you will have to know both to a certain extent. For example, let’s say you only know C and renderman. Then one day you want to bring one of your models that you built in a modeler package, say 3ds Max, into your renderman compliant renderer because your renderman compliant renderer has some extra cutting-edge features in it. You would need to use C++ and the 3ds Max SDK to build a good RIB exporter. On the other side of the coin, lets say you’ve been building exporters using C++ for the longest time, transfering files from XSI to Maya to Lightwave and so on. Then comes a day when you need to bring your scene into a renderman compliant renderer. You need that renderer because you have a special shader you want to build and no other modeler software offers the ease and extensibility you’re looking for in their built in renderer. So you end up having to learn C to properly program and to better understand the shading languages and renderman scene description.

I believe that we lose beginner programmers because they are trying to swallow the OO concept and an accompanying language as opposed to learning a procedural language first. C++ is a powerful language, but it could be too much at once. That’s why I recommended that our poster buy a book on the OO oriented philosophy first. Even though C++ can’t be neatly categorized as an OO language it does use OO concepts. Going from C to C++(or any other OO language) is not a smooth progression. I never meant to imply this. Learning the general OO philosophy first will help the transition. However, I do believe that going from C to RSL or the renderman scene description is a fairly smooth conversion.

Statistics show that first time programmers pick up scripting faster than they pick up a full language. I suppose it’s ok to learn python,perl or ruby if you have the time and don’t mind waiting to learn another language before you can apply it to shader programming. I would be more an advocate for learning scripting first if it allowed you to apply the scripting as a rendering language. For example, it would be nice if you could apply your python code as RSL or scene description. There may be API bindings out there like that, but they are not in widespread use. Not as many renderman users would be able to help you if you had a question and you were using that scripting binding. You will still have to learn C and C++. With wiser C language teachers and better texts out there, I truly believe one can start out using C as their first language.


#27

Originally posted by gga
That link is dead.

That’s because it had an erroneous ‘.’ on the end…

It should be:

http://www.linux-mag.com/2002-04/ruby_01.html


#28

Out of interest there is a very nice RenderMan API in python called Cgkit http://cgkit.sourceforge.net/

I think the Aqsis developers have used it quite a bit.

Simon


#29

Interesting, Rendermaniac. I just downloaded that cgkit. I wasn’t aware that the python api binding was big in the aqsis community. Thanks for the link.


#30

Im a dev guy with a CS background and Im currently working in the technical dept. of a (post) production house/animation studio. Our country is very new to all this and my company is pretty much the only company right now doing all this.

After reading all your posts, I was just wondering how can I use my CS knowledge (I know substantial C/C++ and MEL etc.). Right now I, alongwith some other guys, are doing all the procedural animations, scripting and plugin development etc. but all is for MAYA right now.

I’ve had around a year’s knowledge of game/graphic programming with OpenGL and I used quite a lot of 3rd party APIs like SDL, OpenAL etc. for different purposes and I also developed a plugin for a map editor for our game using Python so I know Python is an easy language and I can pick it up very quickly.

Question is: where do I use this knowledge to help my company ? Like we don’t have any formal FX/Rendering TDs and stuff…so I wanted to know how TDs actually work using all these languages so that I try to go in a positive direction.

Thanks

P.S. Currently we guys are working on procedural animation setup for a pool of sperms swimming in a direction (sort of flocking) etc. for some movie.


#31

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.