Powered by Invision Power Board

 
  Pages: (10) 1 [2] 3 4 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> Giygas learns the art of C++
United States
Bacteriophage
Posted: Sep 24 2009, 06:06 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


QUOTE (RetroXYZ @ Sep 24 2009, 03:06 PM)
actually, for the most part, if you understand classes, SFML is extremely easy to use

But not wise.

This post has been edited by Bacteriophage on Sep 24 2009, 06:06 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 06:24 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 06:04 PM)
Grats. I'm doing the same thing.

Though I think you're taking this far too fast. You won't learn arrays, pointers, or classes to the extent that you can use them in just four hours.

Take it slow.

Also, don't be an idiot about it. Don't think that just because you understand how to use classes you're a master of programming. You have a lot of work to do with memory management before you're ready to make anything good.

No, no, of course not.
Perhaps I am taking this a bit fast, but I understand that I won't be able to learn anything to it's full potiential in a few hours.
I'm probraly going to be doing alot with just the basics, input/output, functions, variables, etc. and make a bunch of programs such as calculators and all of that.
Then after I do that, which will probrably take a few days, i'll start investigating arrays, classes, etc. and see how I can use them.
Then... Well, I guess what comes next I can't really say right now... I don't even know myself. :L
PMEmail Poster
Top
United States
Bacteriophage
Posted: Sep 24 2009, 06:29 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


QUOTE (Giygas @ Sep 24 2009, 04:24 PM)
No, no, of course not.
Perhaps I am taking this a bit fast, but I understand that I won't be able to learn anything to it's full potiential in a few hours.
I'm probraly going to be doing alot with just the basics, input/output, functions, variables, etc. and make a bunch of programs such as calculators and all of that.
Then after I do that, which will probrably take a few days, i'll start investigating arrays, classes, etc. and see how I can use them.
Then... Well, I guess what comes next I can't really say right now... I don't even know myself. :L

As an actual programmer you'll be creating solutions for problems that aren't already outlined for you. So try to adjust to that environment of thought by making programs that solve problems for you or are good entertainment.

For example, my first program used simple i/o and a functionless expression to work out the quadratic formula for me. Your guess the number game is also a good idea, albeit a bit overdone.

Try not to think of things like arrays and classes as "things to know" but as tools to use.

Take it at your own pace. Some programming languages (C++ included) are taught over the course of months. Just because Retro, et al. can pretend to learn it in a few days doesn't mean you should rush through it.

Otherwise, you risk becoming one of the countless uninformed apologetic teens who prove themselves the ****ing bane of any programming effort, ever.


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 06:36 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 06:29 PM)
As an actual programmer you'll be creating solutions for problems that aren't already outlined for you. So try to adjust to that environment of thought by making programs that solve problems for you or are good entertainment.

For example, my first program used simple i/o and a functionless expression to work out the quadratic formula for me. Your guess the number game is also a good idea, albeit a bit overdone.

Try not to think of things like arrays and classes as "things to know" but as tools to use.

Take it at your own pace. Some programming languages (C++ included) are taught over the course of months. Just because Retro, et al. can pretend to learn it in a few days doesn't mean you should rush through it.

Otherwise, you risk becoming one of the countless uninformed apologetic teens who prove themselves the ****ing bane of any programming effort, ever.

Thank you for the info, Phage- I guess I was overcomplicating it, or thinking as C++ as a program that you can learn just by reading a few tutorials.
This won't discourage me, though, because C++ is something you really need to know if you are looking to head into the programming career ( as I do, and aparently, with you learning his to work with Valve, you to do :3 ).
Plus, it's fun to do and can help with things outside of the internet, to.
PMEmail Poster
Top
United States
Retriever II
Posted: Sep 24 2009, 06:41 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


C++ has a very large number of subtleties to it that will creep up and bite you for years to come. I still get bitten on occasion.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Bacteriophage
Posted: Sep 24 2009, 06:44 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


QUOTE (Retriever II @ Sep 24 2009, 04:41 PM)
C++ has a very large number of subtleties to it that will creep up and bite you for years to come. I still get bitten on occasion.

RII, question.

Is basic -> functions -> arrays -> pointers -> classes -> inheritance a good order to work through learning the language?

And what's a typedef?


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 06:46 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 06:44 PM)
RII, question.

Is basic -> functions -> arrays -> pointers -> classes -> inheritance a good order to work through learning the language?

And what's a typedef?

Actually, I would very much like to know if that's a good path to.


Also, I just got finished with a basic calculator that asks you for two numbers, then you type in 1-4 to decide if you want i to add, subtact, multiply or divide them, respectively. 5 Exits it.
Now i'm gonna try to make the interface slightly easier to use. :3
PMEmail Poster
Top
Unspecified
Lightning
Posted: Sep 24 2009, 06:52 PM
Quote Post


Ignorance isn't stupidity but choosing to remain ignorant is
[*][*]

Group Icon
Group: IRC Operators
Posts: 6381
Member No.: 583
Joined: 31-August 04

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 07:44 PM)
RII, question.

Is basic -> functions -> arrays -> pointers -> classes -> inheritance a good order to work through learning the language?

And what's a typedef?

typedef is easy.


after this line:
CODE
typedef int foo;
the following two lines would be equivalent:
CODE
foo a;
CODE
int a;



after this line:
CODE
typedef float bar[3];
the following two lines would be equivalent:
CODE
bar a;
CODE
float a[3];



