Page 1 of 2 [ 17 posts ]  Go to page 1, 2  Next

Gwkyou
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 30 Jan 2007
Gender: Male
Posts: 40

31 Jan 2007, 7:13 am

My new year's resolution is to learn C/++, but I cant seem to find a good tutorial/book. There is no class I can take and I would like to be into it full blown, before cologe. I all ready have the "programmers mind" thanks to actionscript. Also what is the language of Direct x, and is there any tutorials out there? because the xbox, was made by the direct x people, is it also the same language?



Saibotty
Hummingbird
Hummingbird

User avatar

Joined: 9 Jan 2007
Gender: Male
Posts: 21
Location: Berlin

31 Jan 2007, 7:51 am

direct x is an "interface" from microsoft which lets you as a programmer use built in hardware like the graphics card whithout having to know anything special about the brand/type of card which is used currently.

in practice it looks like this: in c++ you create a direct x object and with that object you can easily do cool stuff without having to worry about the hardware. if i.e. you want to use pixel shaders and the graphis card doesnt support them, then direct x will make sure that the CPU emulates the pixel shaders.

without directx (or opengl i guess) you would have to talk directly to the driver of the graphics card.


i dont know anything about c++, ive only been programming in visual basic so far. VB is easy to learn and good if you want to do impressive stuff without lots of work, but if things get more complex and professional, the boundaries of VB are reached quickly.



Gwkyou
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 30 Jan 2007
Gender: Male
Posts: 40

31 Jan 2007, 8:00 am

Oh ok thank you.



ScratchMonkey
Sea Gull
Sea Gull

User avatar

Joined: 26 Jan 2007
Age: 63
Gender: Male
Posts: 232

31 Jan 2007, 8:07 am

Once you learn two languages, the rest come easy, because you see the parallels. But there are classes of language, so that's not always true. For instance, LISP is quite unlike C++.

Rather than learn C++, I'd advise you to learn Java. Now that Sun has open-sourced it, it should get more widespread use, and it's already very popular in "enterprise" applications which tend to be very large. C++ is more of a "system" language, C with Java-like additions, so it's easy to shoot yourself in the foot if you don't know what you're doing. Learn Java first, then C++ will come naturally.

Don't lock yourself into one vendor. If you must pursue .NET, try to learn Mono at the same time, so you're not trapped in a MS environment.

Similarly, with DirectX (a MS proprietary standard) learn SDL instead. Then you can write 3D applications that will run on any OS. If you aspire to be a game programmer, check out the Torque Game Engine from Garage Games. For $150 you get a complete game engine and lots of tools. (Most game engines start at about 10 times that price or even much more.)



Jameson
Veteran
Veteran

User avatar

Joined: 3 Jan 2007
Gender: Male
Posts: 2,877
Location: Here and there.

31 Jan 2007, 10:10 am

I learned C++ reading "C++ for Dummies" years ago. Incredibly well written, and it's one of 4 or 5 C++ books that I still use for reference when I forget how to do something.

If you plan to do game programming, you want to start with C++. Java is too slow to do any major games with. Nice language, but there's a lot of overhead involved with it.

Anything you want to run fast, you program it in C/C++ or Assembler.

If you'd like, I can write you some short reviews of other helpful programming books when I get home from work.


_________________
Air·is·water·with·holes·in·it. Think·honk·if·you're·a·telepath. Never·call·a·man·a·fool.·Borrow·from·him. A·tautology·is·a·thing·which·is·tautological. Hi!·I'm·a·.signature·virus!·Copy·me·into·your·~/.signature·to·help·me·spread!


Gwkyou
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 30 Jan 2007
Gender: Male
Posts: 40

31 Jan 2007, 10:11 am

I am taking class next year for Java, and at first I thought the $150 was a typo.



ScratchMonkey
Sea Gull
Sea Gull

User avatar

Joined: 26 Jan 2007
Age: 63
Gender: Male
Posts: 232

31 Jan 2007, 10:51 am

Re Java being slow: "Slow" is a relative term. Java is compiled into platform-independent "bytecode", sort of a CPU-independent machine language designed for a fictional "Java Virtual Machine" (JVM). This can then be compiled down into native machine language, either at runtime (using a Just-in-Time compiler, or JIT) or as part of the initial compilation. So Java need not be slower than other languages.

