Good C++ Forum?
Moderator: General Moderators
Re: Good C++ Forum?
"I'm not saying you can't write a portable C++ app, because you can. But C++ was never intended to achieve "write once, run anywhere" portability. Java is the primary language where you can write code and not have to care about the platform on which the code is deployed." - paraphrased from the interwebs
I've done a small amount Visual basic, C++, and Java.. I think they are all good. C++ is more portable if you're targetting "weird" platforms (like trying to program elevator software, or software for a bank ATM). Java is more portable if you're targeting "the main 3 desktop OS" (mac, windows, linux). C++ is a lot faster, that is true as well. But how much time programming will you spend to make your app a little bit faster? It depends on what your app needs to do. For example, if you're writing an email program speed is probably not that important. If you were writing a web server, speed is a lot more important - and that would influence your language decision. Faster is not always better because it comes with more trade offs.
I've done a small amount Visual basic, C++, and Java.. I think they are all good. C++ is more portable if you're targetting "weird" platforms (like trying to program elevator software, or software for a bank ATM). Java is more portable if you're targeting "the main 3 desktop OS" (mac, windows, linux). C++ is a lot faster, that is true as well. But how much time programming will you spend to make your app a little bit faster? It depends on what your app needs to do. For example, if you're writing an email program speed is probably not that important. If you were writing a web server, speed is a lot more important - and that would influence your language decision. Faster is not always better because it comes with more trade offs.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
This is true."I'm not saying you can't write a portable C++ app, because you can. But C++ was never intended to achieve "write once, run anywhere" portability. Java is the primary language where you can write code and not have to care about the platform on which the code is deployed."
Portability isnt' really an issue, IMO. Usually all that is required re-compiling under the target system, which if you don't have, you are at a disadvantage. Although most people have Windows and others can usually be obtained easily enough.
True but faster is always better than slower, if that is the only factor. Java will not expedite your development time when compared to C++ so long as you use the right framework(s) and have the required experience. Pointers are about the only low-level construct that are required to be understood in building C++ applications as compared to Java.For example, if you're writing an email program speed is probably not that important. If you were writing a web server, speed is a lot more important - and that would influence your language decision. Faster is not always better because it comes with more trade offs.
Cheers,
Alex
Re: Good C++ Forum?
First of all its not a matter of opinion, its a matter of fact. Its a fact that the systems will differ, and you're going to have to account for that in your code, frameworks, and programming languages.PCSpectra wrote:Portability isnt' really an issue, IMO. Usually all that is required re-compiling under the target system, which if you don't have, you are at a disadvantage. Although most people have Windows and others can usually be obtained easily enough.
The advice you are giving is inaccurate, java does have pointers. Its one of the fundamental aspects of the language. It also has aspect oriented programming which kicks C++ butt any dayPointers are about the only low-level construct that are required to be understood in building C++ applications as compared to Java.
I would just characterize the differences like this. Java is more programmer oriented. C++ is more machine oriented.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
Yes sir, sorry sir. LOLFirst of all its not a matter of opinion, its a matter of fact. Its a fact that the systems will differ, and you're going to have to account for that in your code, frameworks, and programming languages.
I was trying to be diplomatic in suggesting everyone is entitled an opinion, like bumholes.
Portability is not an issue, if you use the right framework. Qt/wxWidgets/etc provides a unified interface to working with Windows and controls under any platform, just as Java does. The difference being, C++ applications are compiled into a native binary using native OS API but these details are hidden from a client developer (just as Java) handled by the framework using pre-processing conditionals resolved at compile time. Big performance addvantage at no cost to the client developer. Never once when I built a portable app in C++ did I worry about platform specifics. I have no idea what the point is your trying to make.
Well you should probably write Sun/Oracle because as I always understood and the docs seem to suggest (see last bullet point) pointers were a fundemental feature drop behind Java:The advice you are giving is inaccurate, java does have pointers. Its one of the fundamental aspects of the language.
http://java.sun.com/docs/white/langenv/Simple.doc2.html
It's possible that document is outdated and they added pointers to Java, where did you hear of this feature? Can you provide a link/proof to qualify your statement? Pointers and references are not the same thing, which many Java developers seem to confuse, judging by a quick Google.
Alsohttp://javadude.com/articles/passbyvalue.htm wrote:On Pointers versus References...
The problem here is that the folks at Sun made a naming mistake.
In programming language design, a "pointer" is a variable that indirectly tracks the location of some piece of data. The value of a pointer is often the memory address of the data you're interested in. Some languages allow you to manipulate that address; others do not.
A "reference" is an alias to another variable. Any manipulation done to the reference variable directly changes the original variable.
Check out the second sentence of
You can actually abstract/remove much of the problems introduced with pointers by using smart pointers:Java Link Above wrote:You no longer have dangling pointers and trashing of memory because of incorrect pointers, because there are no pointers in Java
http://en.wikipedia.org/wiki/Smart_pointer
This is almost always the case in C++, it's just not a standard practice, as it should be.
You can absolutely do AOP in C++ google it. You may need to add a patch to a compiler or use a compiler that supports AOP, so it requires being tech savvy and knowing how to tweak your compilation tool chain.It also has aspect oriented programming which kicks C++ butt any day
http://www.aspectc.org/
Now that is definetely personal opinion. C++ can be machine oriented or abstracted to no end, which IMO gives C++ a big advantage, allowing to be used to rapidly build enterprise applications or system code.would just characterize the differences like this. Java is more programmer oriented. C++ is more machine oriented.
Cheers,
Alex
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Good C++ Forum?
In terms of performance type, it will be doing a lot of file compression and image manipulation. Most of the work cycle is spent waiting while it runs in the background, so I think that will be of marginal import.
I looked up on the statistics of computers with Java installed, and it looks like about 75% of computers have it. This software will be commercial and probably be used by folks who aren't that good with computers, so they probably wouldn't want to try to figure out how to install Java. The grandma factor comes in to play here. Hey, can you distribute the JVM installer with an application?
It's funny. I had sort of set my heart on C++. But since I don't know much about either C++ or Java, I'm really trying hard to listen to both sides and not to be biased.
Let the discussion roll on!
I looked up on the statistics of computers with Java installed, and it looks like about 75% of computers have it. This software will be commercial and probably be used by folks who aren't that good with computers, so they probably wouldn't want to try to figure out how to install Java. The grandma factor comes in to play here. Hey, can you distribute the JVM installer with an application?
It's funny. I had sort of set my heart on C++. But since I don't know much about either C++ or Java, I'm really trying hard to listen to both sides and not to be biased.
Let the discussion roll on!
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
Probably.Hey, can you distribute the JVM installer with an application?
Why did you have your heart set on C++? I wouldn't stress to much about the decision, both will let you get the job done. In fact, simply because the learning curve is higher in CPP I would suggest going with Java first. If you find the JVM/performance to be an issue, port the application to CPP. Unless this program is going to be hundreds of thousands of lines of code, then the decision on which you choose is more important, obviously.It's funny. I had sort of set my heart on C++. But since I don't know much about either C++ or Java, I'm really trying hard to listen to both sides and not to be biased.
Cheers,
Alex
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Good C++ Forum?
I don't know, just weird irrational brain stuff.PCSpectra wrote:Why did you have your heart set on C++?
That actually sounds like a really good idea.PCSpectra wrote:If you find the JVM/performance to be an issue, port the application to CPP
Another question. If I were to join a major open source software project, which language would be a more valuable asset?
Re: Good C++ Forum?
The percentage of JVM users is of relative un-importance:
C++ frameworks sometimes require additional steps, just like Java. For example ATI's Catalyst Control center won't install until Microsoft .NET is installed. Lots of C++ apps rely on frameworks like this and those apps are equally as convenient to setup as a java app in my opinion. That can be solved in either language with a good installation program. A good installer program will always be native. Even Visual Basic programs used a runtime. "Running natively" doesn't really mean much on a typical modern desktop OS.
@Alex, regarding points vs references I am probably mistaken. I was not aware of the distinction. That just goes to show, C++ is more machine oriented than person oriented. You need to understand lots of low level concepts because the features are available in the language. But those features do give you more control over the machine you're programming, which matters for some people/some types of systems.
Jonah Bro, what I would recommend is setting up some basic scripts in both languages maybe.. try to do some of the stuff you are used to doing with PHP arrays, and see which programming language "feels" more comfortable to program in. If you're not too familiar with other languages, you'll be shocked at how advanced PHP is w/ arrays (or rather, how certain other languages are lacking)
C++ frameworks sometimes require additional steps, just like Java. For example ATI's Catalyst Control center won't install until Microsoft .NET is installed. Lots of C++ apps rely on frameworks like this and those apps are equally as convenient to setup as a java app in my opinion. That can be solved in either language with a good installation program. A good installer program will always be native. Even Visual Basic programs used a runtime. "Running natively" doesn't really mean much on a typical modern desktop OS.
@Alex, regarding points vs references I am probably mistaken. I was not aware of the distinction. That just goes to show, C++ is more machine oriented than person oriented. You need to understand lots of low level concepts because the features are available in the language. But those features do give you more control over the machine you're programming, which matters for some people/some types of systems.
Jonah Bro, what I would recommend is setting up some basic scripts in both languages maybe.. try to do some of the stuff you are used to doing with PHP arrays, and see which programming language "feels" more comfortable to program in. If you're not too familiar with other languages, you'll be shocked at how advanced PHP is w/ arrays (or rather, how certain other languages are lacking)
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Good C++ Forum?
That's a good idea also. What I could do is use that in conjunction with what Alex said. I just may find I'm more comfortable with one or the other. I have written a few lines of Java in the past in Robocode.josh wrote:what I would recommend is setting up some basic scripts in both languages maybe..
Yeah, I'm past that point already... if you asked me what I thought about VB while I was learning it, I probably would have saidjosh wrote:you'll be shocked at how advanced PHP is w/ arrays
Me wrote:"Dude, you don't really appreciate dynamic languages until you find yourself using something else. I mean, pre-defining the size and type of the array? Who came up with that idea? How am I supposed to know how big it's going to be?"
Then I discovered Lists.
Reading The Art of Assembly was a real eye-opener too.
Is it very difficult to make Java use native widgets?
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
LOL I hear ya. Many C/C++ developers have a God complex that stems from the ultimate control and flexibility of the technology. They advertise this to the world and it unfortunately influences some people into thinking C/C++ is the best solution for everything and that simply isn't the case.I don't know, just weird irrational brain stuff.
Java is a full scale enterprise application programming language, so don't be fooled into thinking you will learn it as fast as you did PHP. The learning curve will be less than C/C++ but you will (nature of the beast) limit yourself to some degree in not learning C/C++.
Define asset? What are your goals and/or career objectives? If you intend to work for Google or Microsoft, than C/C++ is a good investment. Do you want to learn a language that will lets you develop system code, device drivers, video games, daemons? In those cases, C/C++ are the obvious winners. If you plan on only ever working in enterprise applications and don't even have the slightest desire to learn more low level programming, than IMO, Java or C++ are equally good investments.Another question. If I were to join a major open source software project, which language would be a more valuable asset?
Another option, which I would recommed to you (knowing more of your background) is possible building these apps as two distinct units of functionality:
1. A simple GUI interface
2. A service/daemon
You can build a Windows version quickly in VB and simply call the service/daemon/CLI.
You can implement the service using PHP and compile it to native binaries for various platforms, possibly using RoadSend or HipHop (Google HipHop):
http://www.roadsend.com/home/index.php?pageID=compiler
The GUI portion of the program merely has to facilitate easy use of the CLI service, with the added benefit of using HTTP/HTML as an interface inthe future.
Alternatively, you could use a variant of visual basic, such as RealBasic:
http://www.realsoftware.com/realstudio/
Something worth giving a quick read:
http://en.wikipedia.org/wiki/Comparison ... nd_C%2B%2B
I thought it wasn't common practice until yesterday, when I read of Swing, the impression I have now, is that it is possible. I have yet to find a Java application however, that doesn't have a Java "feel" to it. Whether it's because of visual cues I am not used to (being a life time Windows user) or possibly the sluggish-ness. I personally tend to stay away from Java applications, with the only exception being Eclipse.Is it very difficult to make Java use native widgets?
p.s-just curious but what are you building, if I may ask? Sounds like a backup/remote storage utility app or media manager?
Cheers,
Alex
Re: Good C++ Forum?
I didn't see any mention of C#, which is the most modern flavor of the C family of languages. Even though I started with C/C++ 8 years ago, today I would recommend people to start with a modern language such as C#, Java or Python. In my opinion you should use C/C++ only if you need to write closer to the metal or are set on a particular library / framework.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
I would personally go with C# over Java, but C# is somewhat Microsoft centric, although I realize you can probably run C# under Linux and Mac today, it still has that M$ stigma. :p
As for using Python to develop desktop Window'ed applications. Is it not a scripting language? Does it have compiler support? Do you need to configure bindings in order to utilize the Windows API? What about the X API? Those API are insane without the assistance of a advanced framework, like Qt, MFC, etc.
Cheers,
Alex
As for using Python to develop desktop Window'ed applications. Is it not a scripting language? Does it have compiler support? Do you need to configure bindings in order to utilize the Windows API? What about the X API? Those API are insane without the assistance of a advanced framework, like Qt, MFC, etc.
Cheers,
Alex
Re: Good C++ Forum?
There are plenty of GUI frameworks for Python - http://wiki.python.org/moin/GuiProgramming
There are even 3D engines for games - http://wiki.python.org/moin/PythonGames
I remember there was a very long discussion on the forums previously on what defines a scripting language
let's just say that python can work as both a scripting language and a compiled one. Python is considered relatively easy to use and get started with, so depending on need it might be a better choice than Java/C/C++/C#
There are even 3D engines for games - http://wiki.python.org/moin/PythonGames
I remember there was a very long discussion on the forums previously on what defines a scripting language
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Good C++ Forum?
Scripting language is vague, I agree. You could in theory build a JavaScript compiler. But, if they are not readily available, then obviously, in being practical, the difference of scripting and compiled come into play.
I have nothing against Python, and to be honest, it's one I have absolutely zero experience in and have not spent a lot of time reading about, other than a brief interest in DJango. It's syntax strikes me as odd, not in a bad way, just not in following the standard set by C. Grouping expressed by tabbed whitespace or something like that? Great idea, eliminates varying standards and makes the code clear and easy to read.
I have often thought the syntax of C/C++ could be improved, so I am possibly cutting myself short by not learning a new syntax, but I digress.
http://en.wikipedia.org/wiki/Python_syn ... _semantics
I like that first paragraph, if it matters any.
Cheers,
Alex
I have nothing against Python, and to be honest, it's one I have absolutely zero experience in and have not spent a lot of time reading about, other than a brief interest in DJango. It's syntax strikes me as odd, not in a bad way, just not in following the standard set by C. Grouping expressed by tabbed whitespace or something like that? Great idea, eliminates varying standards and makes the code clear and easy to read.
I have often thought the syntax of C/C++ could be improved, so I am possibly cutting myself short by not learning a new syntax, but I digress.
http://en.wikipedia.org/wiki/Python_syn ... _semantics
I like that first paragraph, if it matters any.
Cheers,
Alex
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Good C++ Forum?
Totally.PCSpectra wrote:so don't be fooled into thinking you will learn it as fast as you did PHP.
You pretty much answered my questionPCSpectra wrote:Define asset? What are your goals and/or career objectives?
An interesting idea indeed. An second opinions?PCSpectra wrote: Another option, which I would recommed to you (knowing more of your background) is possible building these apps as two distinct units of functionality:
1. A simple GUI interface
2. A service/daemon
Wow, I had no idea that there were PHP "compilers" out there.PCSpectra wrote: You can implement the service using PHP and compile it to native binaries for various platforms, possibly using RoadSend or HipHop (Google HipHop):
The program will extract all picture files from a given external storage device (SD card, camera, etc.; the number of images could range from a dozen to over one-hundred), and present them to the user. The user will then select which images to group, which images to ignore, delete, etc. When the user finishes, all images are compressed and placed into compressed archives (ZIP, Tar, whatever) relative to the way the user grouped them. This application will be targeting a very specific work field.PCSpectra wrote:just curious but what are you building, if I may ask? Sounds like a backup/remote storage utility app or media manager?
I'm pretty farmiliar with Python; I've created a few scripts with it... nothing ever graphical, though I've seen the GUI bindings.pytrin wrote:start with a modern language such as C#, Java or Python
There are Python compilers too!?pytrin wrote:let's just say that python can work as both a scripting language and a compiled one
They practically have. V8 is a JIT compiler, right?PCSpectra wrote:You could in theory build a JavaScript compiler