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

Blake_be_cool
Veteran
Veteran

User avatar

Joined: 6 May 2008
Age: 27
Gender: Male
Posts: 860
Location: Australia, NSW, Sydney

27 Feb 2010, 5:14 pm

Hi every one. I'm Blake. I'm a young musician and that's all I do. But along career basis I want to do computer programming. I've learned a little in VB6 but saw no interest in it and no point, So yesterday I started C++ and was hoping if any one could tell me how hard this could be and tips on succeeding. (I've already noticed that you can't use capital letters.)
I use a complier called "BloodShed Dev-C++"


_________________
"Not everything that steps out of line, and thus 'abnormal', must necessarily be 'inferior'."
- Hans Asperger (1938)


Roxas_XIII
Veteran
Veteran

User avatar

Joined: 8 Jan 2007
Age: 33
Gender: Male
Posts: 3,217
Location: Laramie, WY

27 Feb 2010, 5:38 pm

I use Microsoft Visual Studio 2008 for programming in C++. My only advice to you is not to expect to learn it overnight; unlike Java, which uses a virtual machine, C++ deals directly with the Windows OS and CPU. It can be a little finicky at times especially dealing with iostream objects like cin and cout. I manage ok even though I don't pay attention in computer science class, but even though I have natural skill in programming and understanding programming syntax I still find it difficult.

I would recommend picking up a book on how to implement C++ syntax, as well as looking up online resources for implementing library classes. Syntax in C++ is a total b***h, but once you master it the rest comes easy.


_________________
"Yeah, so this one time, I tried playing poker with tarot cards... got a full house, and about four people died." ~ Unknown comedian

Happy New Year from WP's resident fortune-teller! May the cards be ever in your favor.


otto9otto
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 28 Jul 2009
Age: 68
Gender: Male
Posts: 38

27 Feb 2010, 7:10 pm

http://www.boost.org/
http://www.cyberdiem.com/vin/
Otto


_________________
Calorie restriction is the only scientifically proven way to avoid chronic diseases (including cancer) and to live longer. See calorierestriction.org.


peterd
Veteran
Veteran

User avatar

Joined: 25 Dec 2006
Age: 71
Gender: Male
Posts: 1,347

27 Feb 2010, 8:12 pm

Why C++? Because that's what real programmers use?

For putting pieces of code together quickly, and learning about how things go together, I'd really recommend Java. And yes, I have earned a living from both. Download an Eclipseand you have the complete toolkit. It'll compile and debug C++ too, or so I'm told. If you're really committed to C++...

For joining things together, or making stuff for web pages, or storing and linking data: try XQuery. Really, your life will never be the same. Download an eXist database and run through its examples Exist XML Database



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 44
Gender: Male
Posts: 1,385

27 Feb 2010, 10:31 pm

Actually, if you're just getting started with programming, I'd suggest Ruby. It's a bit unconventional, but it offers a language that's arguably more elegant than Java without the need to compile, etc. A nice clean workspace to experiment.

If you want to do performance-critical programming, there's nothing wrong with C++. You just have to understand some lower level concepts (memory management, casting etc) that are abstracted away in higher level languages. I would even suggest that you start with C. Learn by looking at and modifying short example programs.



QuantumCowboy
Veteran
Veteran

User avatar

Joined: 13 May 2007
Age: 45
Gender: Male
Posts: 897
Location: (1/√2)|0> + (1/√2)|1>

01 Mar 2010, 11:05 pm

MyFutureSelfnMe wrote:
Actually, if you're just getting started with programming, I'd suggest Ruby. It's a bit unconventional, but it offers a language that's arguably more elegant than Java without the need to compile, etc. A nice clean workspace to experiment.

If you want to do performance-critical programming, there's nothing wrong with C++. You just have to understand some lower level concepts (memory management, casting etc) that are abstracted away in higher level languages. I would even suggest that you start with C. Learn by looking at and modifying short example programs.


Ah! A well written C program can be a thing of elegance.

In many ways I prefer to use C/C++ for programming to the higher-level languages. It allows for me to have a much better idea as to what is actually occurring. In addition, I find the syntax structure of many of these newer languages to be distracting.


_________________
The ket always seems to psi over its own indeterminacy.


MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 44
Gender: Male
Posts: 1,385

01 Mar 2010, 11:24 pm

The syntax structure of a loosely typed language can be very convenient for writing quick, small programs, no matter who you are.

When you're writing something significantly complex, it makes a lot less difference and yes it can even be distracting.



StuartN
Veteran
Veteran

User avatar

Joined: 20 Jan 2010
Age: 60
Gender: Male
Posts: 1,569

02 Mar 2010, 4:05 am

Blake_be_cool wrote:
I use a complier called "BloodShed Dev-C++"


There is loads of online material around BloodShed. You also must have a copy of Bjarne Stroustrup's "The C++ Programming Language" http://en.wikipedia.org/wiki/The_C%2B%2 ... g_Language.

As a tip, writing for Linux can be a lot easier - you can dispense entirely with the graphical setup and write fairly "pure" code that integrates well with other tools. You could install a Linux in a separate partition very easily just for programming work.