--------------------
click here to change my avatar. / gosh why are you even here lightning
hacker, n.an individual who enjoys learning computer system details and how to capitalize on his or her capabilities...not a criminal.
(from webster's new world hacker dictionary)
fedora linux 10
Fedora 10 Final!

Download today!
quality web comics (stories):
  1. girl genius: adventure! romance! mad science!
  2. punch an' pie: try a slice of life, then swallow.
  3. dresden codak: most interesting comic ever
quality web comics (one-shots):
  1. a softer world: truth and beauty bombs
  2. smbc: saturday morning breakfast cereal
  3. buttersafe: pictures and probably some words
"Religion is comparable to a childhood neurosis." - Sigmund Freud
“It is not by delusion, however exalted, that mankind can prosper, but only by unswerving courage in the pursuit of truth.” - Bertrand Russell
“To kill an error is as good a service as, and sometimes better than, the establishing of a new truth or fact.” - Charles Darwin
PMUsers WebsiteMSN
Top
United States
Bacteriophage
Posted: Sep 24 2009, 06:55 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


ty lif


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 07:00 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


Okay, so after wondering why my calculator doesn't support decimals, I realised that using float in place of int works. So, is Float just int with decimals? If so, why is int even there if float is better anyways?
PMEmail Poster
Top
United States
Bacteriophage
Posted: Sep 24 2009, 07:04 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


QUOTE (Giygas @ Sep 24 2009, 05:00 PM)
Okay, so after wondering why my calculator doesn't support decimals, I realised that using float in place of int works. So, is Float just int with decimals? If so, why is int even there if float is better anyways?

int can do a lot of things that float can't. For example, an int number can be used as a counting number and be incremented/decremented as part of a for loop.

int also takes less memory.

floating-point numbers (aka float) are more precise, but take more memory and are more difficult to work with in counting operations. They can also **** up logical operators since processors always have some degree of inaccuracy in floating-point calculations.

also if you're going to use decimal numbers I personally suggest double. There's still inaccuracy but there's less of it.

This post has been edited by Bacteriophage on Sep 24 2009, 07:05 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 07:09 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 07:04 PM)
int can do a lot of things that float can't. For example, an int number can be used as a counting number and be incremented/decremented as part of a for loop.

int also takes less memory.

floating-point numbers (aka float) are more precise, but take more memory and are more difficult to work with in counting operations. They can also **** up logical operators since processors always have some degree of inaccuracy in floating-point calculations.

also if you're going to use decimal numbers I personally suggest double. There's still inaccuracy but there's less of it.

Oh alright, thanks for clearing that up.
I guess in future programs that don't require decimals i'll use int, otherwise, for things like calculators i'll stick to Doubles.

Speaking of calculator's,
user posted image

This is neat stuff :D
PMEmail Poster
Top
United States
Bacteriophage
Posted: Sep 24 2009, 07:10 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


So are you using dedicated functions/expressions for squaring and cubing, or are you using <cmath>


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 07:14 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 07:10 PM)
So are you using dedicated functions/expressions for squaring and cubing, or are you using <cmath>

I'm using dedicated functions and expressions currently, like
x*x and (x*x)*x.
I have not heard of <cmath> actually.
PMEmail Poster
Top
United States
Bacteriophage
Posted: Sep 24 2009, 07:15 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]




--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
OniLink10
Posted: Sep 24 2009, 07:16 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Giygas @ Sep 24 2009, 05:00 PM)
Okay, so after wondering why my calculator doesn't support decimals, I realised that using float in place of int works. So, is Float just int with decimals? If so, why is int even there if float is better anyways?

int is an Integer, so it allows you to use only Non-decimal numbers. It is typically more accurate than Floating Point numbers when it comes to integers, and uses less memory and CPU time. Integers also have the advantages that Phage listed. Float is a Floating Point Number, so it allows you to use decimal numbers. Float is usually more accurate than int when it comes to floating points, but it uses more CPU and Memory.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
Giygas
Posted: Sep 24 2009, 07:17 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


QUOTE (Bacteriophage @ Sep 24 2009, 07:15 PM)
http://cplusplus.com/reference/clibrary/cmath/

fun times

Woah.

That would make it... Alot easier to do... Everything, really.
Though I won't add all of that to my calculator, things like Square Root and all of that good stuff could be useful.
If only I could find the proper format...
PMEmail Poster
Top
United States
RetroXYZ
Posted: Sep 24 2009, 07:20 PM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2714
Member No.: 4325
Joined: 27-August 07

Status: (0d) [--]


I was trying to make a C++ tutorial at one point. I should work on it more.
PMEmail PosterMSN
Top
United States
Bacteriophage
Posted: Sep 24 2009, 07:20 PM
Quote Post


injustice anywhere is a threat to justice everywhere
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][KFC]

Group Icon
Group: Members
Posts: 10716
Member No.: 2411
Joined: 31-July 06

Status: (0d) [--]


QUOTE (RetroXYZ @ Sep 24 2009, 05:20 PM)
I was trying to make a C++ tutorial at one point.  I should work on it more.

What useful program have you actually made in c++? I'm interested.

This post has been edited by Bacteriophage on Sep 24 2009, 07:21 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Giygas
Posted: Sep 24 2009, 07:21 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 910
Member No.: 4767
Joined: 24-November 07

Status: (0d) [--]


Oh I see, it shows the format of the commands if you click on the link.
Awesome.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (10) 1 [2] 3 4 ... Last » Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0853 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.27 ]