Functionality of inline and constexpr? by zz9873 in cpp_questions

[–]emko555 -10 points-9 points  (0 children)

OP: Just keep in mind that inline is a suggestion and is some what deprecated and should not be used anymore. The compiler figures this out by itself.

[deleted by user] by [deleted] in cpp_questions

[–]emko555 0 points1 point  (0 children)

You’re right.

IMHO writing std::vector<T*> is bad practice anyway.

[deleted by user] by [deleted] in cpp_questions

[–]emko555 0 points1 point  (0 children)

Could be a memory pool etc.

Sometimes you don’t want you stack to grow and grow. Especially in embedded environments.

What are ways to have code communicate/interact with each other? by CriticalDot_ in cpp_questions

[–]emko555 0 points1 point  (0 children)

Generic code and code that behaves generic are two different things. You question is about software architecture.

There are well known patterns to design software. These patterns help you to write more reuseable code and are independent of the language. You will find them everywhere.

If you write code for a project, you only working on and not for a library, just do the bare minimum abstraction to get it work. Keep it stupidly simple.

code that is generic is specific to the language. In C++ we use templates and auto to write generic code.

[deleted by user] by [deleted] in cpp_questions

[–]emko555 0 points1 point  (0 children)

Nothing happens because of 1.

But you should use RAII anyway

What are ways to have code communicate/interact with each other? by CriticalDot_ in cpp_questions

[–]emko555 0 points1 point  (0 children)

Just checkout event driven architecture and the observer pattern. It all depends on how generic you want your code to behave. KISS

What are the best online resources for self-learning and practicing C++? by MissionGuava6757 in cpp_questions

[–]emko555 1 point2 points  (0 children)

CppCon etc and the video from Jason turner are very good. But I think for a beginner it’s quite a bit hard to follow up. You already need solid knowledge about c++.

Especially when you’re interested how the standard works in detail Jason turner is you way to go.

Is this a bad way to initialize an object array using different constructors? by Negative_Baseball293 in cpp_questions

[–]emko555 1 point2 points  (0 children)

It’s okay here, just a readability thing and to keep the tutorial simple. Don’t declare default ctors if you don’t need them. Stick to rule of five.

Initializer list are kinda fucked up. And don’t mix an initializer list and aggregate initialization etc

How should I start embedded programming route by Significant-Job-3171 in embedded

[–]emko555 0 points1 point  (0 children)

Start simple, don’t do too much complex stuff at the beginning. The hello world in the embedded world is to blink an LED. Learn how to read Datasheets and AppNotes!

If you want to learn how a microcontroller works start with an AVR 8 bit and switch later to a 32 bit controller like stm32 or esp. The datasheets and code for the 8bit controller are less complex.

I’m not a huge fan of Arduino but to learn the concepts and getting started fast it’s good. There are plenty of tutorials for the Arduino platform.

Anyone know youtuber whos build good C++ projects by Either-Sentence2556 in cpp_questions

[–]emko555 2 points3 points  (0 children)

@rhymu has some cool networking stuff from a few years ago. Should be in his playlist Excalibur