PDA

View Full Version : So I hear I'm taking C++



ExAm
February 12th, 2009, 02:03 PM
So I'm taking a beginning C++ class at my college, just for the lulz and a possibly useful skill.
Could anyone with some experience with coding classes give me an idea as to what I should expect from this class?

klange
February 12th, 2009, 02:05 PM
Classes vary by school, professor/teacher, standards base, and your personal experience with the language, so the only thing that can be said is "you'll probably be taught C++, progressing from 'hello world' to more advanced topics as you move through the course".

Limited
February 12th, 2009, 02:06 PM
Lots of thinking, problem solving. Make sure you understand pointers as they are key with C++.

Also wrong forum.

ExAm
February 12th, 2009, 02:13 PM
Also wrong forum.
I thought about that before posting the thread. The line seemed blurry, so I arbitrarily decided that it was more a thread about a college class than it was about C++ as a coding language.

Limited
February 12th, 2009, 02:21 PM
Ah right okay. I suggest you do alot of reading, your college probably has a few books on the subject. Some people pick it up easier than others, so you give yourself a head start just in case.

Have they said how advanced you will be getting.

ExAm
February 12th, 2009, 04:16 PM
I dunno, it's a beginning class. I have the textbook, though.

Ki11a_FTW
February 12th, 2009, 06:12 PM
I wish my school offered C++, last year i did java, i had a text book for that to. Was a pretty fun class, mainly because the teacher was insane.

legionaire45
February 12th, 2009, 07:25 PM
C/C++ aren't all that hard to learn. If you want to get a bit of a taste-test first, go to this link (http://www.cprogramming.com) and look through some of the tutorials.

paladin
February 13th, 2009, 12:30 AM
c++ lol, garbage.

ExAm
February 13th, 2009, 12:51 AM
DAY 1 REPORT:

MASSIVE SUCKAGE ALERT
First thing I learned was the class doesn't go until 9PM like the listing says. It goes until 10PM. That is alarming and possibly unacceptable.
Second thing is that 6-10 hours of homework per week are required. I cannot fit this into my current homework schedule.
Third, 5 and a half of those hours are required to be on campus in the lab, due to some bullshit bureaucracy. Again, can't fit into schedule.

Long story short, I'm probably going to have to drop this :smith:

