News for hackers. Stuff that matters.
Re:Ways to Get Better at C++ by dom0 on Friday June 23, 2017 @07:08AM (#14618288)
TBH it sounds like you immersed yourself in the "everything is node or go or rust" HN bubble. C++ is one of the most widely used languages for application development.
Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @07:12AM (#14618312)
> TBH it sounds like you immersed yourself in the "everything is node or go or rust" HN bubble

I find that when someone's made up their mind about me based on little to no data, there's not much point trying to prove them wrong.

> C++ is one of the most widely used languages for application development

What kind of applications?

Re:Ways to Get Better at C++ by joshvm on Friday June 23, 2017 @07:32AM (#14618393)
In terms of application development, cross-platform GUIs are a pain in virtually any other language, ignoring platform specifics like Objective-C or dot net. Ever tried to ship a frozen Python binary? Never again.

It's a little like saying what are some good modern uses for Java? Then you remember that millions of people use Android every day.

I work in computer vision and deal with hardware a lot, both embedded (micros) and 'higher level' (cameras, random optomechanics). You get drivers in C/C++, often dot net, and occasionally other languages. Sometimes you get lucky and someone's written a Python wrapper already, but most of the time it's faster just to use the C++ (otherwise now you have another library to maintain and keep up to date with the vendor - someone else can do that!).

If you work in web development, it's easy to forget that you can't just write a backend in Python and then make it look snazzy with CSS and Javascript. It's one of the few areas where C++ doesn't have much penetration. That said, browsers are written in C++ (Firefox and Chrome, for example) and of course the web servers themselves (plus some C).

The combination of C++ and Python is very powerful. Modern C++ is very easy to read and if you use the STL, you can write surprisingly compact code. I'm also a big fan of Qt for GUI development (plus the other bits you get with it).

Re:Ways to Get Better at C++ by pcwalton on Friday June 23, 2017 @11:19AM (#14619766)
> That said, browsers are written in C++ (Firefox and Chrome, for example)

This is not entirely true anymore for Firefox: it's partially Rust.

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @09:19AM (#14618924)
> It's a little like saying what are some good modern uses for Java? Then you remember that millions of people use Android every day.

Of relevance here, millions (or whatever) of developers need Java every day to build Android applications and all kinds of line-of-business applications all over the world

You can't say the same thing about C++, even if developers build ontop of C++ tools. That is the very point I'm driving towards : not that Cpp isn't an important language or ubiquitous, but that 99% of developers don't have a realistic need for it in 2017.

Yes, it's an important language - but only like 0.1% of developers actually have a good reason to use it.

> If you work in web development

Or mobile development, or game development, or desktop application development - i.e. the vast majority of apps that consumers actually interact with don't require much if any C++ development even if they rely on tools written with C++.

Re:Ways to Get Better at C++ by lossolo on Friday June 23, 2017 @11:10AM (#14619710)
> You can't say the same thing about C++

I think most of what you write is based on your imagination about C++ instead of facts and the facts are different. There are millions of C++ developers on our planet.

Read this:

https://blogs.msdn.microsoft.com/zxue/2016/10/24/how-many-de...

And those are only one IDE (Visual Studio) stats.

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @01:31PM (#14620983)
Yeah that's fair. I've also underestimated the number of Cobol developers out there; C++ devs only slightly outnumber them.
Re:Ways to Get Better at C++ by snovv_crash on Friday June 23, 2017 @08:10PM (#14623686)
You can't reuse your Java code on iOS. C++ can be reused on virtually any platform. The only other language you can do that with is C and interpreted languages with the interpreter written in C/C++ (which is slow if it is cross platform).
Re:Ways to Get Better at C++ by BatFastard on Friday June 23, 2017 @12:56PM (#14620672)
Every time I have to deal with Qt I just want to stab myself in the eye. It is the least intuitive and most difficult environment I personally have ever had to deal with.
Re:Ways to Get Better at C++ by sqeaky on Friday June 23, 2017 @02:30PM (#14621495)
I completely agree with you and its still the best cross platform general purpose GUI library.
Re:Ways to Get Better at C++ by dom0 on Friday June 23, 2017 @07:25AM (#14618365)
> made up their mind

"sounds like" is very much the opposite of that.

> What kind of applications?

All of them, except web pages.

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @08:27AM (#14618633)
> All of them, except web pages.

This is just factually untrue. Mobile, desktop, data analysis, machine learning and even games : neither are primarily developed with C++ these days.

I imagine you're going to respond with snark about how game engines are written with Cpp, or mention some edge case where a CLR / JVM language needs to call out to native libraries - but there's no escaping the fact it's a niche skill set and one of rapidly diminishing importance to the overwhelming majority of developers.

Re:Ways to Get Better at C++ by jhasse on Friday June 23, 2017 @09:08AM (#14618863)
> and even games : neither are primarily developed with C++ these days.

Unreal Engine uses C++, Unity's core is C++. DirectX is a C++ API.

Install any game on Steam and you'll see the Visual C++ runtime being installed most of the time.

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @09:15AM (#14618909)
> I imagine you're going to respond with snark about how game engines are written with Cpp

> Unreal Engine uses C++, Unity's core is C++. DirectX is a C++ API.

I honestly think I addressed this. Most developers aren't trying to extend Unreal or Unity - they're building games with the aforementioned tools.

Re:Ways to Get Better at C++ by jhasse on Friday June 23, 2017 @09:22AM (#14618943)
At least in Unreal you can build your game in C++.

But you're right that C++ is getting used less and less in games, but I would still say that it's the most used language, especially in AAA games.

Re:Ways to Get Better at C++ by dom0 on Friday June 23, 2017 @08:38AM (#14618693)
> Mobile development

Android NDK, Objective-C++, ...

> desktop applications

There are plenty of applications written in C++, from legacy code bases like MS Office to almost all content-creation tools ever, most applications whose abbreviations contain "computer aided", many libraries, and boatloads of applications. Like I said, C++ is used practically everywhere.

Most applications developed on Qt are C++ (some Python). Qt itself has already a large user base.

> data analysis

From matlab to gnuplot, oscilloscope and spectrum analyser software, data analysis applications are frequently developed using C++.

> machine learning

On many repositories I can rather clearly see a broad pink bar, e.g. https://github.com/search?utf8=%E2%9C%93&q=topic%3Amachine-l... https://github.com/tensorflow/tensorflow

-

If some proprietary application is not obviously written in .NET or Java, C++ is a safe bet.

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @09:14AM (#14618900)
> Android NDK, Objective-C++

Those toolkits are only useful for edge cases. SDK performance is adequate for 95% of real world applications.

> From matlab to gnuplot, oscilloscope and spectrum analyser software, data analysis applications are frequently developed using C++.

I.e tools that don't need to be re-implemented, some of which had they been built today could easily have been written with a bytecode / JVM / CLR language.

> On many repositories I can rather clearly see a broad pink bar, e.g. https://github.com/search?utf8=%E2%9C%93&q=topic%3Amachine-l

In your own link C++ ends up in a distant 6th place. What is that supposed to prove? That it's more popular than JavaScript in ML development?

> https://github.com/tensorflow/tensorflow

Another tool I'm not re-implementing. You conveniently left out that all of their models are developed with Python - which is what 99.99% of developers interested in ML are trying to do.

Re:Ways to Get Better at C++ by psyc on Friday June 23, 2017 @11:03AM (#14619669)
My problem with your line of argument in this whole subthread is that no matter how many examples people give you of important categories where C++ predominates, you've already decided that the sum total of all that is "niche".
[dead]
Re:Ways to Get Better at C++ by pvaibhav2 on Saturday June 24, 2017 @08:30AM (#14625362)
I'm interesting in your background: which languages do you use, and what kind of programs do you write? Perhaps it'll become clearer whether C++ is any use to you or not.

From the discussion I've read in this thread so far, it seems like you're claiming "what's the point of the entire field of mechanical engineering" when you, personally, just want to drive a car (not build one), fly on a plane (not build one) and so on.

Re:Ways to Get Better at C++ by doktrin on Saturday June 24, 2017 @09:34AM (#14625517)
> I'm interesting in your background: which languages do you use

Scala, Java, C#, Obj-C / Swift, Python, JS.

> what kind of programs do you write?

At work : line of business, database / search / indexing systems, mobile apps, web apps

At home : mobile apps, indie games

> it seems like you're claiming "what's the point of the entire field of mechanical engineering" when you, personally, just want to drive a car (not build one), fly on a plane (not build one) and so on.

You've misunderstood. What I'm claiming is that there are very few tasks at hobby-project scale that C++ is ideally suited for. C++ is a language that's used at team-scale, and is no longer an approachable language for the individual.

In other words, with Java you can build Android apps, with C# you can build Unity games, with Python / JavaScript / Whatever you can build web apps.

What can the individual do with C++ they couldn't do easier faster or better with some other language? Maybe embedded systems - but C seems just as effective for that domain. Likewise for kernel development for obvious reasons.

I actually want a reason to use C++, but "well you can work on Photoshop or high performance computing or HFT plumbing software" is not a helpful answer - both for me and anyone else hoping to pick up Cpp in their spare time.

Re:Ways to Get Better at C++ by pvaibhav2 on Sunday June 25, 2017 @12:23PM (#14630757)
Well if you're looking for anecdotal evidence: my last hobby project (OCR for a specific book+script), I used Mathematica to prototype (fast iteration) and C++ with OpenCV to implement it (way faster execution).

I started the project in Python but switched because it wasn't particularly good at anything vs. the combination of Mathematica and C++. Actually I prototyped it in C++ too before doing some extra analysis in Mathematica only because it had some algorithms that OpenCV didn't.

Re:Ways to Get Better at C++ by mhtxhn on Friday June 23, 2017 @08:38AM (#14618692)
Chrome, Firefox, Adobe CC, etc. Node requires V8, which is written mostly in C++.

Remove C++ from software development and check what is still working...

Re:Ways to Get Better at C++ by doktrin on Friday June 23, 2017 @09:23AM (#14618953)
> Remove C++ from software development and check what is still working...

Remove opcodes & assembler from software development and check what is still working...

See how completely absurd that sounds?

Re:Ways to Get Better at C++ by ajdlinux on Friday June 23, 2017 @07:13AM (#14618322)
Anywhere that deals in embedded development, you're going to have to touch C++ at some point.
Re:Ways to Get Better at C++ by kronos29296 on Friday June 23, 2017 @08:04AM (#14618528)
Most competitive programming is done in C++. It probably will be in near forseeable future. This is because of speed and STL.