By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - Gaming - Can I learn rudimentary programming from a book?

NJ5 said:
radha said:
NJ5 said:
Rpruett said:
I would start with C++. C is too cryptic in many ways and can be a hassle. Java is to abstracted from the actual machine IMO.

C++ will give you an easy introduction and understanding into what you're doing. As you grow with C++, you will be able to handle Java or most of what you want with relative ease.

That doesn't make sense. As other posters have said, C is essentially a subset of C++.  If you know C++ you know C too.

 

It is wrong to say C is a subset of C++, it si a preceding language not a subset, compailers compile c for backwards compatibility reasons not because they are the same, c is not object oriented , structures are suppoerted and there are ways to implement anything c++ has in c, but c++ has it as an standard, c is faster and more compacted.

Is not true that if you know C++ you know C too, because you need some work arounds to make C work like C++ that are not convetional.

 

I said essentially a subset. There are very few things which work in C but not C++, and they're all small details which can be converted in one second. Those differences are not relevant for this thread, they're slight nitpicks as you can read here:

http://www.research.att.com/~bs/bs_faq.html#C-is-subset

Thus, C++ is as much a superset of ANSI C as ANSI C is a superset of K&R C and much as ISO C++ is a superset of C++ as it existed in 1985. Well written C tends to be legal C++ also.

You mentioned structures. C's structures are also supported in C++, in fact a class is just a souped-up structure which allows to use the public/private/protected keywords.

