Which should I relearn
- KVRAF
- 2673 posts since 18 Mar, 2006 from The Void
Okay, so not quite the usual question - this is definitely not 'how do I learn programming'.
I picked up C & C++ around 1990, during my Computer Science HND, but I've spent the last 15+ years writing Java (with some Python here and there), and have hardly ever even looked at C code, to the extent that I don't really recognise it any more.
I want to get back into OpenGL code, and also do some VST/audio programming, and am currently deciding which I should pickup.
There is also a potential career path by adding a more system-level language to my skillset again rather than the enterprise-level Java client/server I know so well.
I'm looking for experienced, wise, aged practitioners who are well-versed in both C and C++ (on their individual strengths, not writing one in the style of the other) to offer advice and suggestions as to which, and why.
Development will be cross platform (Code::Blocks is excellent) and whilst libraries will be hooked into, I won't be looking for anything along the lines of the MFC (or whatever).
Anyway, please offer all thoughts on this, and apologies to a few for not including Pascal as an option...
Thanks.
I picked up C & C++ around 1990, during my Computer Science HND, but I've spent the last 15+ years writing Java (with some Python here and there), and have hardly ever even looked at C code, to the extent that I don't really recognise it any more.
I want to get back into OpenGL code, and also do some VST/audio programming, and am currently deciding which I should pickup.
There is also a potential career path by adding a more system-level language to my skillset again rather than the enterprise-level Java client/server I know so well.
I'm looking for experienced, wise, aged practitioners who are well-versed in both C and C++ (on their individual strengths, not writing one in the style of the other) to offer advice and suggestions as to which, and why.
Development will be cross platform (Code::Blocks is excellent) and whilst libraries will be hooked into, I won't be looking for anything along the lines of the MFC (or whatever).
Anyway, please offer all thoughts on this, and apologies to a few for not including Pascal as an option...
Thanks.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
C isn't really worth the trouble unless you're targeting micro-controllers.
- KVRAF
- 2569 posts since 4 Sep, 2006 from 127.0.0.1
avrgcc supports some C++ features ;]mystran wrote:C isn't really worth the trouble unless you're targeting micro-controllers.
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!
irc.libera.chat >>> #kvr
..as long as it has BASS and it's LOUD!
irc.libera.chat >>> #kvr
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
C++ is a complex and messy language and there are still legitimate reasons to choose C in some cases.
However, if your main interest is graphics and audio programming I think you're better off with C++. Most of the libraries and sample code and APIs in that world are in C++. I've toyed with the idea of writing some of my audio & OpenGL code in pure C but every time I really think about what it would entail it just doesn't seem worth it.
The good news is that the new C++11 standard makes coding in C++ quite a bit more pleasant and compiler support for C++ on both Mac and Windows seems to have improved a lot in the last year.
However, if your main interest is graphics and audio programming I think you're better off with C++. Most of the libraries and sample code and APIs in that world are in C++. I've toyed with the idea of writing some of my audio & OpenGL code in pure C but every time I really think about what it would entail it just doesn't seem worth it.
The good news is that the new C++11 standard makes coding in C++ quite a bit more pleasant and compiler support for C++ on both Mac and Windows seems to have improved a lot in the last year.
- KVRAF
- Topic Starter
- 2673 posts since 18 Mar, 2006 from The Void
Thanks everyone so far, especially those with actual opinions rather than silent votes
Any good links/references wrt C++11 ?kuniklo wrote:The good news is that the new C++11 standard makes coding in C++ quite a bit more pleasant and compiler support for C++ on both Mac and Windows seems to have improved a lot in the last year.
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
There were a bunch of interesting talks on C++11 at the Going Native conference this year:
http://channel9.msdn.com/Events/GoingNa ... ative-2012
Herb Sutter in particular is good at explaining the changes and the benefits.
As far as I know there aren't any good books out on C++11 yet but if you're willing to plunk down a little cash then Scott Meyers overview is probably a good investment:
http://www.artima.com/shop/overview_of_the_new_cpp
It's targeted at experienced C++ devs though. The problem with getting back into C++ right now is that a lot of the advice in older C++ books is actually *wrong* if you're writing C++11. If you're comfortable with Java it shouldn't be too much of a leap though.
http://channel9.msdn.com/Events/GoingNa ... ative-2012
Herb Sutter in particular is good at explaining the changes and the benefits.
As far as I know there aren't any good books out on C++11 yet but if you're willing to plunk down a little cash then Scott Meyers overview is probably a good investment:
http://www.artima.com/shop/overview_of_the_new_cpp
It's targeted at experienced C++ devs though. The problem with getting back into C++ right now is that a lot of the advice in older C++ books is actually *wrong* if you're writing C++11. If you're comfortable with Java it shouldn't be too much of a leap though.
-
- KVRian
- 623 posts since 28 Feb, 2011 from Sweden
I just agree with the aboves, for graphics and sound (vst, au etc) processing c++ is the way to go. First of all the API's are c++ but then being without the ability to do some object orientation is painful, and I can imaging especially for an old Java-programmer that has it in the spine.
David Guda gudaaudio.com
- KVRAF
- Topic Starter
- 2673 posts since 18 Mar, 2006 from The Void
heh - I must admit that I struggle thinking without objects these days, but then part of this is wanting to simplify away from object unless really necessary - I think it's gone far too much the way of OOP and 'frameworks' these days, and I'm wanting some good old-school coding.davidguda wrote:but then being without the ability to do some object orientation is painful, and I can imaging especially for an old Java-programmer that has it in the spine.
I do really appreciate the sentiment though, and it's something I'm really struggling with. But then, if I want an 'easy life', I can just stick with Java, which is so nice (outside of passing methods by reference).
I've also thought briefly about getting more heavily into Python, which allows far more native integration with ctypes (I think ?!) yet doesn't have quite the struggle of C/C++ for me, as I find it very elegant to write (I know that varies for people).
...
I suppose I'm wanting to recapture the enjoyable coding I used to have when I was younger (yes, I am mid-life, but it's not that sort of crisis) rather than the corporate enterprise junk I get to write for a living.
-
- KVRAF
- 2875 posts since 28 Jan, 2004 from Da Nang, Vietnam
Programming business software WILL gradually bleed your soul dry, day after day.
As you can probably imagine though, there's a *lot* less money in audio software.
If you want some inspiration check out what this guy did in 4k of code!
http://www.creativeapplications.net/win ... 096-bytes/
As you can probably imagine though, there's a *lot* less money in audio software.
If you want some inspiration check out what this guy did in 4k of code!
http://www.creativeapplications.net/win ... 096-bytes/
- KVRAF
- Topic Starter
- 2673 posts since 18 Mar, 2006 from The Void
Oh, absolutely - I don't intend to switch careers... just need a creative break.kuniklo wrote:Programming business software WILL gradually bleed your soul dry, day after day.
As you can probably imagine though, there's a *lot* less money in audio software.
Thanks ! I watch a lot of the demoscene, and play with lwjgl/libdgx quite a bit, but hadn't come across this. I am working, with a friend, on some procedually generated stuff (not so much fractals at the moment, but we do work with that) and it helps a lot. I don't tend to try for the limited demos, as while they're very impressive I'm quite happy to use my RAM herekuniklo wrote:If you want some inspiration check out what this guy did in 4k of code!
http://www.creativeapplications.net/win ... 096-bytes/
-
- KVRAF
- 2310 posts since 13 Apr, 2008 from Germany
To me the logical successor to C++ is C#.
It's probably not x-platform but you can can code quite low level too if you really need to.
Using libs is another story that is not necessarily a language question. Usually learning all the libs takes much longer than understanding a language.
I personally have coded in Delphi, C, C++ and some other fancy special languages but since I've looked into C# I don't feel I want to go back. I was in doubt about speed in C# as I've written midi processing with it. But it is a non issue to throw tons of small objects around... When it comes to gui stuff things get slower.
If OO is the coding model for everything strongly depends on what you're doing but for many things OO is simply hard to beat when it comes to more complex structures. With C# you can code endless systems which are unbelivably stable compared to what you can do in C++ or C with a similar effort.
Maybe I missed the O.P.s needs but that's my opinion here.
It's probably not x-platform but you can can code quite low level too if you really need to.
Using libs is another story that is not necessarily a language question. Usually learning all the libs takes much longer than understanding a language.
I personally have coded in Delphi, C, C++ and some other fancy special languages but since I've looked into C# I don't feel I want to go back. I was in doubt about speed in C# as I've written midi processing with it. But it is a non issue to throw tons of small objects around... When it comes to gui stuff things get slower.
If OO is the coding model for everything strongly depends on what you're doing but for many things OO is simply hard to beat when it comes to more complex structures. With C# you can code endless systems which are unbelivably stable compared to what you can do in C++ or C with a similar effort.
Maybe I missed the O.P.s needs but that's my opinion here.
Best regards, TiUser
...and keep on jamming...
...and keep on jamming...
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
Seeing how C is a subset of C++, there's really only one answer as if you know C++ you inherently already know C.
So what you're asking is should I put blinders on an limit myself to a narrow focus, or should I learn the whole thing?
You're going to have trouble working with any plug-in APIs if you're allergic to C++. But with some rudimentary knowledge of C++ you'll be able to fill in the various API methods with regular C code, if that's what you like. At the very least you'll need to understand what classes and members are so you know where to declare your variables.
But I often write my process functions as straight-C. Just so I know they're as efficient as possible. I don't even like to have any function calls inside my sample loop. I try to do it all in-line, whenever manageable. Lots of DSP effects are functionally simple enough that you can safely ignore the benefits of object oriented programming and just do it procedurally. But I still know C++. Most of it anyway, it's kind of one of those things you can keep discovering new aspects of for a long time.
So what you're asking is should I put blinders on an limit myself to a narrow focus, or should I learn the whole thing?
You're going to have trouble working with any plug-in APIs if you're allergic to C++. But with some rudimentary knowledge of C++ you'll be able to fill in the various API methods with regular C code, if that's what you like. At the very least you'll need to understand what classes and members are so you know where to declare your variables.
But I often write my process functions as straight-C. Just so I know they're as efficient as possible. I don't even like to have any function calls inside my sample loop. I try to do it all in-line, whenever manageable. Lots of DSP effects are functionally simple enough that you can safely ignore the benefits of object oriented programming and just do it procedurally. But I still know C++. Most of it anyway, it's kind of one of those things you can keep discovering new aspects of for a long time.
-
- KVRian
- 614 posts since 7 Jan, 2009 from Gloucestershire
Well, C++ doesn't have to be complex and messy, it's just that some programmers love the language more than what they're actually doing with it! I'm sure everybody has seen unreadable C++, where the coder thinks he's oh so clever - well he's not, he's just not doing his job.kuniklo wrote:C++ is a complex and messy language and there are still legitimate reasons to choose C in some cases.
Anyway, I agree with everybody else. Object orientated languages like C++ are perfect for DSP, especially for experiments, where you can have all of DSP functions in neat object FX packages that you can mix around quickly and share with other projects. Each with it's own memory allocations and protected variables, and they can be created and destroyed easily.
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
DaveHoskins wrote: Well, C++ doesn't have to be complex and messy, it's just that some programmers love the language more than what they're actually doing with it!
- KVRAF
- Topic Starter
- 2673 posts since 18 Mar, 2006 from The Void
With the outcome being pretty unanimous from the start, I've decide C++ does make sense, for all the reasons everyone is stating.
I already have a few books (oh, if my wife could talk about how many programming books I own), and have started working through 'Accelerated C++', with 'Effective C++' to follow. I've also ordered a few more including 'The C++ Standard Library' by Nicolai Josuttis (the latest version seems to include C++11) and 'Effective STL' again by Scott Meyers. I've also got my eyes on the range of Herb Sutter books for the future
(Is BAS the literary equivalent of GAS ?)
Admittedly, my first experiments will likely be around OpenGL, but I intend to delve into audio once I feel a bit more confident. I'd like to be able to write a simple app that programatically sends notes/automation to a chosen VST and outputs via ASIO - sort of like SaviHost but with the ability to script a note sequence. Once I reach that point, I think I'm safe to jump off in all sorts of directions.
I may look at QT for cross-platform interface, or JUCE for something a bit more focused. I don't know.
Feel free to keep C++ advice coming in, as I'm taking notes and doing my best to avoid bad practices, and thanks again for all the thoughts.
I already have a few books (oh, if my wife could talk about how many programming books I own), and have started working through 'Accelerated C++', with 'Effective C++' to follow. I've also ordered a few more including 'The C++ Standard Library' by Nicolai Josuttis (the latest version seems to include C++11) and 'Effective STL' again by Scott Meyers. I've also got my eyes on the range of Herb Sutter books for the future
(Is BAS the literary equivalent of GAS ?)
Admittedly, my first experiments will likely be around OpenGL, but I intend to delve into audio once I feel a bit more confident. I'd like to be able to write a simple app that programatically sends notes/automation to a chosen VST and outputs via ASIO - sort of like SaviHost but with the ability to script a note sequence. Once I reach that point, I think I'm safe to jump off in all sorts of directions.
I may look at QT for cross-platform interface, or JUCE for something a bit more focused. I don't know.
Feel free to keep C++ advice coming in, as I'm taking notes and doing my best to avoid bad practices, and thanks again for all the thoughts.


