Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
11th December 2008, 01:39 | #1 | Link |
Practising Schemer
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
|
C++ or Java development gains losses
Hi
this is more of a general development question. I am looking to learn a programming language to further my work skills(not video related) but would like to be able to use my new skills with this(video) as a hobby. I just wanted to know if there was any specific reason that most video applications here were developed in C/C++ over Java. Is it a speed or portability issue that is available when using the C/C++ environment or some other reason unknowns to me. All thoughts appreciated. |
11th December 2008, 04:09 | #2 | Link |
Suspended for forum rule violations
Join Date: Jan 2007
Posts: 35
|
Well, both Java and C/C++ can be very portable.
C/C++ can be ported to any operating system depending on how you code it, that is, if you know you want to write with with multiple operating systems in mind, you'll have to keep that in mind when writing it. Java code should* run on any system that supports the Java virtual machine (ie. windows, linux, OSX) with almost no changes to the code or even the compiled executable. This isn't always 100% true, but close. People will say that Java is just as fast as C/C++ (some lunatics will insist it's faster) but the fact is that C/C++ offers you much more control over the application and more room for optimization (it's a lower level language than Java, running closer to the actual computer hardware), and when it comes to just raw data manipulation, C/C++ will be able to do the same things much faster than Java. Because of this Java is technically easier to program, with less work on your part. Speed and control vs simplicity and speed of writing the program are kind of you basic trade offs. If you are new to programming, my suggestion would be to learn C, then once you understand it, learn the additional functions that you get with C++. These languages are much more commonly used in the programming industry and I think you'll go further with the knowledge you gain. Hope this helps. |
11th December 2008, 08:43 | #3 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,405
|
I personally used c++ for sx264 instead of java (which I'm more used to program with and I still want to test 'Qt Jambi') since:
a. I wanted to refresh my c++ programming skills b. the point about the industry more liking C++ Ábudos made is true c. a lot of people kind of 'want/expect' a .exe file under windows (I know there are ways to archive this with java but that always seemed like a hassle to me unless you use a non-Java installer anyway) To learn a new language I would recommend C++ or C# or Java since they are all object oriented and kind of similar (it's not so hard to switch between them). Cu Selur |
11th December 2008, 09:51 | #4 | Link |
Practising Schemer
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
|
Yeah Selur I had noticed yours developed in C++ and that Avidemux was also developed in C++. Satxrip and Megui are using .net framework so that is like C# isn't it. If it is then surely it can't a far stretch from c++.
Abudos I am not quiet game to start in at C, if I start at C++ it shouldn't be to hard to learn C (hopefully), but yeah I do love optimization and I haven't used to many Java based encoders or tools so I think I should start in at C++. |
11th December 2008, 10:23 | #5 | Link |
Suspended for forum rule violations
Join Date: Jan 2007
Posts: 35
|
It's completely backward to try and learn C++ and then C. To lean C after C++, you'd have to un-learn things, whereas going from C to C++ is essentially just adding on a few new tricks. It would be the natural progression of things to first get a good grasp on C, and then learn the differences in C++. A lot of C++ code can be valid C code, but all C code is valid C++ code.
Last edited by Ábudos; 11th December 2008 at 10:27. |
11th December 2008, 12:21 | #6 | Link |
Practising Schemer
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
|
Thats definitely a valid point(a bit of a bugger in some ways - I had planned to put it off til later). Did you teach yourself C from a book/s, if yes could you point me in the direction of the book that helped you most with C. What certification did you get for C/C++ ?
Last edited by flebber; 11th December 2008 at 12:23. |
11th December 2008, 15:48 | #7 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
|
Quote:
BTW: I personally prefer the Delphi way (Delphi 7.0, not Delphi.NET). It's very convenient to created decent GUI's, produces stand-alone EXE's and still can be very low-level. So it's like C++ with native GUI support. It's Bound to Win32/Wine though. There was Kylix for Linux, but I think it never became very popular and has been dropped...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 11th December 2008 at 15:56. |
|
11th December 2008, 21:46 | #8 | Link |
Moderator
Join Date: Oct 2001
Posts: 3,530
|
C++ is a language, .NET is an environment, so this is not a good comparison. Although not commonly done, multiple compiled languages can be used in a single project, and is supported by Visual Studio, Developer Studio, etc. Most languages have ways to declare the language or calling mechanism of externals. One big example is the calling mechanism for Windows itself, it is not the native C/C++ mechanism, but Pascal.
|
11th December 2008, 22:14 | #9 | Link | ||
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
|
Quote:
http://upload.wikimedia.org/wikipedi...rinzip_ext.svg
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 11th December 2008 at 22:46. |
||
12th December 2008, 00:49 | #11 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
|
Quote:
My point was that Delphi doesn't require any additional libraries/toolkits to create a GUI. Instead it comes with native GUI support that deeply integrates into the language and the IDE. A simple standalone Delphi executable can be ~200 KB in size, while the Qt runtime libs alone are 14 MB in size... Also using native controls on each OS makes cross-platform a nightmare! GTK+ and Qt can provide the same Look&Feel on all platfroms, emulating what's not available natively.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 12th December 2008 at 00:51. |
|
12th December 2008, 00:37 | #12 | Link |
Suspended for forum rule violations
Join Date: Jan 2007
Posts: 35
|
If you're considering Java, then it's only logical to also present the .NET environment and all of it's constituent languages.
I've never done much in java, but I know it's very similar to C# which is a language I've used for a few projects. The real debate is managed code vs unmanaged code. Managed being anything .NET (C#, C++/CRL, VB.NET) and Java. The idea behind managed code is that your program doesn't compile into actual machine code (which are the instructions that actually get processed by the CPU) but instead to an intermediate, platform independent pseudo instructions. This byte code is then processed on the fly by the runtime environment and turned into real code for the CPU. The overall advantages of managed code is that if the operating system in question has a working version of the runtime environment, your compiled programs will run. The runtime environment also has a whole plethora of built in functions for you to use, which means you can perform complex tasks with relative ease. This of course comes with the price of speed. Simplicity for speed is a trade off worth making for a lot of simple projects that aren't major data crunchers and performance critical, so it has it's place. Managed languages like C# are also very much GUI native which means making a GUI program in them is very easy. Unmanaged code would be C/C++, Delphi, and Assembler (ASM) to name some popular ones. They give you the most control and overall the best number crunching performance. Assembler is as low level as you can go, and if you know assembler you can actually see a direct correlation between C/C++ code and ASM. C/C++ gives you almost as much control as ASM while expediting the most commonly used aspects and making it easier to read for humans. You can even put ASM code inline with C/C++ code. With C/C++ you have very fine control over the operation of the program, full access to the Win32 API, and can easily import functions from other existing libraries. I recommend C/C++ as the best unmanaged language and C# as the best managed, with unmanaged code being more ideal for video work. If you are interested in C# I still recommend visiting C/C++ first as it is also an easier transition to go from C/C++ to C# then the reverse. Last edited by Ábudos; 12th December 2008 at 00:40. |
12th December 2008, 00:56 | #13 | Link |
Suspended for forum rule violations
Join Date: Jan 2007
Posts: 35
|
wxWidgets and GTK+ are most commonly found in applications that started as under GNU/Linux and were then ported to windows.
You could also always take a GTK+ app and rewrite it to use windows native GDI, it's just a bit of extra work. The great thing about C/C++ is that it can do everything and anything. GUI, CLI, multithreading, you name it. Because of it's simplicity and the fact that nothing is built into the language it's not bound by any limitations. The only cost being that it requires a bit more work to implement complex features, but not necessarily difficult. |
12th December 2008, 03:15 | #14 | Link |
Registered User
Join Date: Sep 2006
Posts: 602
|
As a slight aside, for my hardcore, performance-gobbling stuff, I use C++ (unmanaged). I tend to create things with COM interfaces. I *hate* creating the UI in C++ (WTL) - so time consuming. So I often use VB .NET to create UIs for the C++ COM stuff. You can quickly bang out lightweight apps that way. Heck, sometimes I write DLLs in C++ and use Excel's VBA with them!
|
12th December 2008, 05:56 | #17 | Link | |
Practising Schemer
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
|
Quote:
I should have said a compiler eg visual c++ borland dev-C++ that would suit a beginner but not be limiting as I improve. My concern with the visual studio is managed extensions and well that its a microsoft product(not a fair call) but real to me. Really Visual C++ in managed extensions is a good thing I assume as it gives C++ garbage collection and automated memory management. Stroustrups list http://www.research.att.com/~bs/compilers.html has only compilers known to conform to the standard which he places high value on is there any other considerations i should take into account when choosing.. Last edited by flebber; 12th December 2008 at 06:04. |
|
12th December 2008, 07:14 | #18 | Link |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
Do you want to tinker with video filters? Or write video editing applications?
There is just not enough complexity in most video filters to warrant giving up the control/efficiency you get with C for a higher level language, most of the time goes into tinkering with the algorithm anyway ... not the actual coding. For writing filters I'd go with C with enough of C++ to understand avisynth and do some "simple" template tricks. For anything above the filter level though I don't think C(++) is worth the bother ... use Java, C# or even Python. Even then if you want to interface directly with existing image/video processing code you can't really get away from having to learn C and a little bit of C++ ... Last edited by MfA; 12th December 2008 at 07:19. |
13th December 2008, 09:19 | #19 | Link |
Practising Schemer
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
|
Well I am going to start with C++, I am teaching myself so I got a book by Jesse liberty, Sidhhartha Rao and Bradley Jones. I am going to use the Microsoft Visual C++ environment and see how it goes I guess I can always try Borland or Dev-C++ if its not so good.
|
14th December 2008, 05:11 | #20 | Link |
Suspended for forum rule violations
Join Date: Jan 2007
Posts: 35
|
Microsoft's compiler is the best for Windows, I've had nothing but headache trying to get things like DirectX and other things working in Dev-C++. Save yourself the trouble and stick to Visual C++ on Windows and GCC for Unix OSes.
|
Tags |
c++, development, java |
Thread Tools | Search this Thread |
Display Modes | |
|
|