C++ for first language?

Everything related to programming.
User avatar
Vegerot
SEAL
Posts: 615
Joined: Thu Nov 26, 2009 10:13 pm
Location: Behind you with an Energy sword.
Contact:

C++ for first language?

Post by Vegerot » Mon Mar 12, 2012 6:10 pm

So I never did get to teaching myself C. But I signed up for the programming elective at my school for the last trimester. But the only programming class there is is teaching C++. So that'll be an interesting first language to learn.
Bunneh wrote:Now, please don't spam my newsfeed on how you need like 3 dildoes to make a giant dick statue on penisland or any of those other shitty facebook games.
Image

User avatar
Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: C++ for first language?

Post by Sparky » Wed Mar 14, 2012 1:32 pm

It's a fun one to learn in school; I learned C++ in high school also! Go for it, and take notes really well so you can make a smooth transition to Objective-C after that.
Either you are groping for answers, or you are asking God and listening to Jesus.

nil
Halo Moderator
Halo Moderator
Posts: 1085
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: C++ for first language?

Post by nil » Wed Mar 14, 2012 7:47 pm

I think C++ is a bad beginner's language, and that it is also not a good language, but that may not mean your course will be bad. Seeing that you're running on a trimester schedule and that this is high school, chances are you'll only learn a small portion of the language and instead primarily focus on basic imperative concepts like loops, variables, functions, and what not. If I were to guess, you may learn very little in C++ that differs from C and you will not learn important concepts in C that relate to C++ (and Objective-C) like pointers. If you've never programmed before, it may be worthwhile experience anyway teaching you the basic programming concepts (C++ is just a poor language choice).

Also, wrong forum, should go to Programmer's section.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

User avatar
Vegerot
SEAL
Posts: 615
Joined: Thu Nov 26, 2009 10:13 pm
Location: Behind you with an Energy sword.
Contact:

Re: C++ for first language?

Post by Vegerot » Fri Mar 16, 2012 11:35 am

Oh god. This class is gonna suck. There are a bunch of people in the class who didn't even pick it, but they were put in because their other choices were full. We're using a teacher brought in from somewhere else, so nobody has any respect for him. The whole class, people were just talking, running around the room, girls were sitting on guys laps, someone was taking a nap, and everyone was acting like a fuckwad. Granted, the school didn't install the software the teacher wanted, so the whole class the application was just downloading, so nobody actually had to DO anything. But because of that, the teacher decided he would spend the whole class just telling us about programming and verbally telling us basic things, but of course nobody was listening. But I had Xcode, and thankfully the teacher was well-versed with Mac and Xcode too (I figured we were going to go into so little depth that the operating system wouldn't make a difference), so he started to show me some stuff, but he had to deal with all the other people being retards. So all he showed me is that if I change "Hello world" and press the "run" button, I can change the text.

So all I learned that first class was that that the "run" button activated your program, computers are idiots (a better word would be unintelligent), and that there's this thing called "X" and that "X"--like in algebra-- is a variable. But unlike in algebra, "X" doesn't have a fixed value, so you can change it to mean other things. I have no clue what X is though, and what the value would address.

Also, this class is just once a week...for one trimester...with people who have no will to learn anything. So given these things I'll pretty much learn nothing about the language.

and this is in the Programming section.
Bunneh wrote:Now, please don't spam my newsfeed on how you need like 3 dildoes to make a giant dick statue on penisland or any of those other shitty facebook games.
Image

User avatar
Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: C++ for first language?

Post by Sparky » Fri Mar 16, 2012 12:04 pm

That was similar to my high school experience in the class, although some were really into it while others decided to goof off and play games.

I'd say do what you can in the situation and let the instructor be disciplinarian if they so decide.

Also, get into a habit of never using capital letters in programming unless you have to do that; use comments instead.

x is a variable, meaning it can take any value. When you are solving a single algebraic equation, you assume that x has a single value. In programming, a variable can hold a single value also, but its value can change later if you make it change later. A number like 4 will remain that value indefinitely, but a variable "holds" a value like 4 or 3 or 2.93013 and so on, in the computer's memory. The memory can hold a different number later, so that's why the value of a variable can vary.

