Comments (4)
+1.
I can also see the value in some "this is a security vulnerability" examples.
from cpppatterns-patterns.
My personal opinion is that the sample description should point out any improvements this modern style has over earlier attempts. Perhaps more of the existing samples need this. I'd want to avoid showing bad examples at all (in case there is any confusion).
from cpppatterns-patterns.
My initial reaction would be the same, why show 'bad' way of doing things?
Well, an obvious reason is to show what not to do.
Perhaps it needs to be managed in a different way though, some sort of "Samples of Modernising Old C++". There are some who have old code bases, but could work on upgrading, so I am sure they would appreciate seeing not just that the code is bad, as I am sure they know that, but how to update it.
I would definitely not muddy this collection with examples of old style C++. There are a lot of things that are done bad, even though earlier versions of C++ provided the tools for not doing such shameful things.
from cpppatterns-patterns.
My rationale comes from the rocks I hit while learning C/C++. It's an old language. Really old. Most resources for it are equally old, and it's hard to have updated ones, with modern features and what not.
You have a collection of samples of C++ that are modern, and if they are modern it's because there obviously were at some point, old, and worse ways to do it. The great thing about having this contrast with old examples would be a more descriptive way to explain why the modern examples are modern. It would show what are the advantages of taking that route, and why we no longer do it the old way.
It would become a wonderful resource to update people from the old ages to updated tactics. Maybe add a toggle button that shows a side by side of good and bad, but the bad stays hidden by default. That way it wouldn't be confusing, since people would only see bad code if they clicked the button that says "Show Bad Code" or something.
from cpppatterns-patterns.
Related Issues (20)
- Add clear notes to samples involving experimental features
- Examples that involve non-standard libraries HOT 5
- Suggestion: Singleton pattern HOT 1
- Suggestion: mixing formatted and unformatted input
- Suggestion: mixing formatted and unformatted input
- Suggestion: Lambdas
- Adjust layout so code has a bit more width
- Suggestion: Add .clang-format indentation guide HOT 1
- std::string and utf-8 HOT 2
- Suggestion: <chrono> samples
- Remove Algorithms category HOT 1
- Suggestion: Rosettacode link?
- Suggestion: linking contributor github profiles HOT 2
- Suggestion: summing up values in a range (`std::accumulate`)
- Suggestion: add HTTPS HOT 1
- pimpl.cpp not compiled on macOS 10.13.3
- Suggestion: Support tags per pattern
- std::experimental::dynarray no longer supported in array passing example
- Suggestion: In the CRTP example, make impl method private in the derived class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpppatterns-patterns.