If you want to write graphical code then the most critical part is either learning how to design the graphical outline for your code, or to learn to re-use a graphical template in BloodShed.



QuantumCowboy
Veteran
Veteran

User avatar

Joined: 13 May 2007
Age: 45
Gender: Male
Posts: 897
Location: (1/√2)|0> + (1/√2)|1>

02 Mar 2010, 8:19 am

Quote:
As a tip, writing for Linux can be a lot easier - you can dispense entirely with the graphical setup and write fairly "pure" code that integrates well with other tools. You could install a Linux in a separate partition very easily just for programming work.


An additional note is that GCC, the standard Linux C Compiler is used for much more than just Linux applications. In fact, at work we use it for cross-compiling our embedded firmware.


_________________
The ket always seems to psi over its own indeterminacy.


t0
Veteran
Veteran

User avatar

Joined: 23 Mar 2008
Age: 50
Gender: Male
Posts: 726
Location: The 4 Corners of the 4th Dimension

02 Mar 2010, 9:28 am

StuartN wrote:
As a tip, writing for Linux can be a lot easier - you can dispense entirely with the graphical setup and write fairly "pure" code that integrates well with other tools.


Can you explain what mainstream OSes require a graphical setup before using "pure" C like 'printf("Hello world!\n");'. I am unaware.

To the OP - If you really want to learn C/C++, ignore all the "use my favorite language/OS/etc" posts and go with what you have. Especially if your programs can work using only stdin/out or the built in (non-OS specific) file processing functions. If you're looking to learn the language and teach yourself algorithms, the OS and compiler don't matter. Look for educational resources online or classes you can take. I'd also pick an open-source project that interests you and read the code so you can see what techniques other authors use.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 44
Gender: Male
Posts: 1,385

02 Mar 2010, 9:35 am

QuantumCowboy wrote:
Ah! A well written C program can be a thing of elegance.


I would never use C for anything over a couple thousand lines.



QuantumCowboy
Veteran
Veteran

User avatar

Joined: 13 May 2007
Age: 45
Gender: Male
Posts: 897
Location: (1/√2)|0> + (1/√2)|1>

02 Mar 2010, 11:30 am

MyFutureSelfnMe wrote:
QuantumCowboy wrote:
Ah! A well written C program can be a thing of elegance.


I would never use C for anything over a couple thousand lines.


By and large, the embedded programming world is still largely ruled by C.


_________________
The ket always seems to psi over its own indeterminacy.


MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 44
Gender: Male
Posts: 1,385

02 Mar 2010, 11:46 am

I'm aware. I'm trying to change that where I am.

I've heard excuses like "There's no C++ compiler for (such and such platform)". This is frequently untrue, and anyway there are a bunch of C++ to C translators out there that can be launched out of a makefile. I believe the real reason is that most people working in the embedded world tend more toward the hardware disciplines, and are not serious software engineers (and probably don't want to be). They're not completely clueless, but they're not professionals in that discipline. I think every team writing any kind of software needs at least one software engineer. It's like a race car driver being his own mechanic, it only makes sense for an amateur.

OO is too valuable to ignore for a large structured project, I find if I really have to write in C I end up emulating OO concepts anyway.



QuantumCowboy
Veteran
Veteran

User avatar

Joined: 13 May 2007
Age: 45
Gender: Male
Posts: 897
Location: (1/√2)|0> + (1/√2)|1>

02 Mar 2010, 11:54 am

We recently had a similar discussion at my workplace. There are issues with moving from C to C++ in the embedded world. One is name mangling. Another is performance (all that OO abstraction can have a cost).

C also gives you a better "feel" for lower level work. This is not entirely surprising as it was largely designed as a higher level language to interface with assembly.

If one absolutely requires OO, there is always Objective C. :roll:


_________________
The ket always seems to psi over its own indeterminacy.


MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 44
Gender: Male
Posts: 1,385

02 Mar 2010, 12:08 pm

What issue are you having with name mangling?

More recent versions of gcc (especially since 4.3) have put more emphasis on C++ optimization than C optimization, and it's possible for a talented C++ programmer to write faster code than any reasonable C solution (especially through creative use of inlined template methods). If you do some assembler dumps of the generated code, you may be impressed at what the compiler is capable of doing.

I am always aware of what the compiler is going to do with the C++ code I am writing. I think this is important.



Assembly
Sea Gull
Sea Gull

User avatar

Joined: 28 Feb 2010
Age: 32
Gender: Male
Posts: 225

02 Mar 2010, 6:49 pm

I started out with javascript, 4 hours later I thought to myself "screw this, I want to learn c++ instead". Best decision of my life. I had to do some additional research on how computer memory worked, different variables, arrays, loops, boolean logic and algorithms , but other than that, learning c++ was a breeze (though to fully master will require time and dedication, and proved to be harder than I had expected). Though having some previous programming experience may be usefull when learning c++, the key towards understanding c++ is patience and interest. I recommend reading an online tutorial (one tutorial won't teach you everything, so you may have to read a book on the subject , or other tutorials , but it's a good start) and compile all the source codes in the examples, try to modify and understand them. When programming, don't be afraid to try new things, that's how you become a great programmer, and how you make programming a great experience. Cheers :D