views:

359

answers:

9

I often find myself forgetting the syntax of any programming language I learn. I first learned C then C++ then PHP and Java. If I'm asked to program in C now, I think I can't do it. Being a programmer how imprtant it is to remember the syntax of every programs you learn? Am I the only one who is experiencing this (if yes then I'm dumb) or you guys also go through the same situations? What you guys do to remember all the tid-bits of a programming language?

+2  A: 

Intellisense is your friend, at least for C++ and other Visual-Studio supported languages.

John Dunagan
Hell Yes. MS writes at least half of my code this way.
StingyJack
I'm just happy to pimp, er, help. I would be all "yo, Federline! Fries!" without it.
John Dunagan
+5  A: 

I'm always mixing up syntax because I switch between languages so often. I guess it's normal.

I'd rather forget some syntax or a library function every once in a while than only know one language.

bobwienholt
+10  A: 

In my experience programming languages are like spoken languages: "use it or lose it". If I go several months without working in a given language it will take me a little while to get back up-to-speed on working in that language. Although, it is nothing like relearning the language from scratch. I expect if you start working in C again, for the first few working hours you'll spend much of your time in the manuals, but it will come back to you faster than you'd expect.

acrosman
+2  A: 

Like John said, IntelliSense is your friend :)

However, I often find myself forgetting how something is done if I haven't used it in a while. That's where tools like CodeKeep or even Google Notebook come in handy, so that you can store snippets that you can retrieve anywhere/anytime.

Bullines
+3  A: 

Yes I forget some of the small details of syntax but overall I think I remember most of the language proper for any of the dozen languages I know. Can I remember all the details of the gargantuan libraries most languages include? Heck no!

DMKing
+6  A: 

I think it's pretty common to forget some syntax if you've been programming in other languages for awhile. It doesn't matter, syntax is secondary to strong programming fundamentals that you can apply in any language.

Bill the Lizard
+1  A: 

I would say yes but it depends on a few things:

  1. Are you asking about the core language syntax only, or both the core language syntax and the libraries (eg stdio.h, stdlib.h, ctype.h, etc.)?
  2. The complexity of the language. C itself is a relatively simple language at its core (with a few exceptions like function pointers to function pointers that return a pointer,etc...and some other less often used bits of syntax). Other languages like Perl have a lot more syntax and the core language offers a lot of built in functions.

Anyway that being said here are my views:

I find the actual core language of C to be tiny in comparison to many of the programming languages. Also a lot of the C constructs are borrowed by other languages (C++, C#, Java, etc.) so for the actual C syntax I find I am using much of it often even if not in C itself. All that being said I usually find with C that I can whip up a program on short order after not touching it for 6 or 7 months at a time. Generally what I forget is the exact syntax for less frequently used library calls. but the most common stdio.h, stdlib.h, string.h, ctype.h calls I generally remember over time.

Perl I forget the core syntax after only a month or two. Not near everything but Perl has a lot of built in functions which technically are part of the syntax and not an external library. There is a lot to Perl, even Regular Expressions count technically as part of the syntax and a lot of times I have to look that up.

I think it depends on the language. Also I'm sure that in a very large language you probably forget subsets of the syntax that you don't use for a long time. If you throw in the library it is much worse. I forget .NET and Java library calls faster than I learn them. The same for random C library to do this or that. In C++ I forget the STL constantly. In Python/Perl I often forget the built in functions/objects and have to keep looking them up. C's advantage is that mostly it doesn't have all these built in functions/objects...the core language is pretty simple...the rest is all libraries. You can hang yourself with C but not from overly complex syntax with hundreds of tokens.

Cervo
A: 

I sometimes mix up syntax, but then I am somewhat dyslexic. Tools such as intelisense are very helpful. I also like to keep quick reference guides handy.

Jim C
+1  A: 

It's all about the fundamentals. I tend to remember a lot about whatever my primary language is at the time, but my opinion is that if you have the core principles and good coding practices, that's key. With all of the resources available, looking up syntax is relatively easy, so I worry more about the concepts than specific implementations.

Of course, using one particular language on a regular basis should result in pretty good recollection of the syntax for most common problems. This memory will fade if you switch languages though.

Andrew Van Slaars