Actually, The language I understand best is c++ , but im still a beginner (from a 1-10 scale i would say im 2-3).
I will start making a pawn chess engine tomorrow, today i plan how to make it.
I like c++ , I remember two years ago, when i was 11 I learned HTML and a friend of mine said that c++ is one of the most used languages.
BTW, c++ was made by a dane (Bjarne Stroustrup)
Regards
Ethan
c vs c++
Moderator: Ras
-
rbarreira
- Posts: 900
- Joined: Tue Apr 27, 2010 3:48 pm
Re: c vs c++
The Apple one is the most important one which doesn't run Java, but it's not the only one I believe.SuneF wrote:You must be referring to Apple platform? If so you are out of luck with C too, it's call Objective-C and is something different entirely. Of course if you jail-break it works. It's more of a business decision than a limitation of the Java language. Apple wants to fight everyone for some reason.rbarreira wrote:My point is that Java is not as portable as C/C++, that simple. If you have a Java program and want to get it running across several kinds of mobile phones (a quite important platform these days), you're out of luck.SuneF wrote:Yes Java is extremly portable, that was also one of its key design goals.rbarreira wrote:Java which doesn't even run on all mobile platforms (last I checked, due to licensing reasons), is that what you call a portable language?SuneF wrote: If you stick to just ansi C it is fairly portable but still in need of special native assemblies as opposed to eg Java. Once you begin with threads or anything requirering 3rd party libs it gets messy.
Nothing is portable to ALL platforms, so not sure what your point is.
Windows Mobile and Android supports Java just fine of course, Android _is_ java.
Objective-C is a superset of C, so no portability worries there. And you can run C++ on the iPhone too...
-
SuneF
- Posts: 127
- Joined: Thu Sep 17, 2009 11:19 am
Re: c vs c++
Good luck, C++ is not a bad place to start - OOP is fun!ethanara wrote:Actually, The language I understand best is c++ , but im still a beginner (from a 1-10 scale i would say im 2-3).
I will start making a pawn chess engine tomorrow, today i plan how to make it.
Yes and C# was also invented by a dane, Anders Hejlsbjerg. You can catch some great lectures by him on channel 9, eg. this one:I like c++ , I remember two years ago, when i was 11 I learned HTML and a friend of mine said that c++ is one of the most used languages.
BTW, c++ was made by a dane (Bjarne Stroustrup)
Regards
Ethan
http://channel9.msdn.com/Blogs/matthijs ... -Hejlsberg
He goes crazy near the end.. trying coding that in C!
-
SuneF
- Posts: 127
- Joined: Thu Sep 17, 2009 11:19 am
Re: c vs c++
Ah well I have an Android, HTC Incredible S - which is far superior to iPhone 4 of courserbarreira wrote:The Apple one is the most important one which doesn't run Java, but it's not the only one I believe.SuneF wrote:You must be referring to Apple platform? If so you are out of luck with C too, it's call Objective-C and is something different entirely. Of course if you jail-break it works. It's more of a business decision than a limitation of the Java language. Apple wants to fight everyone for some reason.rbarreira wrote:My point is that Java is not as portable as C/C++, that simple. If you have a Java program and want to get it running across several kinds of mobile phones (a quite important platform these days), you're out of luck.SuneF wrote:Yes Java is extremly portable, that was also one of its key design goals.rbarreira wrote:Java which doesn't even run on all mobile platforms (last I checked, due to licensing reasons), is that what you call a portable language?SuneF wrote: If you stick to just ansi C it is fairly portable but still in need of special native assemblies as opposed to eg Java. Once you begin with threads or anything requirering 3rd party libs it gets messy.
Nothing is portable to ALL platforms, so not sure what your point is.
Windows Mobile and Android supports Java just fine of course, Android _is_ java.
Objective-C is a superset of C, so no portability worries there. And you can run C++ on the iPhone too...
But I seriously doubt you can compile that C-code with all it's 3rd party libraries to Objective-C without any problems. A java machine or .Net runtime would solve all those problems.
-
rbarreira
- Posts: 900
- Joined: Tue Apr 27, 2010 3:48 pm
Re: c vs c++
The only reason you doubt it is that you don't know the fact that an Objective-C compiler can compile any legal C code, that's the way Objective-C is designed. It's OK not to know things, it's not so OK to keep repeating wrong information which can easily be checked to be wrong...SuneF wrote:Ah well I have an Android, HTC Incredible S - which is far superior to iPhone 4 of courserbarreira wrote:The Apple one is the most important one which doesn't run Java, but it's not the only one I believe.SuneF wrote:You must be referring to Apple platform? If so you are out of luck with C too, it's call Objective-C and is something different entirely. Of course if you jail-break it works. It's more of a business decision than a limitation of the Java language. Apple wants to fight everyone for some reason.rbarreira wrote:My point is that Java is not as portable as C/C++, that simple. If you have a Java program and want to get it running across several kinds of mobile phones (a quite important platform these days), you're out of luck.SuneF wrote:Yes Java is extremly portable, that was also one of its key design goals.rbarreira wrote:Java which doesn't even run on all mobile platforms (last I checked, due to licensing reasons), is that what you call a portable language?SuneF wrote: If you stick to just ansi C it is fairly portable but still in need of special native assemblies as opposed to eg Java. Once you begin with threads or anything requirering 3rd party libs it gets messy.
Nothing is portable to ALL platforms, so not sure what your point is.
Windows Mobile and Android supports Java just fine of course, Android _is_ java.
Objective-C is a superset of C, so no portability worries there. And you can run C++ on the iPhone too...![]()
But I seriously doubt you can compile that C-code with all it's 3rd party libraries to Objective-C without any problems. A java machine or .Net runtime would solve all those problems.
-
SuneF
- Posts: 127
- Joined: Thu Sep 17, 2009 11:19 am
Re: c vs c++
Please point out one single thing I said that was wrong. C has never given me anything but a world of pain whenever I tried to port stuff back and forth between windows and linux. The threads didn't work the same, the headers weren't called the same, the timers were broken, I needed macros scattered all over the code to get something to work half decent. Been there done that and if this is what you call portability then you haven't got a clue what the word means.rbarreira wrote:The only reason you doubt it is that you don't know the fact that an Objective-C compiler can compile any legal C code, that's the way Objective-C is designed. It's OK not to know things, it's not so OK to keep repeating wrong information which can easily be checked to be wrong...SuneF wrote:Ah well I have an Android, HTC Incredible S - which is far superior to iPhone 4 of courserbarreira wrote:The Apple one is the most important one which doesn't run Java, but it's not the only one I believe.SuneF wrote:You must be referring to Apple platform? If so you are out of luck with C too, it's call Objective-C and is something different entirely. Of course if you jail-break it works. It's more of a business decision than a limitation of the Java language. Apple wants to fight everyone for some reason.rbarreira wrote:My point is that Java is not as portable as C/C++, that simple. If you have a Java program and want to get it running across several kinds of mobile phones (a quite important platform these days), you're out of luck.SuneF wrote:Yes Java is extremly portable, that was also one of its key design goals.rbarreira wrote:Java which doesn't even run on all mobile platforms (last I checked, due to licensing reasons), is that what you call a portable language?SuneF wrote: If you stick to just ansi C it is fairly portable but still in need of special native assemblies as opposed to eg Java. Once you begin with threads or anything requirering 3rd party libs it gets messy.
Nothing is portable to ALL platforms, so not sure what your point is.
Windows Mobile and Android supports Java just fine of course, Android _is_ java.
Objective-C is a superset of C, so no portability worries there. And you can run C++ on the iPhone too...![]()
But I seriously doubt you can compile that C-code with all it's 3rd party libraries to Objective-C without any problems. A java machine or .Net runtime would solve all those problems.
So chill Einstein, don't try and lecture me, you ain't got the skills.
-
rbarreira
- Posts: 900
- Joined: Tue Apr 27, 2010 3:48 pm
Re: c vs c++
I don't see why I should point it out again, just read earlier posts.SuneF wrote:Please point out one single thing I said that was wrong. C has never given me anything but a world of pain whenever I tried to port stuff back and forth between windows and linux. The threads didn't work the same, the headers weren't called the same, the timers were broken, I needed macros scattered all over the code to get something to work half decent. Been there done that and if this is what you call portability then you haven't got a clue what the word means.rbarreira wrote:The only reason you doubt it is that you don't know the fact that an Objective-C compiler can compile any legal C code, that's the way Objective-C is designed. It's OK not to know things, it's not so OK to keep repeating wrong information which can easily be checked to be wrong...SuneF wrote:Ah well I have an Android, HTC Incredible S - which is far superior to iPhone 4 of courserbarreira wrote:The Apple one is the most important one which doesn't run Java, but it's not the only one I believe.SuneF wrote:You must be referring to Apple platform? If so you are out of luck with C too, it's call Objective-C and is something different entirely. Of course if you jail-break it works. It's more of a business decision than a limitation of the Java language. Apple wants to fight everyone for some reason.rbarreira wrote:My point is that Java is not as portable as C/C++, that simple. If you have a Java program and want to get it running across several kinds of mobile phones (a quite important platform these days), you're out of luck.SuneF wrote:Yes Java is extremly portable, that was also one of its key design goals.rbarreira wrote:Java which doesn't even run on all mobile platforms (last I checked, due to licensing reasons), is that what you call a portable language?SuneF wrote: If you stick to just ansi C it is fairly portable but still in need of special native assemblies as opposed to eg Java. Once you begin with threads or anything requirering 3rd party libs it gets messy.
Nothing is portable to ALL platforms, so not sure what your point is.
Windows Mobile and Android supports Java just fine of course, Android _is_ java.
Objective-C is a superset of C, so no portability worries there. And you can run C++ on the iPhone too...![]()
But I seriously doubt you can compile that C-code with all it's 3rd party libraries to Objective-C without any problems. A java machine or .Net runtime would solve all those problems.
So chill Einstein, don't try and lecture me, you ain't got the skills.
Sure, you have to adapt some of the code which deals with system-specific stuff, but C itself is portable. The real joke is when you start mixing C# into a discussion of portability and ignoring the fact that Java does not run at all on some important platforms.
-
Don
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: c vs c++
Yes, and it's designed to be more portable than even C. It has multi-processing support also which makes it even more portable.Ron Murawski wrote:The GDC front end for GCC is being maintained once againrbarreira wrote: Where did you read about GCC including a D compiler soon? AFAIK it had one but it was not maintained in a while.
https://bitbucket.org/goshawk/gdc/wiki/Home
https://bitbucket.org/goshawk/gdc/downloads (download)
Ron
If I can get within about 5-7% of the speed of GCC I am going to switch over. It may already be there but I have not tested it with a substantial chess-like benchmark in a long time. What is gained will offset a small slowdown - and I would be betting on the future because I think it will end up faster than C once it is integrated into GCC and gets more attention. It's very actively developed.
-
SuneF
- Posts: 127
- Joined: Thu Sep 17, 2009 11:19 am
Re: c vs c++
You're being very vague, specifics is what I ask for.rbarreira wrote: I don't see why I should point it out again, just read earlier posts.
Sure, you have to adapt some of the code which deals with system-specific stuff, but C itself is portable. The real joke is when you start mixing C# into a discussion of portability and ignoring the fact that Java does not run at all on some important platforms.
You want Java on your iPhone, here:
http://iphoneroot.com/tutorial-install- ... he-iphone/
C# is like Java, only more advanced but sadly not quite as portable in practice.
Though like java it has an asp.net equivalent and that is taking into a hole new dimension that C/C++ can't take you. The possibilities are endless
-
Don
- Posts: 5106
- Joined: Tue Apr 29, 2008 4:27 pm
Re: c vs c++
For chess, Java is a poor choice if you want performance. It does not have the low level support you need. It's also a memory pig but there may be ways to work around that. For many types of applications it is not much slower than C or C++ but for the low level bit-twiddling attention to detail and memory management you need for a really high performance chess program, it's a terrible choice.
If you want a pretty good chess program (but not great program) that is portable, then it's probably a reasonable choice.
I honestly don't think C is that portable. It you stick with some specific dialect of C such as ansii C it is portable, but in a real world program you cannot do that. You still have to deal with platform differences in the real world.
My code is peppered with #ifdef's to deal with difference between compilers and platforms and it's annoying.
My experience is that Java really is much more portable. I do not know if this applies to the hand-held devices which use subsets or variations of java.
If you want a pretty good chess program (but not great program) that is portable, then it's probably a reasonable choice.
I honestly don't think C is that portable. It you stick with some specific dialect of C such as ansii C it is portable, but in a real world program you cannot do that. You still have to deal with platform differences in the real world.
My code is peppered with #ifdef's to deal with difference between compilers and platforms and it's annoying.
My experience is that Java really is much more portable. I do not know if this applies to the hand-held devices which use subsets or variations of java.
SuneF wrote:You're being very vague, specifics is what I ask for.rbarreira wrote: I don't see why I should point it out again, just read earlier posts.
Sure, you have to adapt some of the code which deals with system-specific stuff, but C itself is portable. The real joke is when you start mixing C# into a discussion of portability and ignoring the fact that Java does not run at all on some important platforms.
You want Java on your iPhone, here:
http://iphoneroot.com/tutorial-install- ... he-iphone/
C# is like Java, only more advanced but sadly not quite as portable in practice.
Though like java it has an asp.net equivalent and that is taking into a hole new dimension that C/C++ can't take you. The possibilities are endless