This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mackan90096's profile picture

Want to learn C++ ?

Started by Mackan90096, 27 May 2013 - 04:11 AM
Mackan90096 #1
Posted 27 May 2013 - 06:11 AM
Hi! Anyone want to learn C++ ?

Pm me, I'll give you a book in .pdf format.

//Mackan90096
Mads #2
Posted 27 May 2013 - 08:03 AM
Why the hell not just post it here?
Orwell #3
Posted 27 May 2013 - 08:28 AM
For thoso who really want to learn it in depth and don't mind buying a book; I really, really recommend this book by the creator of C++ himself. It's how I learned it and I don't know of any better resource.

The reason he doesn't put the pdf up here is probably because it's a pirated copy?
Mackan90096 #4
Posted 27 May 2013 - 08:38 AM
For thoso who really want to learn it in depth and don't mind buying a book; I really, really recommend this book by the creator of C++ himself. It's how I learned it and I don't know of any better resource.

The reason he doesn't put the pdf up here is probably because it's a pirated copy?

No, It's not a pirated so link:

https://www.dropbox.com/s/f5at9n658p3dgqm/Big%20C%2B%2B.pdf?m
ETHANATOR360 #5
Posted 27 May 2013 - 11:17 AM
i would like to learn C stuff first but what the heck
theoriginalbit #6
Posted 27 May 2013 - 11:26 AM
i would like to learn C stuff first but what the heck
C and C++ go hand in hand. Actually you will probably be hard pressed to try and find just a straight C reference material nowadays, most searches come up with C/C++ results.
Engineer #7
Posted 27 May 2013 - 11:47 AM
This might come in handy when I ever want to learn C++. Thanks anyway!
Mads #8
Posted 27 May 2013 - 11:55 AM
This might come in handy when I ever want to learn C++. Thanks anyway!
"when"…

DO IT NAOW! :P/>
ETHANATOR360 #9
Posted 27 May 2013 - 09:36 PM
i would like to learn C stuff first but what the heck
C and C++ go hand in hand. Actually you will probably be hard pressed to try and find just a straight C reference material nowadays, most searches come up with C/C++ results.
http://www.amazon.com/Hacking-Art-Exploitation-Jon-Erickson/dp/1593271441 this book has a great explanation of C alone with no C++ involved and b.t.w i want to learn normal C instead of C++ first because when i start obj-c i want to know where im limited as far as C goes :)/>
Mads #10
Posted 28 May 2013 - 01:38 AM
i would like to learn C stuff first but what the heck
C and C++ go hand in hand. Actually you will probably be hard pressed to try and find just a straight C reference material nowadays, most searches come up with C/C++ results.
http://www.amazon.co...n/dp/1593271441 this book has a great explanation of C alone with no C++ involved and b.t.w i want to learn normal C instead of C++ first because when i start obj-c i want to know where im limited as far as C goes :)/>

May I ask why you want to learn Objective C?
margeobur #11
Posted 28 May 2013 - 01:55 AM
I'm learning with a book called "Teach Yourself C++ in 21 days" by a guy called Jesse Liberty. (It has taken me… more than one year though… for various reasons O_o) Just thought I'd share :)/>
theoriginalbit #12
Posted 28 May 2013 - 03:24 AM
May I ask why you want to learn Objective C?
Probably because it is awesome! Square brackets ftw! Also a truly good program for an OS is developed in the native language, in Mac's case, Obj-C, and iOS dev can only be in Obj-C. So maybe he wishes to develop for Mac or iOS.
ETHANATOR360 #13
Posted 28 May 2013 - 01:55 PM
May I ask why you want to learn Objective C?
Probably because it is awesome! Square brackets ftw! Also a truly good program for an OS is developed in the native language, in Mac's case, Obj-C, and iOS dev can only be in Obj-C. So maybe he wishes to develop for Mac or iOS.
correct!
Dlcruz129 #14
Posted 29 May 2013 - 10:46 AM
May I ask why you want to learn Objective C?
Probably because it is awesome! Square brackets ftw! Also a truly good program for an OS is developed in the native language, in Mac's case, Obj-C, and iOS dev can only be in Obj-C. So maybe he wishes to develop for Mac or iOS.

Should I learn C++ then, as I use windows?
ShadowedZenith #15
Posted 29 May 2013 - 10:48 AM
May I ask why you want to learn Objective C?
Probably because it is awesome! Square brackets ftw! Also a truly good program for an OS is developed in the native language, in Mac's case, Obj-C, and iOS dev can only be in Obj-C. So maybe he wishes to develop for Mac or iOS.

