Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

For example, the title of an exercise could be "http"https://programmerssoftwareengineering.stackexchange.com/questions/235674/what-is-the-pattern-for-a-safe-interface-in-c?"

For example, the title of an exercise could be "http://programmers.stackexchange.com/questions/235674/what-is-the-pattern-for-a-safe-interface-in-c?"

For example, the title of an exercise could be "https://softwareengineering.stackexchange.com/questions/235674/what-is-the-pattern-for-a-safe-interface-in-c?"

Am I paranoid...

#Am I paranoid...

Best solution

#Best solution

Your second solution ("make them protected") looks good, but barebear in mind that I am not a C++ expert. 
At least, the invalid usages seem to be correctly reported as errorneouserroneous by my compiler (g++).

Better solution

#Better solution

About the compiler

#About the compiler

I don't know your situation, and in fact you probably have valid reasons to be tied to a specific compiler. 
But in the case this is just plain inertia, the situation won't ever evolve if you or your coworkers don't report productivity or techical debt problems.

Am I paranoid...

Best solution

Your second solution ("make them protected") looks good, but bare in mind that I am not a C++ expert. At least, the invalid usages seem to be correctly reported as errorneous by my compiler (g++).

Better solution

About the compiler

I don't know your situation, and in fact you probably have valid reasons to be tied to a specific compiler. But in the case this is just plain inertia, the situation won't ever evolve if you or your coworkers don't report productivity or techical debt problems.

#Am I paranoid...

#Best solution

Your second solution ("make them protected") looks good, but bear in mind that I am not a C++ expert. 
At least, the invalid usages seem to be correctly reported as erroneous by my compiler (g++).

#Better solution

#About the compiler

I don't know your situation, and in fact you probably have valid reasons to be tied to a specific compiler. 
But in the case this is just plain inertia, the situation won't ever evolve if you or your coworkers don't report productivity or techical debt problems.

Bounty Awarded with 300 reputation awarded by paercebal
deleted 52 characters in body
Source Link
coredump
  • 6k
  • 2
  • 23
  • 30
  1. Slicing in C++ is nothing more than a peculiarity of the language. Since your are writing a guideline (esp. for newbies), you should focus on teaching and not just enumerating "coding rules". You have to make sure that you really explain how and why slicing occurs, along with examples and exercices (don't reinvent the wheel, get inspiration from books and tutorials).

Slicing in C++ is nothing more than a peculiarity of the language. Since your are writing a guideline (esp. for newbies), you should focus on teaching and not just enumerating "coding rules". You have to make sure that you really explain how and why slicing occurs, along with examples and exercices (don't reinvent the wheel, get inspiration from books and tutorials).

  1. Pure virtual classes, as others pointed out.
  1. Slicing in C++ is nothing more than a peculiarity of the language. Since your are writing a guideline (esp. for newbies), you should focus on teaching and not just enumerating "coding rules". You have to make sure that you really explain how and why slicing occurs, along with examples and exercices (don't reinvent the wheel, get inspiration from books and tutorials).
  1. Pure virtual classes, as others pointed out.

Slicing in C++ is nothing more than a peculiarity of the language. Since your are writing a guideline (esp. for newbies), you should focus on teaching and not just enumerating "coding rules". You have to make sure that you really explain how and why slicing occurs, along with examples and exercices (don't reinvent the wheel, get inspiration from books and tutorials).

Source Link
coredump
  • 6k
  • 2
  • 23
  • 30
Loading