Welcome, Guest. Please login or register.
May 22, 2012, 03:38:25 AM

Login with username, password and session length
Search:     Advanced search
Sometimes you feel like a nut, sometimes you don't.
109672 Posts in 6137 Topics by 2510 Members
Latest Member: vivahazelbaker
* Home Help Search Calendar Login Register
+  ROME.RO GameTalk
|-+  Gaming
| |-+  Game Development/Asset Production (Moderators: Bad Sector, daemonwolf)
| | |-+  Best programming to learn first - for a newbie! :)
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 [2] 3 4 ... 14 Go Down Print
Author Topic: Best programming to learn first - for a newbie! :)  (Read 19207 times)
Rizimar
Global Moderator
Romero's Best Friend
*****
Offline Offline

Posts: 5847


WWW
« Reply #15 on: August 31, 2004, 11:58:01 AM »

I like C because it's a lot of fun, but it also prepares you for learning C++ and other things like VC++ later on. Java and C++ are rather similar from what I hear.

Lately, it's being said that Java will be the standard programming language for new computer games; Benchmarks have shown that Java is faster than C++ at some calculations. This was noted on Slashdot about a week ago and also in the latest issue of PC Gamer, if I remember correctly.
Logged

ZZT-X
Monsterator
Romero's Apprentice
*****
Offline Offline

Posts: 3845


WWW
« Reply #16 on: August 31, 2004, 12:30:13 PM »

I tried BlitzBasic... that's a hobby, not programming.

Dive into your language of choice as fast and as hard as ya can, don't be afraid to ask for advice or look up a tutorial, and don't let ANYONE give you crap about it.

Heck, what do I know? I struggled with QuakeC. :?
Ask these other guys about it. They're smart, I guess.
Logged

Support Your Local Arcade!
AssKoala
Hardcore Forum Freak
*****
Offline Offline

Posts: 1720


Anti-Zealot @ EA Games

WWW
« Reply #17 on: August 31, 2004, 01:44:00 PM »

Quote from: Rizimar
Lately, it's being said that Java will be the standard programming language for new computer games; Benchmarks have shown that Java is faster than C++ at some calculations. This was noted on Slashdot about a week ago and also in the latest issue of PC Gamer, if I remember correctly.


Java, in its current form, will never become the standard programming for computer games simply because of the VM, which performs classically slower.

Those benchmarks (Java vs. C and Java vs. C++) are assenine.  Even the tester stated he wasn't very good with C++ and so could not fix the errors with some of the apps.

Also, they used g++ and gcc, which are about the bottom of the barrel when it comes to performance.  Reading those tests to completion, they compiled using the Sun compiler on the SPARC's they tested on, instead of g++ and gcc, leaving C/C++ with a distanced lead.  Because C and C++ are compiled languages, the quality of the compiler and the compiler's optimizer greatly affect the execution time of the given code.  The tests are questionable considering the conclusions derived from them.

It must also be noted that these tests are in raw calculations.  Games have not been CPU-bound since the days of Doom and Duke3D, the GPU does all the major calculations and, as can be seen by the numerous games around, the limit is on the GPU.  When dealing with 3D, C and C++ produce better results than working with the ill-implemented Java3D.  The JIT compiler allows the Java "bytecode" to be compiled on the fly to native code, so it becomes relatively the same code as would have been produced by C or C++.  However, in dealing with hardware and various other subsystems, this is not possible due to the limitations from the VM and the Java Language.

However, you can still write games in Java, easily and quickly.  The language itself is far better to learn first than C or C++ due to the obvious intricicies that the so-called "CS Degree Candidate" testers of the Java vs. C tests failed to realize.  There should be no surprise that Sun's compiler produces better SPARC code than GCC (just as Microsoft's .NET compiler and Intel's compiler produce better x86 code than GCC).  Of course, the constant there is that GCC can compile for all those systems.

Just not very well.

EDIT: It should also be noted that it is quick and easy to profile C and C++ compiled code and hand change the assembly to speed up whatever is causing slowdown.
Logged

If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
TheProgrammer
Serious GameTalker
****
Offline Offline

Posts: 572


« Reply #18 on: August 31, 2004, 04:04:48 PM »

Quote from: AssKoala