It's actually the same as algebra and math, where x can be called y or z or a or any letter or word, and that particular variable name remains the same as it is defined until it is changed later on in the program.

x = "Hello World" will mean that the string "Hello World" will replace every instance of the variable x when you use it. Typically, you would be more descriptive with your variable names, for example:

my_homework_assignment = "Answer questions 1-4 on page 223 in my math textbook. After that, work on my english essay for next week."

In this way, you don't have to type the same exact phrase over and over when you want to use it. You can do something simple like:

cout << my_homework_assignment;
and it will print the string value for you. cout and cin are two simple commands which are used to receive user input and print to the screen. Your starting programs will use the command-line interface. You would use the Mac OS windows and such with Objective-C programs.

Here are some old programs I wrote as high school homework assignments:
http://www.angelfire.com/nj/peanutbutte ... amming.htm
Either you are groping for answers, or you are asking God and listening to Jesus.

nil
Halo Moderator
Halo Moderator
Posts: 1085
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: C++ for first language?

Post by nil » Fri Mar 16, 2012 12:16 pm

Vegerot wrote:...But I had Xcode, and thankfully the teacher was well-versed with Mac and Xcode too (I figured we were going to go into so little depth that the operating system wouldn't make a difference)
Differences come from different compilers. Xcode nowadays either uses apple-gcc or clang. I've found that it's surprisingly easy to write incorrect code that won't pass in gcc but will in Microsoft's compiler (eg: omitting return statement at end of main()). Just shows C++ portability is a joke I suppose.
Vegerot wrote: and this is in the Programming section.
Only because someone moved it here.
Sparky wrote:Also, get into a habit of never using capital letters in programming unless you have to do that; use comments instead.
I don't quite get what this means, so I don't think it's good advice =P.
Sparky wrote:x is a variable, meaning it can take any value. When you are solving a single algebraic equation, you assume that x has a single value. In programming, a variable can hold a single value also, but its value can change later if you make it change later. A number like 4 will remain that value indefinitely, but a variable "holds" a value like 4 or 3 or 2.93013 and so on, in the computer's memory. The memory can hold a different number later, so that's why the value of a variable can vary.
Good explanation for imperative languages like C++, but for "in programming" is actually incorrect since functional languages abide more closely to mathematical definition that a variable does not vary.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

User avatar
Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: C++ for first language?

Post by Sparky » Sat Mar 17, 2012 1:25 pm

Make it a habit to only use lower-case letters and a generous measure of underscores in your variable names:

counter ≠ Counter
increment_brightness ≠ incrementbrightness

Separate words in your variables with underscores, and use lowercase letters in all your variables.
Either you are groping for answers, or you are asking God and listening to Jesus.

nil
Halo Moderator
Halo Moderator
Posts: 1085
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: C++ for first language?

Post by nil » Sat Mar 17, 2012 4:58 pm

Sparky wrote:Make it a habit to only use lower-case letters and a generous measure of underscores in your variable names:

counter ≠ Counter
increment_brightness ≠ incrementbrightness

Separate words in your variables with underscores, and use lowercase letters in all your variables.
That's just a stupid style preference. From my experience with various languages, local variable names and function/method names are either camel case like incrementBlueBrightness or with underscores like increment_blue_brightness (also: local variable names have same style as function/method names). Class names are usually capital case like MyClass. I sometimes switch from using under_scores or camelCase depending on the language I use. For instance, Ruby programmers heavily make use of under_scores while Objective-C programmers heavily make use of camelCase (and you really can't work around this for Obj-C method names without suffering). Although, not all languages have strong conventions like this.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

User avatar
Fonzeh
Ranger
Posts: 1888
Joined: Tue Oct 16, 2007 3:57 am
Location: "I didn't just take your mom out to dinner. I ate your mom for dinner."
Contact:

Re: C++ for first language?

Post by Fonzeh » Sun Mar 18, 2012 5:42 pm

c++ is my first language and im kinda soaking it up like a sponge, although the gui portion does intimidate me. i have new sources to post for you guys on what ive been doing, but im trying to get used to using multiple classes for different functions. its pretty easy going for me, just so easy to get lost in my code lol.

