Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

When will i need c++?

Status
Not open for further replies.

rhnrgn

Member level 5
Joined
Dec 25, 2013
Messages
92
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,069
Hello,

I am an electrical and electronics engineer and using MCUs and DSPs in my designs. I am using C language.

I want to know should i learn c++? Where people use c++ esspecially in electronics field. I know in visual studio you can use it but is it essential?

Thank You

PS:I am generally reading sensors, driving bldc and stepper motors, doing some ADC works in my desings.
 

Yes, learning C++ is essential as no knowledge is a waste.
 

Hello,

I am an electrical and electronics engineer and using MCUs and DSPs in my designs. I am using C language.

I want to know should i learn c++? Where people use c++ esspecially in electronics field. I know in visual studio you can use it but is it essential?

Thank You

PS:I am generally reading sensors, driving bldc and stepper motors, doing some ADC works in my desings.

You will need it when you have to use C++ libraries to do your job. That will determine which version you will nead to learn; there are substantial diffferences between each C++ standard and each C++ implementation.

Before starting, choose which subset of the language you need to use - which is difficult if you are a beginner.

Understand the C++ FQA, since it indicates what will be in store for you https://yosefk.com/c++fqa/ I am particularly "fond" of the section dealing with an important keyword, const.
 
Last edited:
  • Like
Reactions: rhnrgn

    rhnrgn

    Points: 2
    Helpful Answer Positive Rating
In my opinion.

I wouldn't bother with C++ if I were you. It is an ugly and complicated mess that is falling out of favour.
If using Visual Studio, I would learn C#. It is a much more improved modern language, the language of the .Net framework. If you know C, C# will be an easy move.

If using Visual Studio, I would also look at F#.
That is a functional language. It will blow your mind.
 
  • Like
Reactions: rhnrgn

    rhnrgn

    Points: 2
    Helpful Answer Positive Rating
I wouldn't bother with C++ if I were you. It is an ugly and complicated mess that is falling out of favour.
If using Visual Studio, I would learn C#. It is a much more improved modern language, the language of the .Net framework.

Be aware that C# is Microsoft's version of Java, and C# is effectively confined within the Windows platform. Microsoft makes various noises about it being available elsewhere, but see how many developers believe them. Much of Windows is based around C#'s "unsafe" keyword, which allows interworking with C++, but also imports many of C++'s disadvantages.

Whether being confined to Windows is an advantage or a disadvantage is for you to decide.

If you know C, C# will be an easy move.

Only at the trivial surface syntax level. (And the same is true for Java).

C# and Java are decent OOP languages, and there are very significant semantic differences between OOP languages and procedural languages such as C. Some find the procedural->OOP transition easy, some never make it.
 
  • Like
Reactions: rhnrgn

    rhnrgn

    Points: 2
    Helpful Answer Positive Rating
In my opinion.

To say C# is a version of Java is realy a bit simplistic, it is so much more.
It is more like C than Java!
The lead guy on C# development was the same guy who wrote Borland Pascal. A language Guru legend!
C# takes the best elements of them all, Pascal, C++, Java, C, and tries to do away with the shortcomings. The language is still in development and constntly evolving.

Windows centric maybe, but that is still the dominant platform in industry.

I struggled with C++ for a long time, then we moved to C#, like a breath of fresh air.
So much more productive.
I have yet to use the 'unsafe' keyword.

Still, each to his own, if you like C++, go with it.
 

In my opinion.
To say C# is a version of Java is realy a bit simplistic, it is so much more.
It is more like C than Java!
If you think that then you either don't understand C or you don't understand C#, or both. The syntax is similar, but the semantics are radically different - for a start, pointers are absent (unless you use unsafe).

Anders Hejlsberg personally presented C# to us in HP Labs, a few months before it was publicly released. When he was specifically asked about the similarity and differences between Java and C#, he looked slightly uncomfortable and did not give an answer that persuaded anyone in the audience. It is clear and well-documented that C# was Microsoft's response to the threat of Java.

It was apparent there were only two significant differences between Java and C#:
  • C# has gaping security holes built in to the language ("unsafe" is a hint!),
  • C# is statically compiled during installation whereas Java is dynamically compiled using HotSpot
There are differing advantages for static and dynamic compilation. Static compilation causes long installation times but can sometimes be better for resource-constrained environments. Dynamic compilation leads, after the VM has warmed up, to faster execution, since HotSpot optimises what actually are the important bits whereas C# can only optimise what it guesses might turn out to be the important bits.

The C# environment is tightly tied into Windows, but that's not a language feature, and can be regarded as either an advantage or disadvantage.

Windows centric maybe, but that is still the dominant platform in industry.

Change that to "dominant platform in a subset of industry" and I'll agree with you. Many parts of industry will not touch Windows with a bargepole, even if you paid them to use it. For very good reasons.

I struggled with C++ for a long time, then we moved to C#, like a breath of fresh air.
So much more productive.
I have yet to use the 'unsafe' keyword.
Still, each to his own, if you like C++, go with it.

Whatever makes you think I like C++? I used it in 1988 and have refused to use it ever since, for reasons that have repeatedly been shown to be valid. My attitude is that "if C++ is the answer, then you have asked the wrong question"!

OTOH I've used Java professionally since late in 1996 (and C since 1981). Have a look at when Java was released.
 

What a load of cobblers!
At least you know Anders, and we agree C++ is a load of crap.

Quote:
I've used Java professionally since late in 1996, JAR JAR

Well, I sympathise with that, Java is just a nickname for bloatware.
Lets see now, Microchips Mplab X based on net beans, java. Thats a disaster, up to version 2.3 and still a nightmare. Catching up with eclipse IDE for frustration.

Now Then: A complete rapid application development enviroment!
Expresion Blend, drag drop, GUI.
Visual Studio, Mix and match, C#, F#, Basic, C++. -> CLR.

You unix geeks are on the fringe!
It's obvious from your comments, you have no expirience of C# programming.
Otherwise, you would be raving about how cool it is.
 

Your rant is based in ignorance and a narrow perception of the world.

As a mere example, consider that much of my professional work has targetted neither windows nor one of the many unix families. For much of my work both windows and Unix are dangerously unpredictably slow bloatware.
 

My work is Misra compliant C in ECU (Electronic control units) used in the automotive industry.
My Windows programming is to test these units by sending Lin comms or Can comms to exersize their functions. Visual Studio and C# enable me to write test programs for this easily.

My post are not rant.
They are to stimulate discussion.
I think C++ is over rated.
We should look at more modern solutions and programming languages.
 

My post are not rant.
Yes they are. See rant definition
You've pretty much displayed both the verb and noun forms. :)
Along with your level of bias, which appears to be significant...:roll:

btbass said:
They are to stimulate discussion.
...and stimulate my laugh reflex. :laugh:
 

Offcourse C++ is important for you. Because you are CSS student and I think if you handling C++ design, then your knowledge grow more and more. And you also say in your post you need design so when you make 3D model C++ help you must be.
 

Hi rhnrgn

I use C++ for my daily job as embedded software engineer.
At the moment I develop the software of an insufflation device based on Ti's sitara AM335x. (Medical device)
With touchscreen and a Ui written with Qt.

So for cross platform development I can highly recommend C++.
For MCU programming you can use C++ as well. Checkout mbed.org

I'm really tried of the discussion of C++ is bad, it is no productive, it is difficult.
I also know Java and C# with .Net as well.
Every language has its strength and its weaknesses.

With C++11 and C++14 a lot has changed. The language became easier as before.
I my opinion C++ is not difficult as many people try to tell you.
You can easily develop applications with C++ on all major desktop systems like Windows, OS X or Linux.

As IDE I can recommend the qtcreator.
It is a general purpose IDE which can be used for cmake based, autotools based or Makefile based project.
It has also a bare metal plugin as well.
This IDE is free of charge and runs on all desktop system.

So with C++ you can achieve everything on desktop, in mobile and in the embedded world as well.

For me the most important rule is:

It doesn't matter which language and which framework do you use as long as you know what you are doing.
Unfortunately many people doesn't know what they are doing and that's why they are telling you things like C++ is difficult.

Best regards
Juergen
 

Hi rhnrgn
Every language has its strength and its weaknesses.
...
It doesn't matter which language and which framework do you use as long as you know what you are doing.

Agreed.

Unfortunately many people doesn't know what they are doing and that's why they are telling you things like C++ is difficult.

My experience is that most people don't understand enough about C++. Let's start with one very simple example...

When you see
Code:
const Fred* p
in a program, what does that guarantee?
 

Oh common.
First of all this is basic C.

Second I would ask your question like this

What is the difference between
const Fred* p;
Fred* const p;
const Fred* const p;

Cheers Juergen

- - - Updated - - -

I forgot one good example:
const char * const * const bla = argv;
 

(Sorry, I forgot this forum invites shallow replies by deliberately omitting the context. The question was "In a program, what does 'const Fred* p' guarantee?")

Oh common.
First of all this is basic C.
Your other questions are simply variants on a theme, and don't change the guarantees that are and aren't being made.

Let's keep it simple and uncomplicated, and leave the complications for later! Yes, it is basic C/C++ but most people give incorrect answers. If you think the answer is simple, then you have forgotten some of the very long drawn out discussions between C experts from 20 years ago.

So, what do you think it guarantees? If it is simple you should be able to give a quick easy answer!
 

Hint: it doesn't guarantee that the "contents" of the Fred pointed to by p won't change. There are several reasons why that guarantee simply cannot be made, to C's detriment.
 

In normal case the following is guarantees.
const Fred *p; // A writable pointer to const value
Fred* const p; // A const pointer to writable value
const Fred* const p; // A const pointer to const value

Still this question, doesn't proof if someone knows C++ or not.
Don't cast the const away. It's a sign of bad design!
 

And yes, I know the link you have posted.
There are bashing site of all languages out there.

Does this mean that those languages are bad? -> No as I mentioned before every language as his strength and weaknesses.

Or is the only right language to learn/use the one you suggest? -> Definitely no. Everyone has to find out by them self.

if C++ is the answer, then you have asked the wrong question"
This answer sounds to me like, I know every problems in the world and I know that none of the problems can be solved with C++ but with language "xyz".
Such answers are very unprofessional.
Mostly the the question "which language should we use to solve this problem" can be answered with a decision matrix.

There is no perfect, flawless language out there. Neither Java nor any other language.
You can do bad things with every language.

I, for myself would never ever say language "xyz" is bad or is the best language in the world because such sentences are unprofessional and partial.

So learning something is always good even if you don't need it to do your job.
If "rhnrgn" is going to learn C++, I sure you would answer something like "it is total waste of time"
Is it really a wast of time?
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
In normal case the following is guarantees.
const Fred *p; // A writable pointer to const value

Bzzzt! Your answer is plain wrong, and is an example of someone incorrectly thinking they understand C/C++.
Apart from that, I have no idea what a "normal case" might be - and more importantly neither does the compiler.

There is no guarantee whatsoever that the Fred won't change.
- it might be pointed to by another pointer that changes it
- it might be passed to a function that casts away the constness
- a debugger might change what's in memory, but not what's in the L1/2/3 caches nor a value in a register
- it might be changed because Fred is one of several an "overlapping objects" pointed to by different pointers
At best, without a well-implemented memory model, the compiler might complain if your function tries to the Fred "via" p.

Don't cast the const away. It's a sign of bad design!

I suggest you read, learn and inwardly digest the "cast away constness" discussions that went on for years in the early-mind 90s. There are good, valid, justifiable reasons why it should be impossible to cast away a const. There are also good, valid, justifiable reasons why it must be possible to cast away a const. Those two points cannot be reconciled - the committees had to choose one set of disadvantages.

- - - Updated - - -

And yes, I know the link you have posted.
There are bashing site of all languages out there.

Does this mean that those languages are bad? -> No as I mentioned before every language as his strength and weaknesses.

Or is the only right language to learn/use the one you suggest? -> Definitely no. Everyone has to find out by them self.


This answer sounds to me like, I know every problems in the world and I know that none of the problems can be solved with C++ but with language "xyz".
Such answers are very unprofessional.
Mostly the the question "which language should we use to solve this problem" can be answered with a decision matrix.

There is no perfect, flawless language out there. Neither Java nor any other language.
You can do bad things with every language.

I, for myself would never ever say language "xyz" is bad or is the best language in the world because such sentences are unprofessional and partial.

So learning something is always good even if you don't need it to do your job.
If "rhnrgn" is going to learn C++, I sure you would answer something like "it is total waste of time"
Is it really a wast of time?

That rant contains so many irrelevant and incorrect strawman arguments that rebutting all of the would take too long - and wouldn't help the OP.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top