You HAVE to use procedural programming in most of your code, that is all stored in an Object (Unlike Smalltalk, Java isn't a "true" OOP language, neither is C++).  In addition, EVERYTHING in Java is a pointer (although they go under the name references).  While you don't have to dereference them and you can't perform pointer arithmetic with them, there are major differences, however the idea is the same.  Every language has procedural programming, simply by its definition.




That's what I was saying. :D
Logged
Rizimar
Global Moderator
Romero's Best Friend
*****
Offline Offline

Posts: 5847


WWW
« Reply #19 on: August 31, 2004, 04:10:16 PM »

(In response to AssKoala)

This is all very true. Some people also argue that C/C++ programmers believe that Java is slower because the code that they tested with it is bad. :P

Also, in PC Gamer, they state that an engine in Java runs Q3A maps faster than the actual product, but this is bull because it's not the same engine.

Edit: The quote was huge, so I removed it :P
Logged

chiQ
Frag-Muff
Administrator
Hardcore Forum Freak
*****
Offline Offline

Posts: 1693


WWW
« Reply #20 on: August 31, 2004, 05:36:14 PM »

I'm going to move this into a more appropriate forum for the subject matter, because you're looking at coding for PC games.
Logged

chiQ.Net - Skin is Armour
"Nothing is so smiple that it can't be screwed up"
AssKoala
Hardcore Forum Freak
*****
Offline Offline

Posts: 1720


Anti-Zealot @ EA Games

WWW
« Reply #21 on: August 31, 2004, 06:50:19 PM »

Quote from: Rizimar
(In response to AssKoala)

This is all very true. Some people also argue that C/C++ programmers believe that Java is slower because the code that they tested with it is bad. :P

Also, in PC Gamer, they state that an engine in Java runs Q3A maps faster than the actual product, but this is bull because it's not the same engine.

Edit: The quote was huge, so I removed it :P


The idea that Java would run Q3A maps faster than a well written C Engine (and I'm pretty sure John Carmack wrote a good engine) sounds outlandish.  There's a rule of thumb I follow, Computer/Game magazines are wrong about technology in all cases.  That is, I assume its wrong until I prove it otherwise.  While it could be possible, it is by no means an Apples to Apples comparison.

As for Java being slower, it is in many cases.  The JIT compiler is what enables Java to run as fast as C but JIT compilers are not always available.  In that case, the code has to be interpreted as byte code, not compiled on the fly into native code.

Java gives you a gun and a bullet, C points it at your foot, C++ turns on the safety but points it at your leg.

In other words, its easy to write good Java code, so in general programmers who don't know much (that's a good 60%) should stick to Java (which probably explains the large number of Java programmers).  The rest, that is those who take the time to learn the bottom and top, can write good C/C++ code that will perform better.  If you write C the way you write Java, you're probably have shoddy code.

I can assure you, if Java was faster, all those weather simulations and fluid dynamics computational systems would be running Java code.  There's one thing those guys want and thats every ounce of speed possible.

Oh right, there's also the "clever" jackass C programmers who think they're hot crap because they can make an algorithm in one line.  Too bad the compiled code will run slower than if they wrote it in a very straightforward manner.

Note that tools like Matlab are Java based for reasons other than performance.  Performance is not always the most important attribute.
Logged

If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
Chubz
Romero's Disciple
*****
Offline Offline

Posts: 3048


WWW
« Reply #22 on: August 31, 2004, 07:09:08 PM »

Quote from: AssKoala

Java gives you a gun and a bullet, C points it at your foot, C++ turns on the safety but points it at your leg.


Wouldnt getting shot in the foot or the leg have just about the same consequences though?   :lol:
Logged
AssKoala
Hardcore Forum Freak
*****
Offline Offline

Posts: 1720


Anti-Zealot @ EA Games

WWW
« Reply #23 on: August 31, 2004, 07:55:59 PM »

Quote from: Chubz
Wouldnt getting shot in the foot or the leg have just about the same consequences though?   :lol:


LOL.

Well, if you shoot your foot, it'll probably heal.  On the other hand, you can blow your entire leg off :)
Logged

If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
warlordQ
Hardcore Forum Freak
*****
Offline Offline

Posts: 1715


WWW
« Reply #24 on: August 31, 2004, 09:51:09 PM »

I diassagree about learning Java first.... Why learn two languages??
Java has limitations with security issues...

Chubz will be learning C/C++ anyway... why not learn it now... the first language to learn...

C++ is OOP, and i recommend learning this first... although there are a lot of books on C/C++ which teach the basics, also the books that come with your compiler will teach you the basics... but i recommend getting a book just on C++ classes..

A lot of programmers will use C++ classes without understanding them, i myself have done this too... inxeperienced C++ programmers will just put all same functions ( eg. Sound or graphics, etc ) in one class... this is the wrong way to use classes... Classes are very powerfull stuff, and requires a book just on classes...

No amount of books will teach you programming... You have to learn by just doing... Get in there and start now!!! You build up your knowledge by experience, and no amount of books can teach you this...

Also, the debugger that comes with your compiler is your best learning tool.. so use it wisely :) .. i have learned a lot from my debugger... Also the dianostic macros inside borland headers can help you learn...

