10 Replies - 1240 Views - Last Post: 06 January 2017 - 04:31 PM

#1 The Unliked  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 03-November 15

How is C++ Being Used

Posted 06 December 2016 - 03:33 AM

There are many similar questions out there, but none seem to give a satisfying answer.
I have programmed in .Net for the last few years and have made useful programs for friends and myself. I'm now starting to learn the basics of C++, however, it seems like it isn't used much in today's world. I mean, when was the last time you saw someone typing into a black window? More oftenly, I see companies and users using GUI orientated programs. Everyone says cpp is used everywhere, but I really don't see it. I'm sure I'm missing something big, but I don't know what it is.

It would be great if a c++ programmer here would enlighten me on what they have made or are making and elaborate on what their day to day work looks like.

Is This A Good Question/Topic? 0
  • +

Replies To: How is C++ Being Used

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5895
  • View blog
  • Posts: 20,130
  • Joined: 05-May 12

Re: How is C++ Being Used

Posted 06 December 2016 - 05:37 AM

I think you are assuming that a C++ program must be a console program. The language by itself only has console and file I/O in its standard library, but each OS exposes APIs that lets C++ programs create GUIs.
Was This Post Helpful? 1
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: How is C++ Being Used

Posted 06 December 2016 - 07:17 AM

Windows is written in C and C++, mostly. It's unlikely that's going to change anytime soon.

C++ is still the language of choice for the video game industry, I believe.

It's a general purpose language, so it shows up everywhere. It's both a popular and an old language, so it's well entrenched.

Perhaps the only niche it doesn't occupy is webby stuff, where higher level scripting is king. However, the web servers themselves are often written in C++.
Was This Post Helpful? 2
  • +
  • -

#4 Xupicor  Icon User is offline

  • Nasal Demon
  • member icon

Reputation: 456
  • View blog
  • Posts: 1,179
  • Joined: 31-May 11

Re: How is C++ Being Used

Posted 06 December 2016 - 07:59 AM

The webby stuff uses C++ when it really, positively needs performance. Let Facebook's HipHop serve as an example.

Quote

I mean, when was the last time you saw someone typing into a black window?
I do it all the time? : P Though on Windows I use bash & co in ConEmu, so I have a dropdown terminal with tabs triggered by the good old Quake Ctrl+~ key combo. Headless or console only programs are used all over the place, all the time. There's more going on on your computer than what you see with your eyes. : P

The big thing you're missing is assuming that C++ means "console only". It doesn't. Neither does PHP - but surprise, surprise, you can run PHP scripts in terminal and make use of standard input/output. You can do it in a slew of other languages too.
The other big thing you seem to assume is that the only programs that "count" are these that are used by end-users, actively. What about services, drivers, etc?

This post has been edited by Xupicor: 06 December 2016 - 08:55 AM

Was This Post Helpful? 1
  • +
  • -

#5 The Unliked  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 03-November 15

Re: How is C++ Being Used

Posted 06 December 2016 - 08:16 AM

View Postbaavgai, on 06 December 2016 - 07:17 AM, said:

Windows is written in C and C++, mostly. It's unlikely that's going to change anytime soon.

C++ is still the language of choice for the video game industry, I believe.

It's a general purpose language, so it shows up everywhere. It's both a popular and an old language, so it's well entrenched.

Perhaps the only niche it doesn't occupy is webby stuff, where higher level scripting is king. However, the web servers themselves are often written in C++.


Thank you. Both replies cleared things up a bit.

How does "backend" c++ work? What is it's role in windows and in games? They say c++ does the games calculations, but how does it tie in with everything else?
Was This Post Helpful? 0
  • +
  • -

#6 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: How is C++ Being Used

Posted 06 December 2016 - 08:32 AM

View PostXupicor, on 06 December 2016 - 09:59 AM, said:

Let Facebook's HipHop serve as an example.


Sorry, working in one language and transpiling to another is NOT working in the destination language. By such logic, working in C is writing Assembly.

In any case, it's dead:

Quote

HipHop for PHP (HPHPc) is a discontinued PHP transpiler created by Facebook.
-- https://en.wikipedia.../HipHop_for_PHP

Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13492
  • View blog
  • Posts: 53,892
  • Joined: 12-June 08

Re: How is C++ Being Used

Posted 06 December 2016 - 08:36 AM

Quote

How does "backend" c++ work? What is it's role in windows and in games? They say c++ does the games calculations, but how does it tie in with everything else?

Would you clarify the question.
Was This Post Helpful? 0
  • +
  • -

#8 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon


Reputation: 6979
  • View blog
  • Posts: 14,602
  • Joined: 16-October 07

Re: How is C++ Being Used

Posted 06 December 2016 - 08:47 AM

View PostThe Unliked, on 06 December 2016 - 10:16 AM, said:

They say c++ does the games calculations, but how does it tie in with everything else?


"They" are wrong. I know you hear "if you really want to optimize it, use language X" but it's mostly crap. Most higher level languages have their lower level bottlenecks optimized already. If you could write decent code in language X, you'd probably be using language X.

Look at the question another way: how does C# tie in with everything else? Most of the heavy lifting is done for you, but let's say want to use some DirectX or OpenGL library. You use that API to write to the screen, get keyboard input, etc. Guess how you use C++ to talk to DirectX or OpenGL.

When you want to do graphics in C++, you use a graphics library. You want to call a web api ( not the best use of C++, but always possible ) you find a nice http library. Indeed, all the code you use in those other languages probably touches C or C++ at some level.
Was This Post Helpful? 0
  • +
  • -

#9 Xupicor  Icon User is offline

  • Nasal Demon
  • member icon

Reputation: 456
  • View blog
  • Posts: 1,179
  • Joined: 31-May 11

Re: How is C++ Being Used

Posted 06 December 2016 - 08:59 AM

HipHop is dead? Hm, it has been a while... Well, disregard that then.
Sure, it's not "working in the destination language", but it's still doing something with C++. There's a reason why they used C++ as the target language and not assembly directly. I retract the example, though. It was evidently bad.
Was This Post Helpful? 0
  • +
  • -

#10 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1484
  • View blog
  • Posts: 8,204
  • Joined: 07-September 06

Re: How is C++ Being Used

Posted 06 December 2016 - 09:47 AM

Pretty much everything can be done with C++... it is just that there have been other languages created for more specialized uses.

I use C++ on a daily basis; partially because I work in the computer storage industry, and partially because it is my language of choice for performance and power reasons.

Things I use C++ for:
PHP modules, server-side web development (hell, I wrote my own web server specializing around APIs and RESTful interfaces completely in C++), Linux kernel development (this tends to be more on the C side though).

These days you can even write front-end web sites with C++:
https://kripken.gith...k/gindex.html#/

So, in short, C++ is literally everywhere, you just need to know what to look for.
Was This Post Helpful? 1
  • +
  • -

#11 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 242
  • Joined: 29-October 16

Re: How is C++ Being Used

Posted 06 January 2017 - 04:31 PM

I'm a super beginner C++ coder but I like C++ because it seems to be pretty versatile, you can write console applications or large GUI utilities. It also is pretty easy to progress in, once you get used to the syntax. Additionally, it seems pretty predictable so once you get into the swing of things you can start to anticipate the syntax for upcoming operations. I am using it to write .vst plugins, windows programs, and also trying to get a light database app going, all using C++. Soon, I may start writing some light game mods in it as-well, it's a pretty high performance language, but all I have to compare it to is Ti Basic which is barely a language at all.

Toodles

This post has been edited by hexagod: 06 January 2017 - 04:32 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1