Digital Paint Discussion Board

Development => General Development => Topic started by: Garrett on October 27, 2007, 11:19:54 AM

Title: Standard Dialect of C and C++
Post by: Garrett on October 27, 2007, 11:19:54 AM
What is the standard dialect of C and C++?  What dialect does DP use?  Would anyone be able to show me a standard C and C++ Tutorial because most of the things I found on Google were just garbage.
Title: Re: Standard Dialect of C and C++
Post by: cusoman on October 27, 2007, 12:40:59 PM
Hello Garrett, Google worked nice for me...
http://www.cplusplus.com/doc/tutorial/  ;)
lol oh well.
Also, by dialect i think you mean syntax, and the syntax of c++ is the syntax of c++, no other way to say it.
And DP was coded in C using the VC++ compiler.
-Cusoman
Title: Re: Standard Dialect of C and C++
Post by: Garrett on October 27, 2007, 01:52:04 PM
The tutorial i had started reading was used with Unix.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on October 28, 2007, 11:36:01 AM
How much of a difference are there between a UNIX dialect and the standard dialect.
Title: Re: Standard Dialect of C and C++
Post by: cusoman on October 28, 2007, 03:32:45 PM
ummm, unix is an operating system. ;D similar to linux.  so if you learned how code in c++ on a linux based system, the application would not run on windows. Thats why in the paintball 2 source there is the windows version to compile, and the linux version to compile. u can compile linux-based, or in this case unix-based applications on windows, just not run them.  they use different syntax.
-Cusoman
Title: Re: Standard Dialect of C and C++
Post by: lekky on October 28, 2007, 04:14:20 PM
java ftw
Title: Re: Standard Dialect of C and C++
Post by: Garrett on October 28, 2007, 04:24:14 PM
Java doesn't have different syntax right?  It ports to different a different OS easily?  So if I would want to write any type of program in C / C++ for the windows OS, I should learn the standard version correct?
Title: Re: Standard Dialect of C and C++
Post by: Zorchenhimer on October 28, 2007, 05:22:40 PM
They do not use different syntax.  They use different libraries and some different means of doing things.  But, C++ is C++.  If they used different syntax, then they would not be the same language.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on October 28, 2007, 05:47:47 PM
The different libraries correspond with the OS then?
Title: Re: Standard Dialect of C and C++
Post by: lekky on October 28, 2007, 06:12:04 PM
Garrett, these dialects you speak of are with regards to the different C++ compilers. But they should all support the standard C++ functions so you don't even need to worry about this if you're just starting out. Forget about it until you get the basics down ok?

Or better yet learn Java and clear your mind of different OS support :D
Title: Re: Standard Dialect of C and C++
Post by: Garrett on October 28, 2007, 06:34:17 PM
Haha.  Thanks for the help.  I'm learning Java in school in 3 months so I'll be taking your advise.
Title: Re: Standard Dialect of C and C++
Post by: jitspoe on October 29, 2007, 09:43:05 PM
Java is evil.  If you want to write applications that can easily compile and run on multiple operating systems, just use something like SDL.
Title: Re: Standard Dialect of C and C++
Post by: Zorchenhimer on October 29, 2007, 09:55:39 PM
Java is the devil Bobby Boucher.

:D
Title: Re: Standard Dialect of C and C++
Post by: Deranged on November 03, 2007, 02:26:45 PM
Just to polish this off, In general all major C++ compilers these days have at least 99% compliance with the ISO standard for C++. The major differences come when you go to use things like sockets(wsa_2 on windows, sockets on unix/linux/mac/bsd/etc), and even then they are very similar in use..

Forget about it until you get the basics down ok?

Good advice :)

Or better yet learn Java and clear your mind of different OS support :D