Ki11a_FTW
February 13th, 2009, 12:54 AM
:(

Gamerkd16
February 13th, 2009, 03:17 PM
I am taking this course this semester too. So far the structure is a lot like Java when it comes to if statements, switch, while, and for loops. Right now I'm learning I/O Streams which is a bit different, but it's not too hard if you've already taken a programming course in the past. At least so far it isn't...

Having no classes is a little weird.

Limited
February 13th, 2009, 04:41 PM
Ouch that sucks exam, thats a pretty hefty amount of time.

RickYng
February 13th, 2009, 04:45 PM
Teach it yourself. Pay attention to OOP, the rest you learn in class is useless.

Bodzilla
February 16th, 2009, 01:20 AM
DAY 1 REPORT:

MASSIVE SUCKAGE ALERT
First thing I learned was the class doesn't go until 9PM like the listing says. It goes until 10PM. That is alarming and possibly unacceptable.
Second thing is that 6-10 hours of homework per week are required. I cannot fit this into my current homework schedule.
Third, 5 and a half of those hours are required to be on campus in the lab, due to some bullshit bureaucracy. Again, can't fit into schedule.

Long story short, I'm probably going to have to drop this :smith:

wat.

ExAm
February 16th, 2009, 03:01 AM
OKAY SO. My parents refuse to let me drop the course, regardless of facts. This is going to suck.

sdavis117
February 16th, 2009, 08:10 AM
Which route is your C++ class taking? Video Games or regular programs?

ExAm
February 16th, 2009, 04:32 PM
Programs.

Limited
February 17th, 2009, 04:00 AM
Ouch, boring :O :P

Cojafoji
February 17th, 2009, 02:40 PM
Programs.
Prepare to want to commit unholy ritualistic suicide. Programming is the ultimate death of the human soul.

I'm not fucking around either. If you become a code monkey, you stop being a human.

n00b1n8R
February 17th, 2009, 04:05 PM
in before rob

Limited
February 17th, 2009, 04:58 PM
Prepare to want to commit unholy ritualistic suicide. Programming is the ultimate death of the human soul.

I'm not fucking around either. If you become a code monkey, you stop being a human.
Unless your doing something physics based, or simulation. Where you can actually see the result and play with it, if its just regular apps then yes you will die of boredom.

ExAm
February 17th, 2009, 06:11 PM
There will be a graphical element, apparently. Plus this class is just Intro to Programming Concepts of C++

klange
February 17th, 2009, 08:16 PM
Is this Intro to Concepts in C++, or to Intro to Concepts, in C++ (note the comma)? If its' the latter, even at a college level, that's poor. C++ is the worst language to introduce programming concepts in (dare I say, Java may be the front runner? Just as long as you're not trying to teach Python under that title...)

Gamerkd16
February 17th, 2009, 09:16 PM
Learning to do GUI's in C++? I wanted to learn how to do that because so far all we have been using is the terminal. I figured GUI's would be like JOptionPane in Java, but apparently it is more complicated than that? I found these tutorials. Please tell me GUI's aren't this hard:
http://www.rohitab.com/discuss/index.php?showtopic=11408
http://www.rohitab.com/discuss/index.php?showtopic=11454

These are from 2004, so who knows, maybe there is a more efficient way to do it now.
Does anyone know?

Also, isn't it C++ that is used to make those many apps you see made for Halo?
That can't be all VB. Visual Basic can't create dll's, am I right?


C++ is the worst language to introduce programming concepts in (dare I say, Java may be the front runner? Just as long as you're not trying to teach Python under that title...)
Yeah, my intro to Computer Science course was Java. I think that is the best language to introduce.

Limited
February 18th, 2009, 02:26 AM
Learning to do GUI's in C++? I wanted to learn how to do that because so far all we have been using is the terminal. I figured GUI's would be like JOptionPane in Java, but apparently it is more complicated than that? I found these tutorials. Please tell me GUI's aren't this hard:
http://www.rohitab.com/discuss/index.php?showtopic=11408
http://www.rohitab.com/discuss/index.php?showtopic=11454


Oh god, Java and GUI's :( I'm doing project right now that is killing me instead because of Java GUI's :(

C++ does take alot more of work to get a working GUI up and running. Is it harder than Java? I dunno mainly because I find Java GUI's confusing as hell. I recommend checking out this Youtube channel, they have pretty good C++ console and Win32 (GUI's) tutorials.


Also, isn't it C++ that is used to make those many apps you see made for Halo?
That can't be all VB. Visual Basic can't create dll's, am I right?
Halo apps can be made in quite a few languages, mine have ranged from VB6 (lol), VB.net, C#, and eventually I'll make them in C++.

You dont necessary need a dll to make an app, you can just use regular old exes.

RickYng
February 18th, 2009, 12:43 PM
Injection DLLs can be written in ASM or C++.

Gamerkd16
February 18th, 2009, 01:03 PM
Oh god, Java and GUI's :( I'm doing project right now that is killing me instead because of Java GUI's :(
Java GUI's are hard? That's JOptionPane right? It's just setting coordinates and creating objects I thought.



Halo apps can be made in quite a few languages, mine have ranged from VB6 (lol), VB.net, C#, and eventually I'll make them in C++.

You dont necessary need a dll to make an app, you can just use regular old exes.
Well yeah, I've made a Halo app from VB too. I just felt so limited with that program when I learned that I needed to make .dll to get what I wanted. I was hoping C++ would help with that. And I also needed the course to graduate.

Arteen
February 18th, 2009, 01:34 PM
I always thought GUI's in Java were pretty fun to make. I haven't tried making GUI's in other languages, though.

Limited
February 18th, 2009, 02:39 PM
I'm used to being able to put the controls where every I want on a form, Java though, they are always lined up and in linear order, I know theres different options but they are very limited.

Jpanels, custom dialogs, jframes all that stuff all the different wrappers it confuses me.

klange
February 18th, 2009, 03:23 PM
GUIs? Try learning GTK in C. Now that's a doozy, but well worth it.

Personally, I use generators for most of my GUIs, unless I'm doing something interface-specific like a game, in which case I usually write up my own little toolkit to ensure everything works together the way I want it to (which happens to be what I'm doing right now, just got a scrolling list running with PyGame. Nothing fancy yet, just some boxes and some major input handling).

The two main Java GUI systems aren't very good: They don't look appealing, it's near impossible to make them blend in with all different OS/DE toolkits, and more importantly, they're slow.

If you want easy GUI programming, use QT. Don't even ask about Winforms, GTK looks nice but is a pain to write, Tk is a joke, and everything else is in a niche that you probably don't fit in.

Side Notes: GTK is pack-oriented: You don't set coordinates, you make layout tables. Things scale nicely, but aren't always well positioned (note that you can do a coordinate+size GUI with GTK, it's just not the norm or the standard). QT is a lot like WinForms (you probably use at least one QT app on a regular basis). TK is pack-oriented and looks like shit on everything.

ExAm
February 20th, 2009, 04:50 AM
DAY 2 CODING CLASS REPORT.

Holy shit, what the fuck happened? I could swear I got high off that shit :gonk:
Why does writing strings of characters into a text editor generate such euphoria???

HELP!

ALSO:
No GUI coding in this class :C

n00b1n8R
February 20th, 2009, 05:54 AM
Shit, now you're making me want to gb2coding101 :gonk:
I've been clean for a year and even then only fooled with VB.

ExAm
February 24th, 2009, 09:19 PM
MPG program homework

/**
CS-11 Asn 2
carcost.cpp
Purpose: calculates the cost of
and carbon emitted by 100 miles of driving in a car.

@author Jason
@version 1.0 02/24/09
*/

#include <iostream>
using namespace std;

int main ()
{
// Fuel efficiency input
double mpg = 0.0;
cout << " Enter the fuel efficiency of the car in MPG: ";
cin >> mpg;

// Price Per Gallon of gas input
double ppg = 0.0;
cout << " Enter the price of gas per gallon: ";
cin >> ppg;

// Calculations for the cost of, and carbon emitted by, driving 100 miles
double a = 100 / mpg;
double drivecost = a * ppg;
double carbonemit = a * 20;

// Results Output
cout << "\n"" The cost of driving 100 miles in your car: $"
<< drivecost << "\n"
" The amount of carbon emitted by driving 100 miles in your car: "
<< carbonemit << " pounds \n";

return 0;
} // end of main function


How's my cleanliness, coders?

Limited
February 25th, 2009, 07:08 AM
:) Pretty good.

A few things I think you might want to consider (you may not know how to do, but think about if it would be good)

Checking the figures are above 0.
Rounding carbonemit to like 2 or 3 decimal points or perhaps just one.

About naming variables, usually if you have a variable name that consists of two or more real world words the leading character is lowercase and the proceeding new word character is higher.

For example:

driveCost;
carbonEmit;Even though they make no actual difference to the program, its a good standard to use because it makes reading them easier and it shows they are variables.

Also, your program closes instantly after it displays the amount of carbon your car uses, when I create console apps (in C++) I use the following.

getch();It basically retrieves the next character input, its like using System('PAUSE'); but doesnt display anything. To use it you need to include conion.h

#include <conio.h>The class will next probably get you think about methods and ask you to implment methods you call to work out the calculation.

Such as

public double calculateCarbon(double mpgIn, double ppgIn);Then you do the calculation, you could also have another method that calculates it using litres which would be used in European countries.

Also because I'm very picky

cout << " Enter the price of gas per gallon: $";

Anyways I'm getting ahead of myself lol.

tl;dr
Working great although if I was you I'd implement the getch(); so the user has time to read the outputted string before it instantly closes, part from that all is well although I would try to use the correct naming standard for variables as it will help you out alot when you make big projects.

ExAm
February 25th, 2009, 03:37 PM
I'm getting ahead of myself lol.And way ahead of my class, apparently :gonk:

We're not supposed to include our own functions and stuff in programs assigned for homework.


Also because I'm very picky

cout << " Enter the price of gas per gallon: $";
Oh shi-
forgot that one