You mentioned speed. C++ is not slower than C with equal code, only if you use a slower C++ feature (which you aren't forced to).

 

Thats not all, C++ has a more strick type check and some types on C wont compile on C++. and when i say speed i meant at low level of course, since thats mostly the main use of C now days.  both support structures but only C++ supports classes and is object oriented.

 



dd if = /dev/brain | tail -f | grep games | nc -lnvvp 80

Hey Listen!

https://archive.org/details/kohina_radio_music_collection

Around the Network
radha said:
NJ5 said:

I said essentially a subset. There are very few things which work in C but not C++, and they're all small details which can be converted in one second. Those differences are not relevant for this thread, they're slight nitpicks as you can read here:

http://www.research.att.com/~bs/bs_faq.html#C-is-subset

Thus, C++ is as much a superset of ANSI C as ANSI C is a superset of K&R C and much as ISO C++ is a superset of C++ as it existed in 1985. Well written C tends to be legal C++ also.

You mentioned structures. C's structures are also supported in C++, in fact a class is just a souped-up structure which allows to use the public/private/protected keywords.

You mentioned speed. C++ is not slower than C with equal code, only if you use a slower C++ feature (which you aren't forced to).

 

Thats not all, C++ has a more strick type check and some types on C wont compile on C++. and when i say speed i mean at low level of course, since thats mostly the main use of C now days. 

 

More strict type checking, yes. But those things are very quick to solve and mostly occur on poorly-written code, which is why almost everyone says C is essentially a subset of C++. I hope we agree on that because it not only makes sense, but it's the generally held opinion (the quote I posted is from the guy who invented C++).

The fact stands that whoever knows C++, knows C.

I know what you meant by speed. But a good C++ compiler will compile well written C code to be as fast as generated by a C compiler. There's no reason for C++ to be necessarily slower than C other than a lower-quality compiler or using non-C features.

 



My Mario Kart Wii friend code: 2707-1866-0957

Java is a good starter language, and yes you can learn it from one of those intro books. I would avoid C/C++ as your first language since memory management and pointers can be complicated for beginners.



The only teeth strong enough to eat other teeth.

NJ5 said:
radha said:
NJ5 said:

I said essentially a subset. There are g>very few things which work in C but not C++, and they're all small details which can be converted in one second. Those differences are not relevant for this thread, they're slight nitpicks as you can read here:

http://www.research.att.com/~bs/bs_faq.html#C-is-subset

Thus, C++ is as much a superset of ANSI C as ANSI C is a superset of K&R C and much as ISO C++ is a superset of C++ as it existed in 1985. Well written C tends to be legal C++ also.

You mentioned structures. C's structures are also supported in C++, in fact a class is just a souped-up structure which allows to use the public/private/protected keywords.

You mentioned speed. C++ is not slower than C with equal code, only if you use a slower C++ feature (which you aren't forced to).

 

Thats not all, C++ has a more strick type check and some types on C wont compile on C++. and when i say speed i mean at low level of course, since thats mostly the main use of C now days. 

 

More strict type checking, yes. But those things are very quick to solve and mostly occur on poorly-written code, which is why almost everyone says C is essentially a subset of C++. I hope we agree on that because it not only makes sense, but it's the generally held opinion (the quote I posted is from the guy who invented C++).

The fact stands that whoever knows C++, knows C.

I know what you meant by speed. But a good C++ compiler will compile well written C code to be as fast as generated by a C compiler. There's no reason for C++ to be necessarily slower than C other than a lower-quality compiler or using non-C features.

 

ok this is what i have been trying to say: from the compiler point of view it is a subset, because is compatible on a c++ compiler, but to someone learning is not true, he will get confused.  i dont think that someone that knows c++ knows c, different memory allocation, different use of strings, etc. I want to see some beginner that only knows C++ Compaling in a C compiler.

 



dd if = /dev/brain | tail -f | grep games | nc -lnvvp 80

Hey Listen!

https://archive.org/details/kohina_radio_music_collection

Ah, the good ol' language wars :)

Strongly typed dynamic languages rule! Duck typing FTW!

Seriously, OP, start reading about objects and algorithms. Then any high-level language (Java, C#, PHP, Python, Ruby in order of enterprise utilization) will do as a start.



"All you need in life is ignorance and confidence; then success is sure." - Mark Twain

"..." - Gordon Freeman

Around the Network
radha said:

ok this is what i have been trying to say: from the compiler point of view it is a subset, because is compatible on a c++ compiler, but to someone learning is not true, he will get confused.  i dont think that someone that knows c++ knows c, different memory allocation, different use of strings, etc. I want to see some beginner that only knows C++ Compaling in a C compiler.

 

This all started when Rpruett said that C is cryptic when compared to C++. I very much disagree with that, and I explained why.

Of course it's possible to write cryptic C code, but that doesn't happen due to the language itself which is a part of C++ (with very rare exceptions which don't make it more cryptic anyway). To say C is cryptic and C++ isn't doesn't make sense, that's all I said.

 



My Mario Kart Wii friend code: 2707-1866-0957

NJ5 said:
radha said:

ok this is what i have been trying to say: from the compiler point of view it is a subset, because is compatible on a c++ compiler, but to someone learning is not true, he will get confused.  i dont think that someone that knows c++ knows c, different memory allocation, different use of strings, etc. I want to see some beginner that only knows C++ Compaling in a C compiler.

 

This all started when Rpruett said that C is cryptic when compared to C++. I very much disagree with that, and I explained why.

Of course it's possible to write cryptic C code, but that doesn't happen due to the language itself which is a part of C++ (with very rare exceptions which don't make it more cryptic anyway). To say C is cryptic and C++ isn't doesn't make sense, that's all I said.

 

i agree on that

 



dd if = /dev/brain | tail -f | grep games | nc -lnvvp 80

Hey Listen!

https://archive.org/details/kohina_radio_music_collection

WereKitten said:
786_ali said:
Words Of Wisdom said:

I recommend going and taking a very cold shower every time you have the urge to learn to program.

Repeat until said urges go away.

If there was nobody who knew programming then there would be no internet and no computers or tv's or for that matter, virtually no electronics.

 

Uhm, to tell the truth tv predates computers, as do most electronic elements.


The Babylonians would disagree with that.



SamuelRSmith said:
WereKitten said:
786_ali said:
Words Of Wisdom said:

I recommend going and taking a very cold shower every time you have the urge to learn to program.

Repeat until said urges go away.

If there was nobody who knew programming then there would be no internet and no computers or tv's or for that matter, virtually no electronics.

 

Uhm, to tell the truth tv predates computers, as do most electronic elements.


The Babylonians would disagree with that.

 

electrical =/= electronic



dd if = /dev/brain | tail -f | grep games | nc -lnvvp 80

Hey Listen!

https://archive.org/details/kohina_radio_music_collection

@SamuelRSmith

Yeah, yeah :) computers as in general-purpose, programmable computing machines.
Babbage's engine was never built, after all. Satisfied, Mr Nitpick? :)



"All you need in life is ignorance and confidence; then success is sure." - Mark Twain

"..." - Gordon Freeman