|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
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. |
||||||||||||||||||||||||
| ^ | Joined: 18 Mar 2006 Member: #102023 Location: Plymouth, UK | |||||||||||||||||||||||
|
||||||||||||||||||||||||
C isn't really worth the trouble unless you're targeting micro-controllers. |
||||||||||||||||||||||||
| ^ | Joined: 11 Feb 2006 Member: #97939 Location: Helsinki, Finland | |||||||||||||||||||||||
|
||||||||||||||||||||||||
mystran wrote: C isn't really worth the trouble unless you're targeting micro-controllers.
avrgcc supports some C++ features ;] ---- It doesn't matter how it sounds.. ..as long as it has BASS and it's LOUD! |
||||||||||||||||||||||||
| ^ | Joined: 04 Sep 2006 Member: #118997 Location: 127.0.0.1 | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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. |
||||||||||||||||||||||||
| ^ | Joined: 28 Jan 2004 Member: #12072 Location: Nha Trang, Vietnam | |||||||||||||||||||||||
|
||||||||||||||||||||||||
Thanks everyone so far, especially those with actual opinions rather than silent votes 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.
Any good links/references wrt C++11 ? |
||||||||||||||||||||||||
| ^ | Joined: 18 Mar 2006 Member: #102023 Location: Plymouth, UK | |||||||||||||||||||||||
|
||||||||||||||||||||||||
There were a bunch of interesting talks on C++11 at the Going Native conference this year:
http://channel9.msdn.com/Events/GoingNative/GoingNative-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. |
||||||||||||||||||||||||
| ^ | Joined: 28 Jan 2004 Member: #12072 Location: Nha Trang, Vietnam | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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 |
||||||||||||||||||||||||
| ^ | Joined: 28 Feb 2011 Member: #251491 | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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.
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. 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. |
||||||||||||||||||||||||
| ^ | Joined: 18 Mar 2006 Member: #102023 Location: Plymouth, UK | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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/windows/hartverdrahtet-i nfinite-complexity-in-4096-bytes/ |
||||||||||||||||||||||||
| ^ | Joined: 28 Jan 2004 Member: #12072 Location: Nha Trang, Vietnam | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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. Oh, absolutely - I don't intend to switch careers... just need a creative break. kuniklo wrote: If you want some inspiration check out what this guy did in 4k of code!
http://www.creativeapplications.net/windows/hartverdrahtet-i nfinite-complexity-in-4096-bytes/ 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 here |
||||||||||||||||||||||||
| ^ | Joined: 18 Mar 2006 Member: #102023 Location: Plymouth, UK | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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. ---- Best regards, TiUser ...and keep on jamming... |
||||||||||||||||||||||||
| ^ | Joined: 13 Apr 2008 Member: #178325 Location: Germany | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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. |
||||||||||||||||||||||||
| ^ | Joined: 10 Oct 2005 Member: #83902 Location: Toronto, Canada | |||||||||||||||||||||||
|
||||||||||||||||||||||||
kuniklo wrote: C++ is a complex and messy language and there are still legitimate reasons to choose C in some cases.
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. 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. |
||||||||||||||||||||||||
| ^ | Joined: 07 Jan 2009 Member: #197745 Location: Gloucestershire | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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! |
||||||||||||||||||||||||
| ^ | Joined: 10 Oct 2005 Member: #83902 Location: Toronto, Canada | |||||||||||||||||||||||
|
||||||||||||||||||||||||
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. |
||||||||||||||||||||||||
| ^ | Joined: 18 Mar 2006 Member: #102023 Location: Plymouth, UK | |||||||||||||||||||||||
| KVR Forum Index » DSP and Plug-in Development | All times are GMT - 8 Hours |
|
Printable version |
Disclaimer: All communications made available as part of this forum and any opinions, advice, statements, views or other information expressed in this forum are solely provided by, and the responsibility of, the person posting such communication and not of kvraudio.com (unless kvraudio.com is specifically identified as the author of the communication).
Powered by phpBB © phpBB Group


