The slowness attributed to Java is usually because the JIT slows down initial loading, or because the libraries are not tuned for performance, or because garbage collection isn't handled well. (GC can play havoc with responsiveness.)

The very thing that makes C++ fast also makes it dangerous and error-prone. That's why I suggest starting with Java and then going to C++.

I'd also suggest learning about digital logic hardware (gates, flip-flops, etc.) and how these building blocks are assembled into CPU's and other high-level chips. Then learn an assembly language. This will make it easier to understand the problems that arise when you use C++. It will also give you a better understanding of how to get the best performance out of a language. (Many compilers let you see the generated assembly language.)



Jameson
Veteran
Veteran

User avatar

Joined: 3 Jan 2007
Gender: Male
Posts: 2,877
Location: Here and there.

31 Jan 2007, 11:04 am

I would say it may be easier to learn Java after C++ than the other way around.

C++ was around first, Java is based on C++. C++ is not "C with Java-like additions", Java is C++ with a universal machine compilation and garbage collection. No one jumps right into programs where garbage collection is necessary. Pointers are towards the advanced end of C++ learning. If you learn C++ first, you won't take garbage collection for granted when you learn Java.

Most video games are written using C++ or C. Especially those on Xbox.


_________________
Air·is·water·with·holes·in·it. Think·honk·if·you're·a·telepath. Never·call·a·man·a·fool.·Borrow·from·him. A·tautology·is·a·thing·which·is·tautological. Hi!·I'm·a·.signature·virus!·Copy·me·into·your·~/.signature·to·help·me·spread!


ScratchMonkey
Sea Gull
Sea Gull

User avatar

Joined: 26 Jan 2007
Age: 63
Gender: Male
Posts: 232

31 Jan 2007, 1:16 pm

Jameson wrote:
Pointers are towards the advanced end of C++ learning.


True, I learned C years before C++, when C++ was just an academic language, and C doesn't have pointer-avoidance mechanisms like the STL as C++ does. Most people who move from C to C++ tend to carry a lot of bad pointer practices with them (including things like using native arrays instead of std::vector). Some of this is caused by bad STL libraries like the VC6 implementation that a lot of companies still use.

I can't imagine games on the MS Xbox being written in a "rival's language". There's a lot of animosity between MS and Sun. But I mostly ignore consoles, because they tend to have huge licensing fees on tools and such.



SagaciousKJB
Butterfly
Butterfly

User avatar

Joined: 1 Feb 2007
Gender: Male
Posts: 13
Location: Yakima

03 Feb 2007, 11:03 pm

I don't mead to tread-jack, but what would you recommend for building GUI based applications? I got into C a little bit some time ago, but never really ascertained how to build GUI applications, and just lost interest. Someone mentioned Visual C++ and Visual Basic, but I'm not quite sure that I want to throw down a couple of grand for Visual Studio. :/

I've heard a lot about AJAX and "Ruby on Rails" lately... What's that about?



ScratchMonkey
Sea Gull
Sea Gull

User avatar

Joined: 26 Jan 2007
Age: 63
Gender: Male
Posts: 232

04 Feb 2007, 3:06 am

AJAX is a web "technology" for reducing network traffic and creating more responsive web pages, by moving changing data asynchronously. It's not really about "GUI" applications.

Visual Studio is a great set of tools, but they tend to funnel you into doing MS-only things that are not portable to other platforms. For portability, I'd suggest a framework like Qt or wxWidgets. I'm building an app with wxWidgets and using wxFormBuilder for layout and I'm finding it a very straightforward framework to learn. It's use of Java-like sizers is a particularly nice improvement over the fixed geometry of MFC (sometimes called the Microsoft Frustration Classes). I recommend downloading the "wxpack", a precompiled package that includes the wxWidgets library, wxFormBuilder, and some extra objects ("additions"). Combine this with gcc for Windows and you've got a nice, free GUI development system.



ahayes
Veteran
Veteran

User avatar

Joined: 2 Dec 2006
Gender: Male
Posts: 9,506

04 Feb 2007, 4:49 am

