PDA

View Full Version : New to coffee programming


jimzepellin
04-07-2006, 02:16 PM
I'm a pure programming beginner. Since coffee can be programmed in C\C++ and Java, I just wondered what are the pro's and cons of each language? Also could anyone recommend any beginner books.

Thanks

Darter
04-07-2006, 03:36 PM
COFFEE is a programming language. The Introduction in the COFFEE SDK gives a basic description of the language and how it compares to C++.

The SDK also has a Code Primer and COFFEE primer. Understanding how the SDK works is crucial.

I found mdme_sadie's COFFEE Node and SDK Primers and the 3DAttack tutorials to be very useful for getting started.

There have also been some illuminating threads on the C4D forums, e.g. http://forums.cgsociety.org/showthread.php?t=266742&highlight=C.O.F.F.E.E+function+called

A search for 'COFFEE' on forums such as CGTalk, C4D Cafe, 3D Attack, etc. will turn up many more useful discussions.

When you have a basic understanding, pull apart every script and COFFEE expression you can get your hands on. Scripts tend to be relatively simple and as such are good learning resources.

Kuroyume0161
04-07-2006, 11:56 PM
And don't forget the main and ultimate resource: PluginCafe (http://www.plugincafe.com/)

This is where you can get the COFFEE docs and technical support.

Robert

arctan
04-14-2006, 11:59 PM
Since coffee can be programmed in C\C++ and Java...COFFEE is similar to JavaScript, but not identical. Neither JavaScript nor COFFEE are "Java". They share some syntactical similarities, but they're all distinct langauges. I can name half a dozen constructs in each language that doesn't work in the others.

jimzepellin
04-15-2006, 03:31 PM
Thanks guys. I got a simple book on C++ and I've actually got a couple of books on Java script that have been hanging around waiting to be read. Which language would you recommend I start on to then be able to move on to Coffee. Certainly Java script would be helpful with web design but I would like the best workflow that would get me to understand Coffee better.

JDP
04-16-2006, 09:30 PM
COFFEE is very similar to C++, I would go for learning that first.

HTH
JDP

Kuroyume0161
04-16-2006, 09:52 PM
But there are differences. COFFEE is 'typeless' - there are only var's, no int,long,float,char,etc. But, the caveat is that arguments and results, although still typeless, are usually of a certain 'type', a string, object, or document for instance.

As far as I'm concerned, C++, Java, Python. Any will do as a starting point since these and COFFEE are all OOP (Object-Oriented Programming) languages. Just be ready to forget certain standards and idiosynchrasies in these other languages as COFFEE is not really derived from any of them.

Robert

arctan
04-17-2006, 10:09 PM
Which language would you recommend I start on to then be able to move on to Coffee.I think your premise is flawed. Why don't you just start in COFFEE, instead of "building up to it"? It's as good a starting point as any.

But if you insist on starting elsewhere, make it JavaScript. Of all the languages mentioned here, it's the one closest to COFFEE in syntax and design philosophy. You don't have to do it on web pages, if that's not your thing. Most of Adobe's professional apps are scriptable with JavaScript, and the ActionScript language behind Macromedia's Flash is basically JavaScript.

JDP
04-18-2006, 04:20 AM
I think your premise is flawed. Why don't you just start in COFFEE, instead of "building up to it"? It's as good a starting point as any.
I don't think it's entirely flawed as an understanding of OOP is helpful and is more readily learned elsewhere.

But if you insist on starting elsewhere, make it JavaScript. Of all the languages mentioned here, it's the one closest to COFFEE in syntax and design philosophy.

I don't agree, COFFEE is a mishmash of this and that, using 'var' and creating instances of objects is similar to Javascript but declaration of objects and object model is closer to C++, which is why I suggested it.

Declaring an object in Javascript:

function MyClass()
{
var my_data = 0;
this.SetData = SetData;
this.ShowData = DisplayData;

function SetData( data)
{
my_data = data;
}

function DisplayData()
{
alert( my_data );
}
}

In C++:
class MyClass
{
int my_data;
public:
MyClass();
void SetData(int data);
void ShowData();
};

MyClass::MyClass()
{
my_data = 0;
}

void MyClass::SetData(int data)
{
my_data = data;
}

void MyClass::ShowData()
{
cout << my_data << '\n';
}

In COFFEE:
class MyClass
{
var my_data;
public:
MyClass();
SetData(data);
ShowData();
}

MyClass::MyClass()
{
my_data = 0;
}

MyClass::SetData(data)
{
my_data = data;
}

MyClass::ShowData()
{
println(my_data);
}

On reflection I think Kuroyume0161's reply was the best advice.

cheers
JDP

CGTalk Moderation
04-18-2006, 04:20 AM
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.