Bad advice :(
Title: Re: Standard Dialect of C and C++
Post by: lekky on November 03, 2007, 04:13:07 PM
Bad advice :(

Depends.
Title: Re: Standard Dialect of C and C++
Post by: y00tz on November 03, 2007, 05:06:38 PM
Depends.

It seriously does.  If you've got several people working on a project and you need a quick and dirty tool, Java can be the best route to go.

Title: Re: Standard Dialect of C and C++
Post by: lekky on November 03, 2007, 05:31:06 PM
It seriously does.  If you've got several people working on a project and you need a quick and dirty tool, Java can be the best route to go.


:o Java is worth of a better example than that.
Title: Re: Standard Dialect of C and C++
Post by: y00tz on November 03, 2007, 05:33:21 PM
I didn't say Java was a dirty tool... I've never made a web service with Java, just .NET, I just feel that even C and/or C++ purists can use Java in a practical fashion, regardless of their capacity or need.  It seems like even when I agree with you these days you have to refute :P
Title: Re: Standard Dialect of C and C++
Post by: sk89q on November 03, 2007, 07:22:06 PM
It seriously does.  If you've got several people working on a project and you need a quick and dirty tool, Java can be the best route to go.



It depends on what kind of tool you need, because Java is not quick.
Title: Re: Standard Dialect of C and C++
Post by: lekky on November 03, 2007, 07:24:12 PM
It depends on what kind of tool you need, because Java is not quick.

We have already know that it depends.

Depends.

Java is not quick? Maurice Greene is not quick.
Title: Re: Standard Dialect of C and C++
Post by: Deranged on November 03, 2007, 07:25:03 PM
Well. I don't like Java simply because you can't test if an int/double/any non-boolean is non zero without explicitly typing it.. (like if(someint) won't work, you have to type if(someint != 0), same with if(!someint)) Also I don't like the whole only allowing one public class per file thing.. things like that should be the programmer's choice not the tool's

That's why I prefer C# for my completely OO environment :)
Title: Re: Standard Dialect of C and C++
Post by: y00tz on November 03, 2007, 08:18:02 PM
Only one public class per file?  I'm not sure that limitation still exists.


It depends on what kind of tool you need, because Java is not quick.

When I think quick and dirty tool, I think, reusing my editor classes to conform quickly to whatever map, files, etc.  that I'm looking to work with, not quick as in OMG PONIES JAVA IS DA BEST!11111
Title: Re: Standard Dialect of C and C++
Post by: Eiii on November 03, 2007, 08:23:06 PM
C# isn't much better on the small/fast side. I love it millions of times more than java, but I wouldn't release an actual project in it (anymore).
Title: Re: Standard Dialect of C and C++
Post by: y00tz on November 03, 2007, 08:28:19 PM
Yeah exactly, a project would be reserved for the best language in terms of features and platform compatibility... but my point about Java was just that it was nice to use when you need it for something small, especially when you have no idea what platform it would be used on.  Nobody is going to agree or persuade anyone, so don't bother flaming this thread.
Title: Re: Standard Dialect of C and C++
Post by: lekky on November 03, 2007, 09:05:17 PM
Java is still the most "popular (http://www.tiobe.com/tpci.htm)" programming language, thus you are more likely to have a job if you know it.

Yeah exactly, a project would be reserved for the best language in terms of features and platform compatibility...

Need any more be said :P

Title: Re: Standard Dialect of C and C++
Post by: Cobo on November 03, 2007, 09:34:49 PM
Solution: Learn all the languages.
Title: Re: Standard Dialect of C and C++
Post by: KnacK on November 04, 2007, 08:13:23 AM
/me takes a peek @ the chart:

I didn't realise that visual basic was that high up on the ladder.
What's really amazign is that there is no mention of assembly or machine languages....
/me is getting way too old...
Title: Re: Standard Dialect of C and C++
Post by: Garrett on November 05, 2007, 03:33:20 PM
Man this chat went from me being able to understand what being said to blahhhhhhh.... Gotta read more I guess
Title: Re: Standard Dialect of C and C++
Post by: jitspoe on November 06, 2007, 05:07:58 PM
Blame it on Java.  It's not quick and dirty, it's slow and dirty. ;)

I'm going to have to agree with eiii here on C#.  I've barely touched it, but it's pretty simple to use.  You can just drag and drop stuff on an interface and make it work.  It's good for learning the basics of programming, but I probably wouldn't release any projects with it due to the potential dependencies/overhead/compatibility issues.
Title: Re: Standard Dialect of C and C++
Post by: S8NSSON on November 06, 2007, 06:27:57 PM
All programming is the same, short of assembler and register/stack hell.

It's all about the libraries, or writing your own!
Title: Re: Standard Dialect of C and C++
Post by: Xirul on November 17, 2007, 02:01:49 PM
ummm, unix is an operating system. ;D similar to linux.  so if you learned how code in c++ on a linux based system, the application would not run on windows. Thats why in the paintball 2 source there is the windows version to compile, and the linux version to compile. u can compile linux-based, or in this case unix-based applications on windows, just not run them.  they use different syntax.
-Cusoman

that's not true at all =/.

The syntax for C++ is the same, no matter the OS..  I liked C++ for Dummies to start off, personally.  Web tutorials ftl, books ftw!  Spend $20 =P
Title: Re: Standard Dialect of C and C++
Post by: jitspoe on November 19, 2007, 07:02:10 PM
You can't copy/paste from books. :P
Title: Re: Standard Dialect of C and C++
Post by: webhead on November 30, 2007, 03:13:50 AM
/me takes a peek @ the chart:

I didn't realise that visual basic was that high up on the ladder.
What's really amazign is that there is no mention of assembly or machine languages....
/me is getting way too old...
yah, visual basic is out there more than some ppl realize.
and ... i think i might like to learn assembly some day :)

Blame it on Java.  It's not quick and dirty, it's slow and dirty. ;)
...
ACTUALLY... that's not necessarily the case anymore. [reference link (http://java.sys-con.com/read/45250.htm)]
but i'll give you this, one thing i hate about java is the gui it makes. that alone would make me want to use a language that can be compiled to natively run on a particular platform.

i haven't learned any c++ yet... but so far, i think i like C.
oh ... and PHP, but that doesn't count. ;)
Title: Re: Standard Dialect of C and C++
Post by: sk89q on November 30, 2007, 12:29:19 PM
*Assuming* those results are accurate, which are dubious in themselves (seeing the guy doesn't have much of a clue of what he's actually doing), the server JVM seems to be much faster, but the downside is that it uses more memory and takes longer to start up. The client JVM is already horrible at that, so I wouldn't want to use the server JVM anyway. The GUI libraries for Java also seem to be very bad; they're ugly, not native, don't refresh correctly, are slow to update, etc. etc. For most application, the faults in the GUI negate any optimization that may be available in Java.

PHP is an interpreted language, though it can do native GUIs easily. Downsides, besides not being compiled, are that there is no official support for multi-threading and that the runtime library is huge. However, I'd rather using a PHP program more than a Java program since its interface feels natural and not like a fake crappy attempt.

In other news, Actionscript is getting more prevalent now, with Apollo and all.
Title: Re: Standard Dialect of C and C++
Post by: lekky on November 30, 2007, 02:35:06 PM
PHP > Java. Good one sk89q. Ever heard of SWT?
Title: Re: Standard Dialect of C and C++
Post by: webhead on November 30, 2007, 05:33:29 PM
...
The GUI libraries for Java also seem to be very bad; they're ugly, not native, don't refresh correctly, are slow to update, etc. etc. For most application, the faults in the GUI negate any optimization that may be available in Java.

exactly what i was trying to say ... but worded better. :)

PHP is an interpreted language, though it can do native GUIs easily. Downsides, besides not being compiled, are that there is no official support for multi-threading and that the runtime library is huge. However, I'd rather using a PHP program more than a Java program since its interface feels natural and not like a fake crappy attempt.

In other news, Actionscript is getting more prevalent now, with Apollo and all.

Yah I've never tried out the whole PHP-GTK thing but it sounds sorta interesting.
and ... actionscript??? to make actual programs?? not Flash files??? hm.
Title: Re: Standard Dialect of C and C++
Post by: sk89q on November 30, 2007, 05:49:34 PM
PHP > Java. Good one sk89q. Ever heard of SWT?

I didn't say PHP was better than Java. I was saying I would prefer using a PHP interface than a Java one.

Yes I have heard of SWT, and I am pretty sure I have used programs that used SWT. However, I have never, in my life, come across a Java program that actually successfully emulated the native interface. I don't program in Java, although I've learned it. When you use a Java program, you know it's written in Java. There shouldn't be a reason (other than startup time) that I should know that it's Java.

However, if you use Winbinder with PHP, there is no way to tell you that the program is written in PHP. Now, the toolkit was written in C, but that doesn't matter to me. It has the responsiveness of a program compiled to native machine code.

exactly what i was trying to say ... but worded better. :)

Yah I've never tried out the whole PHP-GTK thing but it sounds sorta interesting.
and ... actionscript??? to make actual programs?? not Flash files??? hm.