anyway ill post my sources later so nil can tell me what i did wrong lol.
G[v]N wrote:HUGE NOTIFICATION
THIS GRAVY HAS BRAINS
Mota-Lev was here 30/4/2010@2:18pm
Image

nil
Halo Moderator
Halo Moderator
Posts: 1085
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: C++ for first language?

Post by nil » Wed Mar 21, 2012 4:31 pm

Programming languages aren't bound by a "GUI." There is no GUI portion in C++. Yet there are GUI libraries, each which may support a number of programming languages. Learning a programming language and learning how a GUI library works are two distinct things.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

User avatar
Vegerot
SEAL
Posts: 615
Joined: Thu Nov 26, 2009 10:13 pm
Location: Behind you with an Energy sword.
Contact:

Re: C++ for first language?

Post by Vegerot » Thu Mar 22, 2012 1:21 pm

So, today, again, people were being total assholes. But I did learn how to comment.

Now what we're doing is that we're making a game where a computer randomly comes up with a number 1-100 and we have the guess what the number is, and the computer will either say "higher" or "lower" until we get the number right.

He gave us this packet that we're supposed to just read over, because we haven't gone over it yet in class.

(Sparky, next week we're Mumblin' during this class kaye?)

Also random links to shit I did today. http://www.mediafire.com/?2yibexj41ihbhlj (written by my teacher, but he wants us to use this in our app) http://www.mediafire.com/?vebk24trdh7491j (MY first application!!! I'm pretty sure I broke it during the last 30 seconds of class, but didn't have time to compile my changes so I couldn't check) http://www.mediafire.com/?czwz4xgi4251i0e (along with the past link are the first things I've made. I forget exactly what the different between these two are, guess it's bad to already be mixing my stiff up <.<)

Edit: can you guys also help me out with my packet? I'm 99% sure I'm going to be the only one to actually read the assignment but I want to do it anyways.
Bunneh wrote:Now, please don't spam my newsfeed on how you need like 3 dildoes to make a giant dick statue on penisland or any of those other shitty facebook games.
Image

User avatar
Monoman
Site Admin
Site Admin
Posts: 2662
Joined: Sat Aug 16, 2003 11:26 pm
Location: Planet Bob
Contact:

Re: C++ for first language?

Post by Monoman » Fri Mar 23, 2012 12:32 pm

From images in the packet, that isn't an assignment just an explanation of different constructs in the language. I didn't look at the other downloads.
Kansas....Like Paris Hilton: White, Flat, and Easy to Enter. -- Conan O'Brien

Masturbation is like procrastination, they're both great until you realize your screwing yourself.

MGM Discord | MGM Chat
MGM Sig

User avatar
Vegerot
SEAL
Posts: 615
Joined: Thu Nov 26, 2009 10:13 pm
Location: Behind you with an Energy sword.
Contact:

Re: C++ for first language?

Post by Vegerot » Fri Mar 23, 2012 12:44 pm

yeah, our assignment is to read it, but I'm having trouble understanding it.
Bunneh wrote:Now, please don't spam my newsfeed on how you need like 3 dildoes to make a giant dick statue on penisland or any of those other shitty facebook games.
Image

User avatar
Fonzeh
Ranger
Posts: 1888
Joined: Tue Oct 16, 2007 3:57 am
Location: "I didn't just take your mom out to dinner. I ate your mom for dinner."
Contact:

Re: C++ for first language?

Post by Fonzeh » Sat Mar 24, 2012 6:53 pm

nil wrote:Programming languages aren't bound by a "GUI." There is no GUI portion in C++. Yet there are GUI libraries, each which may support a number of programming languages. Learning a programming language and learning how a GUI library works are two distinct things.

I know this man thats why i haven't learned it yet. But you DO have the write the CODE to CREATE the GUI in C++. I DONT know how to DO that yet because I havent WENT OVER that because I haven't had TIME yet.

All I was saying. Sorry if there was some kind of miscommunication.
G[v]N wrote:HUGE NOTIFICATION
THIS GRAVY HAS BRAINS
Mota-Lev was here 30/4/2010@2:18pm
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest