4 ms·
prospero, I have been looking for C++ replacement for desktop programs non-stop for at least 5 years and found nothing. Rubies, lisps and pythons are great in a
by lhorn 18y ago
prospero, I have been looking for C++ replacement for desktop programs non-stop for at least 5 years and found nothing. Rubies, lisps and pythons are great in a little dark corner of server-side development where everything is under your control, but for targeting thousands of varying desktops you just can't take that route since many additional variables come into play: size of downloads, performance, startup times, windows compatibility, etc etc etc. Plus, all VM-based languages suffer from so-so integration into native OS or/and excessive weight. You can write an IDE or an Excel replacement in them, sure, but most desktop software tends to be much smaller.
My last C++ project was a background daemon that would download your RSS feeds and do some fancy parsing. I wish I could show you how much memory Java prototype has eaten vs C++ version processing the same OPML file.
No, C++ is not "essentially worthless" without Boost. In fact I never use all of Boost: your build times becomes #1 conversation topic in the office when you do. It's better to cherry-pick a few important and lightweight pieces (like pointers, any, functional, etc). Don't forget about HUGE selection of plain C libraries too.
Whatever C++ has been used for is still being written and re-written in C++ as we speak. Newer languages and paradigms wiped out the giant Visual Basic army of developers (yes, this is what people used to code "basecamps of the 90s" in, but I don't see these languages threaten C++/C/Obj-C domination for desktop software on Win/Linux/OSX.
In fact, how many native Python or Ruby GUI libraries are out there? I haven't heard of one. Only bindings to GTK/Qt.
With all that said, I will be the first to jump the wagon. If I ever get so lucky.
- prospero 18y agoIf you have a small, well-scoped application, like your RSS daemon, C++ is going to be best of breed in most cases. Similarly, if performance is your absolute primary concern, there's nothing out there that can compete. For most desktop software, though, neither of these things are true. The design and scope of the application are constantly changing, and mostly it just sits there. I write desktop software for a living, including a lot of CPU-intensive graphics stuff, and I'm infinitely grateful that I work in C# rather than C++. It makes me many times more productive, makes my work conceptually cleaner, and makes me a happier person all round. There's a memory cost, to be sure, but it's acceptable, and 90% of the clock cycles are spent in C libraries no matter what, so I don't see much of a downside. My background's in 3D graphics and computational geometry. I've always enjoyed working in C++ on computationally intensive problems, and reducing a problem to its cleanest, fastest implementation. But I think that in the real world, 99% of the time, what really matters are the features, and that the widespread fascination with efficiency is mostly just techno-fetishism.
- kingkongrevenge 18y ago> 90% of the clock cycles are spent in C libraries no matter what, so I don't see much of a downside Which of course raises the question: why C#/Java instead of C++ in conjunction with something like perl or python?
- prospero 18y agoI write Windows applications. C# has Win32 bindings that are vastly superior to anything else out there. There are tools designed to let me leverage these capabilities that are much more polished than the comparable tools for Python, Ruby, or anything else. C# isn't the best language out there, and certainly not the most elegant, but it's been carefully designed by some very smart people, and it shows. At the end of the day, for what I do, it's the best tool available.
- kingkongrevenge 18y agoMy point was more philosophical, I guess. Obviously if you're doing Windows desktop apps you use whatever Visual Studio gives you. I'm just pro-dynamic language. I also like C++ and fail to see Java or C# as sufficiently improved over C++.
- prospero 18y agoI like dynamic languages too, and often wish C# was looser in its typing (or at least less verbose in its typecasting). If it were practical to use Ruby/C to do my job, I probably would. That being said, C# is a huge step above C++, at least with respect to application development. Garbage collection aside, it has first-class functions, well-implemented closures, an integrated query DSL, and decent (if a little awkward) reflection capabilities. It's not an exciting language, and I don't feel particularly cool saying I use it, but I think it gets a pretty bum rap.
- kingkongrevenge 18y agoI'm aware of the feature set, I just don't think it buys you that much over modern C++ (different story six years ago). If you're using boost correctly garbage collection isn't necessary, and higher order stuff is quite doable. I have dealt with Java memory problems several times now and am convinced that garbage collection has no business near performance bottleneck code.