*looks at the Mono project and Adobe Flash's iOS compiler* Pretty sure you can develop in other languages besides Objective-C on iOS devices…
theoriginalbit #16
Posted 29 May 2013 - 10:55 AM
Should I learn C++ then, as I use windows?
C++++ (a.k.a C#) is really what you should use for Windows.


*looks at the Mono project and Adobe Flash's iOS compiler* Pretty sure you can develop in other languages besides Objective-C on iOS devices…
Ever heard of the reasons not to use an interpreter, and instead code natively?
Mono Project, Adobe Flash's iOS compiler, Titanium, and many many more, all give you the ability to make iOS applications in languages other than Objective-C, however, the translation process behind the scenes that interprets from language x to Obj-C is shoddy at best. They always do a direct conversion, meaning that code can become massively inefficient, use deprecated method calls, and not use some API calls at all, just to list a few bad things. This can cause a bad UI, UX and functionality in programs, which Apple does not want, as such they will decline your app from publication on the app store instantly. If your app manages to make it beyond the validation within Apple you will always get bad ratings from users, which sends your, or your companies reputation into the ground.
TL;DR/In summary… no, just no, you should always code natively, there are many reasons why, if you want to know just some don't be lazy and read the text above.
Mads #17
Posted 29 May 2013 - 10:58 AM
Shit, I'm about to puke so bad right now.
ShadowedZenith #18
Posted 29 May 2013 - 10:59 AM
Should I learn C++ then, as I use windows?
C++++ (a.k.a C#) is really what you should use for Windows.


*looks at the Mono project and Adobe Flash's iOS compiler* Pretty sure you can develop in other languages besides Objective-C on iOS devices…
Ever heard of the reasons not to use an interpreter, and instead code natively?
Mono Project, Adobe Flash's iOS compiler, Titanium, and many many more, all give you the ability to make iOS applications in languages other than Objective-C, however, the translation process behind the scenes that interprets from language x to Obj-C is shoddy at best. They always do a direct conversion, meaning that code can become massively inefficient, use deprecated method calls, and not use some API calls at all, just to list a few bad things. This can cause a bad UI, UX and functionality in programs, which Apple does not want, as such they will decline your app from publication on the app store instantly. If your app manages to make it beyond the validation within Apple you will always get bad ratings from users, which sends your, or your companies reputation into the ground.
TL;DR/In summary… no, just no, you should always code natively, there are many reasons why, if you want to know just some don't be lazy and read the text above.

You SHOULD always code natively, doesn't change the fact that there are other options and doesn't change the fact that, at least last I heard, Apple accepts applications written in other languages than Objective-C.
Dlcruz129 #19
Posted 29 May 2013 - 11:02 AM
I thought Windows was written in C++ and Assembly, though?
ShadowedZenith #20
Posted 29 May 2013 - 11:06 AM
I thought Windows was written in C++ and Assembly, though?

If you're looking for the most performance, Assembly or C/C++ is the best way to go with Windows.
theoriginalbit #21
Posted 29 May 2013 - 11:06 AM
Shit, I'm about to puke so bad right now.
Why because Adobe Flash was mentioned, or because Apple was mentioned?

You SHOULD always code natively, doesn't change the fact that there are other options and doesn't change the fact that, at least last I heard, Apple accepts applications written in other languages than Objective-C.
So if you're saying people should code natively, then why are you also saying there are other (worse) options out there, seems a little contradictory. Last I heard (about 3-6 months ago) Apple was starting to reject them due to the deteriorating quality.

I thought Windows was written in C++ and Assembly, though?
Hahahaha… Windows, written in Assembly, no.

If you're looking for the most performance, Assembly or C/C++ is the best way to go with Windows.
And thats not because Windows is written in C++ or Assembly, it is because Assembly or C++ is best for performance on any computer system.

EDIT: Fun fact, in about 5 or so years we will all be programming in JavaScript as it will be much faster than any other code out there. Reason: there is a new chip that has been released (currently version 1.0) that its sole purpose is to process HTML DOM and JS. Making it faster than anything else that has to share the CPU.
Edited on 29 May 2013 - 09:09 AM
D3matt #22
Posted 29 May 2013 - 11:10 AM
Windows is written in C/C++, C#, and some assembly. http://social.microsoft.com/Forums/en-US/windowshpcacademic/thread/65a1fe05-9c1d-48bf-bd40-148e6b3da9f1
Dlcruz129 #23
Posted 29 May 2013 - 11:12 AM
I thought Windows was written in C++ and Assembly, though?
Hahahaha… Windows, written in Assembly, no.
Wikipedia said:
Programmed in C, C++ and Assembly language[1]

EDIT: These ninjas…
Dlcruz129 #24
Posted 29 May 2013 - 11:15 AM
What are the best video tutorials for C++? I've found I learn more from watching people than sitting down and reading a book.
ShadowedZenith #25
Posted 29 May 2013 - 11:16 AM
Shit, I'm about to puke so bad right now.
Why because Adobe Flash was mentioned, or because Apple was mentioned?

You SHOULD always code natively, doesn't change the fact that there are other options and doesn't change the fact that, at least last I heard, Apple accepts applications written in other languages than Objective-C.
So if you're saying people should code natively, then why are you also saying there are other (worse) options out there, seems a little contradictory. Last I heard (about 3-6 months ago) Apple was starting to reject them due to the deteriorating quality.

I thought Windows was written in C++ and Assembly, though?
Hahahaha… Windows, written in Assembly, no.

If you're looking for the most performance, Assembly or C/C++ is the best way to go with Windows.
And thats not because Windows is written in C++ or Assembly, it is because Assembly or C++ is best for performance on any computer system.

EDIT: Fun fact, in about 5 or so years we will all be programming in JavaScript as it will be much faster than any other code out there. Reason: there is a new chip that has been released (currently version 1.0) that its sole purpose is to process HTML DOM and JS. Making it faster than anything else that has to share the CPU.

I'm suggesting that there are other available languages outside of Objective-C because the way you worded your post made it sound like there was absolutely no other options, even though right there are two valid (though likely not optimal) options.
TomyLobo #26
Posted 29 May 2013 - 11:17 AM
i would like to learn C stuff first but what the heck
bad idea. C++ is a different language.
Mads #27
Posted 29 May 2013 - 11:19 AM
Shit, I'm about to puke so bad right now.
Why because Adobe Flash was mentioned, or because Apple was mentioned?

Because people are stupid enough to think that you have to write in Objective-C for Apple, and that you cannot write code in any other language, which can be compiled to run natively.
M4sh3dP0t4t03 #28
Posted 29 May 2013 - 11:37 AM
EDIT: Fun fact, in about 5 or so years we will all be programming in JavaScript as it will be much faster than any other code out there. Reason: there is a new chip that has been released (currently version 1.0) that its sole purpose is to process HTML DOM and JS. Making it faster than anything else that has to share the CPU.
I don't think so, because noone knows what progress will be made with x86 chips in the next few years. Also you would need to rewrite lots of stuff because the interpreters for all coding languages would have to work different.

And assembly language is ALWAYS the fastest, because it interacts directly with the hardware and doesn't need an interpreter.
Orwell #29
Posted 29 May 2013 - 02:14 PM
i would like to learn C stuff first but what the heck
bad idea. C++ is a different language.
C++ was designed in such a way that C is a valid subset of C++. With other words, every C program is valid C++ as well. There are only a couple of incompatibilities and those are nicely listed here: http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++ . So to say that C++ is a different language (which it literally is, but that's not what you ment) isn't true. You can perfectly learn C first to get the hang of most of C-style syntax and the procedural paradigm without bothering about object orientation and exra syntax. If you ask me, C (and assembly certainly too) is perfect to learn real technical programming. It can make you grasp pointers, memory management, the stack, etc. If you proceed to C++, C#, Objective-C after that, you can be confident that you really understand what's going on on the lower levels and how you can control a program in every aspect. I'm not saying that you couldn't learn this through C++ (we did so at Uni), but I've seen many dive into C++ (or especially C#) and a lot of them avoided the low-level stuff because they could make their way around (with the logical inefficiency problems etc. of course) and they didn't really understand what was happening under the hood.

Also, lots of microcontrollers (like the Arduino) natively use very close variants of C or even C itself and practically never C++ or anything else.

All these languages have the C language in common, so learning pure C can greatly help you to see how other languages build onto that, thus mastering those languages more quickly.
TomyLobo #30
Posted 29 May 2013 - 02:24 PM
i would like to learn C stuff first but what the heck
bad idea. C++ is a different language.
C++ was designed in such a way that C is a valid subset of C++. With other words, every C program is valid C++ as well. There are only a couple of incompatibilities and those are nicely listed here: http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++ . So to say that C++ is a different language (which it literally is, but that's not what you ment) isn't true. You can perfectly learn C first to get the hang of most of C-style syntax and the procedural paradigm without bothering about object orientation and exra syntax. If you ask me, C (and assembly certainly too) is perfect to learn real technical programming. It can make you grasp pointers, memory management, the stack, etc. If you proceed to C++, C#, Objective-C after that, you can be confident that you really understand what's going on on the lower levels and how you can control a program in every aspect. I'm not saying that you couldn't learn this through C++ (we did so at Uni), but I've seen many dive into C++ (or especially C#) and a lot of them avoided the low-level stuff because they could make their way around (with the logical inefficiency problems etc. of course) and they didn't really understand what was happening under the hood.

Also, lots of microcontrollers (like the Arduino) natively use very close variants of C or even C itself and practically never C++ or anything else.

All these languages have the C language in common, so learning pure C can greatly help you to see how other languages build onto that, thus mastering those languages more quickly.
No one who knows what they're talking about will recommend you to learn C in order to learn C++.
Here's a factoid from a bot fed by such people:

[20:23:15] <nolyc> Learning C++ requires no previous C knowledge and many C style ways of doing things are replaced by better or equivalent language additions. A good C++ book will look very different from a good C book. However, if you do know C already, it is evident that reading The C++ programming language by Bjarne Stroustrup gives you a very solid understanding of C++.
Orwell #31
Posted 29 May 2013 - 02:41 PM
* snip! *
No one who knows what they're talking about will recommend you to learn C in order to learn C++.
Here's a factoid from a bot fed by such people:

[20:23:15] <nolyc> Learning C++ requires no previous C knowledge and many C style ways of doing things are replaced by better or equivalent language additions. A good C++ book will look very different from a good C book. However, if you do know C already, it is evident that reading The C++ programming language by Bjarne Stroustrup gives you a very solid understanding of C++.</nolyc>
I never said that you needed C to learn C++. All my arguments say that C forces you more to learn the low-level stuff of programming than C++ does. It's mainly because of how C++ implements things better that it makes it able to ignore certain technical aspects of programming. And it's even a lot more relevant for languages as C#.

Basically, that quote exactly states my point. Good C++ is different from good C. C++ is more intuitive, flexible, productive, etc. But certainly with the C++11 standard now; being able to use the 'auto' keyword everywhere makes it easy to neglect everything that's happening under the hood.

Again, while I believe it's more likely to do so in C, I'm not saying that you can't learn in-depth programming in C++. I remember the exam of one of the advanced programming courses on C++ we had. We got a small C++ program of about 50 lines (function calls, instantiation and some local scopes mainly) and the source of all the classes that were being used in the code. Then we had to write down the entire stacktrace this program would produce. Those are good excercises, but I doubt a lot of people are doing that in their spare time…

Also, that book you're citation refers to is the same I recommended at the beginning of this thread. :)/> Good book! ;)/>
Orwell #32
Posted 29 May 2013 - 02:50 PM
And assembly language is ALWAYS the fastest, because it interacts directly with the hardware and doesn't need an interpreter.
A lot of languages like C and C++ (and hundreds of others) aren't interpreted at all but are compiled directly to machine code (which is equivalent to asm). So that's not entirely true. And even though efficiency would still be slightly better in assembly, the productivity of other languages totally outbalance asm.
theoriginalbit #33
Posted 29 May 2013 - 07:47 PM
I don't think so, because noone knows what progress will be made with x86 chips in the next few years. Also you would need to rewrite lots of stuff because the interpreters for all coding languages would have to work different.

And assembly language is ALWAYS the fastest, because it interacts directly with the hardware and doesn't need an interpreter.
Not much more progress can be made with the silicon chip, they are starting to hit the limit of physics, there is only so small they can go, and its called an atom. However gold connections need to be 2 atoms. That is the limitation of silicon. Yes we can go to the graphene chip, and we eventually will, but there are safety concerns with it atm that they are trying to overcome.

As it stands (excluding assembly) C/C++ is the language that runs fastest on our modern day computers. However the C/C++ program still needs to share the CPU with everything else, this is where the separate chip comes in and makes processing DOM quicker, it doesn't need to take up time in the CPU and share it with anything else, it will have its own dedicated chip!
ShadowedZenith #34
Posted 29 May 2013 - 08:57 PM
I don't think so, because noone knows what progress will be made with x86 chips in the next few years. Also you would need to rewrite lots of stuff because the interpreters for all coding languages would have to work different.

And assembly language is ALWAYS the fastest, because it interacts directly with the hardware and doesn't need an interpreter.
Not much more progress can be made with the silicon chip, they are starting to hit the limit of physics, there is only so small they can go, and its called an atom. However gold connections need to be 2 atoms. That is the limitation of silicon. Yes we can go to the graphene chip, and we eventually will, but there are safety concerns with it atm that they are trying to overcome.

As it stands (excluding assembly) C/C++ is the language that runs fastest on our modern day computers. However the C/C++ program still needs to share the CPU with everything else, this is where the separate chip comes in and makes processing DOM quicker, it doesn't need to take up time in the CPU and share it with anything else, it will have its own dedicated chip!

They already have chips that allow you to offload processes onto separate, dedicated processors. They're called FPGA (field-programmable gate arrays). Pretty sure you could easily program one to handle a dedicated JS/DOM/HTML hardware implementation. Though, I'd really love to see your source for your claim that there's a chip already produced to run JS at a native level. I tried googling it and turned up nothing.
TomyLobo #35
Posted 30 May 2013 - 09:09 AM
and you bet it would show up on google if theoriginalbit knew about it (and wasn't breaking his NDA by telling us)