An example here:
//---------------------------------------------------------------------
//      It does nothing
//---------------------------------------------------------------------
class TDemo
{
public:
    TDemo( ){}
    virtual ~TDemo( ){}
};
//---------------------------------------------------------------------
void function_one( TDemo& demo )
{
}
//---------------------------------------------------------------------
#define  SAFE_DELETE( x )            if( x ){ delete x; x = NULL; }
//---------------------------------------------------------------------
void main( void )
{
    TDemo*  one = new TDemo;

    function_one( one );

    SAFE_DELETE( one );
}
//---------------------------------------------------------------------
Ok this example does nothing, i only wanted to disscuss one thing...
What do you think happens to the class one?? i will answer later, but have a think about this...

You will not find this in any books... Only your debugger will show you what is happening, which is why hands on experience is the only way to learn...The above code, has got a serious bug... which can create a lot of head aches.. trust me, ive almost smashed my computer because of this... :)

ok class one address gets passed as a parameter to a function... class one is out of scope... class one is destroyed... and another class is created... If class one had contain data, for example say it was a string class... all the data it contained would also be destroyed... a major head ache...

the programmer is confused that after the function call all the data is gone... what the?? is happening.... stepping through this code with a debugger, you can see what is going on... Also the above bug can be easily fixed....

With all the talk about OOP, im surprised that nobody here even mentioned Delphi...
Logged

AssKoala
Hardcore Forum Freak
*****
Offline Offline

Posts: 1720


Anti-Zealot @ EA Games

WWW
« Reply #25 on: August 31, 2004, 10:07:23 PM »

Quote from: warlordQ
Java has limitations with security issues...


Your credibility ends there so I won't bother with specifics on the rest.  Yeah, its that misinformed.  I know you're smarter than that from your other posts so just stop and think about why that makes absolutely no sense.

You can continue to say C++ should be taught first, but there's a reason why it isn't taught first at the University level.  The idea is to learn to PROGRAM not to be a C++ Programmer.  If you learn C++ first (and I know how you love pasting in basic C++ code), you will neither have a grasp of the underlying hardware nor will you have a grasp of TRUE OOP Language.  As much as I hate Alan Kay, his various quotes regarding C++ Classes are completely justified.  It's a powerful language that makes it easy to write shoddy code (ever written in ML? Complete opposite).

So, start with C++ and work with numerous books that teach how to make classes not design software.  At this point, the comments have all been toward using Objects for the sake of using Objects, but that destroys quality more than actually learning to properly design and use objects in a Language such as Java and then easily use C++, the transition is simple and you'll have a better grasp on Object Oriented design.

Of course, starting with whatever you want is just fine.  However, I will not ignore the fact that starting with C++ is assenine.  Either start with assembly and C and move up to C++ or start with Java and move down to C++.

Starting with C++ is, quite frankly, absurd.

That is, if you actually want to be a good programmer.  If you want to make shoddy game engines, by all means start with C++ and never leave it.  When you get rejected for bad design skills or spend much longer attaining those skills, then you'll realize why I am posting what I post and why Universities teach what they teach.

The computer industry isn't what it was 20 years ago.  You can't pick up a single book and leave with 50% of the knowledge out there.

Oh, and I teach this stuff as a job at GeorgiaTech.  I know plenty about why people F-up and I'm willing to bet some of the C++ advocates would fail an advanced topics C++ test.  You need look no further than the numerous posts at gamedev.net regarding questions about blah and bleh. Plenty of reasons in those posts and the people who post them (and how long theyve been stuck with C++) to back up my statements.
Logged

If you always think like an expert, you'll always be a beginner. | "A handful of knowledgeable people is more effective than an army of fools" -Writing Secure Code, 2nd Ed.
Chubz
Romero's Disciple
*****
Offline Offline

Posts: 3048


WWW
« Reply #26 on: August 31, 2004, 10:24:52 PM »

Ok, since you are a teacher of programming languages and stuff, I will take your advice - no offense to the person who posted previously, though!  I am just choosing my own path.  :)

I have come to the conclusion that I will start with just "C".

Java doesnt sound too great, and C++ sounds too confusing to be a starting language, so C sounds appropriate.

Is "C" a good one to start with, then?  If so, I may start preparing to learn it.   :P

Thanks for the help guys!

-Chubz  :twisted:
Logged
warlordQ
Hardcore Forum Freak
*****
Offline Offline

Posts: 1715


WWW
« Reply #27 on: August 31, 2004, 10:59:40 PM »

oh my code above is simple, because i wanted to explain one thing.. and not confuse a beginner with lots of unneccissay code... i only wanted to discuss the limitations of a standard constructor... what the class does is not important, its how the class is created and destroyed is what was under discussion... theres no need to type in lots of confusing code, where a beginner would not understand any of it.. its simple and people could read and understand it... but it does demonstate something that you will not learn in class or from a book... but now, i make this as an example, because this is important stuff...

You dont even know my coding style.. so please dont post your assumptions about my style of code... you have not seen any of my source code of any of my software... my code heavily uses advanced OOP in C++, unless you know advanced C++ OOP, you will not be able to understand any of it... my code heavily uses Polymorphism, object inheretence, deep copy constructors, operand overloading, etc...

AssKoala OOP in C++ requires a lot of learning, thats why i recommend a book on it... Also it requires a lot of design from the programmer.. Yeah the programmer designs code...

I also think OOP is great, and i code in OOP... but you know what.. you can still create great games without OOP...

The underlying technology is important, you have to understand what the technology... but learning JAVA dosnt teach you the technology... Learning 2 programming languages is a waste of time, if Chubz will be learning C/C++... i think the extra time will be better spent on actual doing...  

After you finnish the course from universities and have to program in the real world... then you start to learn... everything you learnt about programming, did you learn in your course?? or did you learn after??

John Carmack and John Romero didnt learn in some university, they just started doing... John Carmack does a lot of reading and studying about technology.. Although Carmack dosnt use OOP in his software, but he has created a lot of good stuff... He created doom to run on a 386, when nobody else at the time could do that... And he also did a Mario bros level of Dangerous dave, which ran smooth, at that time this was hard to do on the PC...  John R. saw the dollor signs, and id was born... its the unlerlying technology that makes it happen... you wont learn most of this in a university...

Starting off by learning the language you will be programming in, is the best thing.. which is C/C++...
Logged

warlordQ
Hardcore Forum Freak
*****
Offline Offline

Posts: 1715


WWW
« Reply #28 on: August 31, 2004, 11:36:42 PM »

AssKoala you keep on editing your post as i post :)

What i wanted to say about java, JAVA has high security enforced.. this high security was enforced by Sun.. its a good thing, but there are limitations because of this... i think java is a good language, but chubz dosnt want to make games in java...

I am in the process of writting articles for several magazines, and for the borland community.. but i have been pushed for time at the moment while living in Japan... i do know a lot of programming, and i have read tones of programming books and magazines... Now i am able to share my knowledge with the rest of the world..

A lot of people make mistakes in learning C/C++... we all make mistakes...

in fact the very code i posted above, has a serious mistake in it... its very hard to spot.. its especially frustrating when you have lots of code, and you have two classes doing the same thing inside a function that actually uses that data... my post above i show it in its simple form...
Logged

TheProgrammer
Serious GameTalker
****
Offline Offline

Posts: 572


« Reply #29 on: September 01, 2004, 05:11:41 AM »

Quote from: warlordQ


void main( void )
{
    TDemo*  one = new TDemo;

    function_one( one );

    SAFE_DELETE( one );
}




Hello WarlordQ,

I wonder where did you pull this code from? Did you pull it somewhere
from Borland's libraries? Or did you make it up yourself? One thing I
just want to point out is that, according to Bjarne Stroustrup,
main() function should have a return type of int. I'm amazed how many
books out there use void main(). I actually have seen a lot.

Click here

Oh. by the way, in C++, you don't need to use void to indicate empty parameter.
But in C, you do. It may sound silly, but I do believe that coding style
for programmers is as important as writing style for writers.


Note: I don't mean to disagree with what you said, I just want to point
out that avoid using void main(), especially if you are going to write an
article for a magazine. That's all.


Quote from: warlordQ
... but learning JAVA dosnt teach you the technology... Learning 2 programming languages is a waste of time



I have to disagree with you on this one. If you are planning to be a
heavy-duty programmer, both Java and C/C++ are "must-know"
languages. So, if you are learning C/C++ now, eventually, you will want
to learn Java, or vice versa. Since I'm planning to be a heavy-duty
Software Engineer, I try to understand every language's strength,
and weakness. Because, in some cases, using Java, or C# is way
better than C/C++. So, learning two languages is not a waste of
time. Time changes everything, the world ahead of us is even harder.  :cry:
What once was a hobby activity now requires much more disciplines.
Logged
Pages: 1 [2] 3 4 ... 14 Go Up Print 
« previous next »
 

Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!