ScratchMonkey wrote:
AJAX is a web "technology" for reducing network traffic and creating more responsive web pages, by moving changing data asynchronously. It's not really about "GUI" applications.

Visual Studio is a great set of tools, but they tend to funnel you into doing MS-only things that are not portable to other platforms. For portability, I'd suggest a framework like Qt or wxWidgets. I'm building an app with wxWidgets and using wxFormBuilder for layout and I'm finding it a very straightforward framework to learn. It's use of Java-like sizers is a particularly nice improvement over the fixed geometry of MFC (sometimes called the Microsoft Frustration Classes). I recommend downloading the "wxpack", a precompiled package that includes the wxWidgets library, wxFormBuilder, and some extra objects ("additions"). Combine this with gcc for Windows and you've got a nice, free GUI development system.


wxdevc++, google it



ScratchMonkey
Sea Gull
Sea Gull

User avatar

Joined: 26 Jan 2007
Age: 63
Gender: Male
Posts: 232

04 Feb 2007, 12:00 pm

ahayes wrote:
wxdevc++, google it


Which turns up this:

http://en.wikipedia.org/wiki/WxDev-C++

See also:

http://en.wikipedia.org/wiki/Wxwidgets

There's a good discussion forum here:

http://wxforum.shadonet.com/

Other useful links:

http://wxpack.sourceforge.net/
http://wxformbuilder.org/
http://www.codeblocks.org/



ahayes
Veteran
Veteran

User avatar

Joined: 2 Dec 2006
Gender: Male
Posts: 9,506

04 Feb 2007, 3:06 pm

ScratchMonkey wrote:


http://wxdsgn.sourceforge.net/

It's an IDE made for doing wxWidgets and GCC in Windows. I like it a lot.

It's way the hell better than doing VS2005+CLI.



Run
Hummingbird
Hummingbird

User avatar

Joined: 3 Sep 2005
Gender: Male
Posts: 22
Location: Amsterdam

06 Feb 2007, 9:39 pm

Ah, I recognize another hacker in ScratchMonkey (in the meaning that he knows what he's talking about).

Personally, I despise java - but that is probably personal, and because I already knew C++ before I looked at java
(java can't do a lot of things, so I thought it was stupid). Also, the reason that java was "promoted" is political,
and I hate politics - while C++ is written by some hacker type of guy (working for Bell Labs) from a pure scientific
point of view.

Nevertheless, C++ *does* have a lot of draw backs, them being:

1) It had to be backwards compatible with C. As a result it is not as good as a brand new language could be.
2) It is very easy (as a result of 1)) to mis-use C++, learn it totally wrong and use it totally wrong. In that case
it is error prone (like C) and any benefit over C is lost.
3) If you code the right way in C++, then still you need to code a LOT of code before you have something
that actually does something. It's not a fast language thus (C++ hardly ever wins programming contests with
a limitted amount of time).

The only really (technical) positive side of C++ is therefore that you can do anything with it. No restrictions.
This is only a benefit for the hackish type of programs, that is, a program written by a single hacker who is
damn good. Such a program isn't very maintainable though.

If you want to learn C++ the Right Way(tm) then there are a lot books the AVOID (like "C++ for dummies",
which is really really bad). Actually, for the beginner there is only one book that you should start with:
"Accelerated C++" by Koenig & Moo. Once having finished that you hardly can say you know the language,
so after that you should continue with "Effective C++" (Meyers) and/or "Exceptional C++" (Sutter). Of course,
you'll also need a "bible", as reference, for which you should use "The C++ Standard Library" by Josuttis.

PS There are NO good resources on the net from which you can learn C++ the correct way. You'll have to buy those books.



ElliottHird
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 18 Jun 2006
Gender: Male
Posts: 43

07 Feb 2007, 5:36 am

Gwkyou wrote:
My new year's resolution is to learn C/++, but I cant seem to find a good tutorial/book. There is no class I can take and I would like to be into it full blown, before cologe. I all ready have the "programmers mind" thanks to actionscript. Also what is the language of Direct x, and is there any tutorials out there? because the xbox, was made by the direct x people, is it also the same language?
You don't really get the "programmer's mind" (what on earth is that) with actionscript - C-style languages are wildly different and more complicated (not neccessarily harder though)