Hacker News new | ask | show | jobs
by cageface 5472 days ago
The results seem conclusive: if you're developing software for the desktop, and (like me) you are equally skilled in C# and C++, it's safe to take advantage of the simpler syntax, rich standard libraries, stellar IntelliSense and reduced development effort that C# offers.

With the glaring exception of numeric code, which is the most crucial thing for a lot of apps that are now written in C++. You'd be crazy to write a native CRUD app in C++ now but most of the big C++ apps I can think of do heavy work in numerics (Photoshop, Ableton, Maya, etc).

2 comments

For these the best approach is to write the whole app in some higher-than-C++ level language with performance critical parts (usually less than 10 percent) in C/C++.
That's often a good approach, but sometimes the overhead of marshaling data between the layers can kill you. For instance, Google warns people about assuming the apps written using the Android NDK will be faster, partly because of JNI overhead.
http://www.getpaint.net/

I'm not saying paint.net is a replacement for photoshop. However, for me, it's in the "good enough" category.

http://en.wikipedia.org/wiki/Paint.NET

"Paint.NET is primarily programmed in the C# programming language, with small amounts of C++ used for installation and shell-integration related functions."

Again this is good enough for a lot of peoples image manipulation. That area of "good enough" is getting larger all the time.

Paint.NET is fine for small images, but performance really falls off a cliff when images get larger, whereas Photoshop hardly misses a beat. Which I guess is kind of your point, for doing 'normal' tasks under 'normal' loads C# is fine, but if you have to go beyond normal, then you really need the control and speed of something C-like.
I don't know, to me it seems there's a likely chance that Photoshop's implementation of handling large files is just better, and if Paint.NET took a similar approach maybe the performance might be more comparable. By this I mean stuff like not having to go through the whole file to generate a zoomed view of it, etc. Of course this is just an assumption based on the fact Paint.NET isn't in the same class of application as Photoshop, so I wouldn't expect handling massive files to be a priority to the authors. That and Photoshop has been around a lot longer and Adobe probably has more resources to throw at potential problems like this. Either way, these are just guesses to consider before assuming the difference is caused by the language.
Certainly C++'s niche is getter smaller every year. It just happens to be a niche occupied by the most interesting (IMO) native apps.

The flood of low-powered mobile devices out there seems to have given it some new legs though.