Macromedia/Adobe has been going to way of extending Actionscript into many different uses and platforms for several years now. The language has been completely revamped; Actionscript 3 is barely anything like Actionscript 1 other than the basic EMCA syntax. Performance has more than quadripled between incrementing versions of the Actionscript engine. Programming AS is now very object oriented and it fully supports the popular paradigms like model-viewer-controller, etc. Flex and Adobe AIR are two RIA frameworks that have come out recently that come to mind.

We're not to the point of ubiquitous downloadable Actionscript programs like Java has, but Adobe may be going there. With competition from Microsoft (esp. with Silverlight) and Java's own attempt with JavaFX, Adobe may choose to go in that direction. They have the resources and the existing community without all the stigma that Java carries. .NET is also the same, and Microsoft's Flash equivalent is Silverlight (but Microsoft has its own stigma with developers).
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 15, 2008, 06:40:03 PM
What would be a good compiler for this syntax (http://www.cplusplus.com)?  What is the difference between that syntax and visual c++?
*Yes, I know I revived an old topic but it for more info on the topic, not responding to what someone else said.
y00tz will know the answer.
Title: Re: Standard Dialect of C and C++
Post by: Eiii on January 15, 2008, 07:13:18 PM
They're both the same, or they should be. Each compiler/IDE has it's quirks and such. Where do you see them being different?
Title: Re: Standard Dialect of C and C++
Post by: Cobo on January 15, 2008, 07:18:30 PM
He's talking about managed c++ and native c++. Visual c++ can compile both, but im guessing you dont know how to.

Managed c++ (which is what you are learning) is basicly c#, and its pretty different from native c++.

y00tz will know the answer.
I guess I beat y00tz.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 15, 2008, 07:24:55 PM
Is my link managed or native and what types of quirks are you talking about?  I just finally understood what this topic was getting at so long ago.
I am just learning c++ so I want to be totally sure I am doing everything right.
Title: Re: Standard Dialect of C and C++
Post by: Cobo on January 15, 2008, 07:30:05 PM
The link you gave has documentation about native c++. If you want to start a native c++ project in visual c++, you need to go to Win32->Console application, and a wizzard will help you create one that is either a console application, or a window application. I suggest starting with console, since learning c++ with the windows api would be pretty harder.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 15, 2008, 07:32:55 PM
Console app is native c++ and compiles to the command line right?
What is an example of managed?
Title: Re: Standard Dialect of C and C++
Post by: Cobo on January 15, 2008, 10:30:53 PM
Console app is native c++ and compiles to the command line right?
Yes.

What is an example of managed?
Code: [Select]
using namespace System;

int main(array<System::String ^> ^args)
{
Console::WriteLine("Type 'quit' to quit...");
while(Console::ReadLine() != "quit")
{
Console::WriteLine("Type 'quit' to quit...");
}

return 0;
}
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 15, 2008, 11:08:44 PM
Yes.
Code: [Select]
using namespace System;

int main(array<System::String ^> ^args)
{
Console::WriteLine("Type 'quit' to quit...");
while(Console::ReadLine() != "quit")
{
Console::WriteLine("Type 'quit' to quit...");
}

return 0;
}
Can managed be compiled as a console program?
Is native used to make games and managed is used for other then that?  If I am wrong, what is managed used to do and what is the value of knowing it?  Cobo said managed is like C# so is it valuable to know C# and managed or just one of the two?
Title: Re: Standard Dialect of C and C++
Post by: Eiii on January 15, 2008, 11:11:55 PM
...yes. I'd suggest you look into how this all works a bit more before diving in.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 15, 2008, 11:20:44 PM
What would wrap up all these questions into one good search phrase for Google?
Title: Re: Standard Dialect of C and C++
Post by: Eiii on January 15, 2008, 11:26:10 PM
'Tutorial'.
Title: Re: Standard Dialect of C and C++
Post by: sk89q on January 16, 2008, 12:13:10 AM
Managed C++ = .NET + C++

Syntax is more like C++ than C#, and you can mix both unmanaged (regular C++) and managed (.NET) code.
Title: Re: Standard Dialect of C and C++
Post by: Garrett on January 16, 2008, 11:07:41 AM
Thanks for all the help.  I am learning native c++ for now, thanks again
Title: Re: Standard Dialect of C and C++
Post by: Deranged on February 14, 2008, 01:07:13 PM
Should be noted that managed C++ is deprecated... The standard as of .Net 2.0 and higher is C++/CLI (Same idea, they just wiped away more of the blood left over from sledge-hammering Managed CLI into an unmanaged language :P)