Namespaces
Variants
Actions

Difference between revisions of "Talk:intro/scope"

From cppreference.com
(reply)
Line 3: Line 3:
 
: Hi. Thanks for your work improving the wiki :) Overall I think variable lifetime belongs here. Perhaps it's worth not to say anything about the difference between stack and heap yet and keep showing only stack-based variables in the examples. The 'intro' section is supposed to teach the basics of C++ without diving into the complexity. Given that all the various containers and smart pointers make raw dynamic allocation seldom needed, we can get away with not showing it at all. Lets keep it for the advanced section where we can teach all the peculiarities.
 
: Hi. Thanks for your work improving the wiki :) Overall I think variable lifetime belongs here. Perhaps it's worth not to say anything about the difference between stack and heap yet and keep showing only stack-based variables in the examples. The 'intro' section is supposed to teach the basics of C++ without diving into the complexity. Given that all the various containers and smart pointers make raw dynamic allocation seldom needed, we can get away with not showing it at all. Lets keep it for the advanced section where we can teach all the peculiarities.
  
: By the way, could you make your examples consistent with the rest of the wiki. I.e. 4 space indentation, {{tt|small_case}} capitalization (except type names), not using {{c|using namespace std;}} and calling {{c|<< '\n'}} instead of {{c| << std::endl}} (which is equivalent {{c| << '\n' << std::flush}}. We don't need to flush the stream most of the time). Thanks :-)
+
: By the way, could you make your examples consistent with the rest of the wiki? That is, 4 space indentation, {{tt|small_case}} capitalization (except type names), not using {{c|using namespace std;}} and calling {{c|<< '\n'}} instead of {{c| << std::endl}} (which is equivalent {{c| << '\n' << std::flush}}. We don't need to flush the stream most of the time). Thanks :-)
  
 
: --[[User:P12|P12]] 08:09, 22 January 2014 (PST)
 
: --[[User:P12|P12]] 08:09, 22 January 2014 (PST)

Revision as of 09:10, 22 January 2014

I miss a section about variable lifetime. Maybe this is the space that needs to be extended with a teaser, maybe we should create a separate section. I'm in trouble at intro/types when discussing arrays. What should I tell them where to go if they want to know about 'heap' and 'stack'? Nil (talk) 04:51, 22 January 2014 (PST)

Hi. Thanks for your work improving the wiki :) Overall I think variable lifetime belongs here. Perhaps it's worth not to say anything about the difference between stack and heap yet and keep showing only stack-based variables in the examples. The 'intro' section is supposed to teach the basics of C++ without diving into the complexity. Given that all the various containers and smart pointers make raw dynamic allocation seldom needed, we can get away with not showing it at all. Lets keep it for the advanced section where we can teach all the peculiarities.
By the way, could you make your examples consistent with the rest of the wiki? That is, 4 space indentation, small_case capitalization (except type names), not using using namespace std; and calling << '\n' instead of << std::endl (which is equivalent << '\n' << std::flush. We don't need to flush the stream most of the time). Thanks :-)
--P12 08:09, 22 January 2014 (PST)