A question for C++ experts

Hi,

I am a newbie in C++, trying to be better everyday. Here a question for you experts so I can make my self comparison. I am developing C++ for almost 3 months now and still need to look up on internet to remember some basic syntax and methods in each new project. Ex: initializing 2d arrays, use of iterators etc..

Don't you guys forget some basic stuff occasionally? To be more clear, do you do a research on internet for some easy methods even if you used that recently?

I am asking this because usually my memory works fine, and this situation makes me mad. I feel like dumb sometimes.
Last edited on
Most of the syntax and grammar of the language eventually becomes so ingrained that you don't even think about it. The most commonly used classes from the library also get memorized, except maybe for some less commonly used methods. Ranged fors have made iterators redundant for me, for the most part.
Nowadays I only need to look up unusual classes and/or semantics. See for example
http://www.cplusplus.com/forum/general/175305/
http://www.cplusplus.com/forum/general/172808/
istemihan wrote:
Don't you guys forget some basic stuff occasionally?


I've been using c++ for about 9 years, helios has more experience than that (he answered some of my questions when I first joined c++ back then). I frequently have to look up programming patterns in other languages (writing an api in php, can't remember if it is foreach($var as $key => $val) or foreach($var, $key, $val) (spoiler: it's the first)

But c++ syntax/common containers/general style really don't give me a hard time. It may take you a couple times of using that function but you'll start remembering. That's the nature of natural and programmatic languages! We all feel dumb sometimes, don't beat yourself up about it.
closed account (E0p9LyTq)
istemihan wrote:
Don't you guys forget some basic stuff occasionally? To be more clear, do you do a research on internet for some easy methods even if you used that recently?

All the time, but then I am still learning a lot of the C++ basics while having to bootstrap myself into C++11/14/17.

Coding is more of a hobby/pastime for me, I am not even close to being employable at it. Learning from books and the internet doesn't give much depth into C++, really.

Now what were we talking about? I forget. ;)
Once you develop your own style of programming there really isn't all that much to remember. Like helios said, the most common stuff gets to be second nature, but there is also a whole bunch of stuff that you just won't find yourself using. For instance, I don't use the ternary operator because I find that writing out if(...){...} isn't all that much more work and it's more readable at a glance which I prefer. So I occasionally have to look up the syntax for that. I also have no flipping idea how "assert(...)" works because I don't use it. I know what it does but I don't know how it behaves, does the stack unwind? Do destructors get called? Does the OS get signaled in anyway? These are all easily answered questions, a header file is plain text after all and I have at least three versions of that file on this computer alone. But since it's not something that I ever run into outside of someone else's code, I just don't bother trying to remember it. Then there is the important "basic" stuff that you should try to remember but it hardly ever comes up, such as what data model your platform is using, or what endiness your system uses. That stuff does matter, but at the same time it kind of doesn't.

tl;dr: Knowing how to look up your questions and find your answers is actually more important of a skill then wrote memorization.
Topic archived. No new replies allowed.