PDA

View Full Version : memory issue



Brain Cell
10-06-2004, 05:37 PM
I bet you are thinking "this is a C related issue" or "RAM" or something but its nothing technical. Its my actual memory.

The problem is ... whenever i go away for a bit (like 2 weeks) from C , i start forgetting things in it. Like i made a program using linked lists in the last 2 weeks , and yesterday i tried to remake it and my brain just stopped there because i forgot to add LOTS of things and even forgot how to implement the concept.

Now its getting even worse , im spending most of my time in college , learnning C++ and windows programming in VB. Net (we make windows programs from console not just drag and drop) so im starting to mix up things.

What i wanna know is ... do you guys experience the same thing or is it just me? that is , you need to always program stuff in a language or else you'll slowly start forgetting it? if so , what other ways there are to prevent such thing? (other than constantly programming in it)


sorry for the long thread :)

thanks for your time..

RoD
10-06-2004, 05:39 PM
you have a defective brain cell

Perspective
10-06-2004, 06:12 PM
it sounds like you are getting by, soley by "learning" what to type to make your program work. If you learn the algorithms, implementation will follow with ease.

pianorain
10-06-2004, 07:46 PM
Aye, I've experienced something similar. I don't do file I/O that often. Every time I need to do it, I have to look it up again, both in VB and C++. It's not something I worry about; I've always got my books on hand. However, that's just syntax. I agree with Perspective about learning the underlying "how it works" instead of just that it does work.

jverkoey
10-06-2004, 08:01 PM
I experienced the same problem when I was first beginning to learn C++, but I've been programming for 2 years now and it's very rare that I'll find something that I've completely forgotten how to do if it's something simple (file io, win32 api messages, opengl functions, etc) and everything else that I don't know how to do, I can usually find in about 2-3 minutes on google.

It's just like learning another language: you've got to keep at it to really cement it in to your head, or it will begin to fade away. Hell, even if you do have it cemented in your head, it could easily fade away if you don't program for extended periods of time (2-3+ months).

kermit
10-06-2004, 08:12 PM
On the flip side, has anyone here had the experience of backing off the programming (like right out of it) for a couple of months, and then coming back, only to find things a little clearer (after the initial rustiness leaves of course)

xErath
10-06-2004, 10:09 PM
Try practicing a lot a language after learning it. That way it's less likely that you mix up concepts. :cool:
I learned C then Java at my university... then in 5 days i learned C++ by myself, I wrote for that matter an simple class then a template class, and those where enough. Now I use C, prolog, and C++ with openGL at several disciplines. Most of my other colleges don't even know what C++ is, and they only use C and badly... They are the kind of people that only cares with exames...

Look what a partner of mine once wrote... :eek: :eek: :eek: :eek: :eek:

int GetString(char *str, int len, int x, int y) {
int i=0;
char ch=0;
while(ch!=13) {
if((ch = GetCh()) != -1) {
if(ch==27)
return 0;
if(i>=len-1 && ch!=13 && ch!=8)
beep();
else {
if(ch==27)
return 0;
else{
if(ch==8) {
if(i==0)
beep();
if(i>0) {
i--;
SetCursorPosition(y, x+i);
PutChar(' ');}
} else {
SetCursorPosition(y, x+i);
PutChar(ch);
str[i]=(char)ch;
i++;}
}
}
}
updateTime();
}
str[i-1] = 0;
return 1;
}

And my improved version...

int GetString(char *str, int len, int x, int y) {
int i=0;
char ch=0;
while(1){
updateTime();
ch = GetCh();
switch(ch){
case -1: break;//key not pressed
case 27: return 0;//cancel
case 8: //backspace
if(i<=0)
beep();
else{
i--;
SetCursorPosition(y, x+i);
PutChar(' ');
}
break;
case 13://enter
str[i]=0;
return 1;
default://another char
if(i>=len-1){//size to big
beep();
break;;
}
SetCursorPosition(y, x+i);
PutChar(ch);
str[i]=(char)ch;
i++;
break;
}
}
}

Consider yourself lucky Brain Cell :p

Vicious
10-06-2004, 11:30 PM
I was gonna reply but when I got to the bottom i forgot what the subject was...

Anywho.. aparrently this happens to me quite often. I'll get up off the couch to do something and by time a take a few steps I turn around and sit back down, cuz I forgot what I was gonna do.

GanglyLamb
10-07-2004, 06:10 AM
It's just like learning another language: you've got to keep at it to really cement it in to your head, or it will begin to fade away. Hell, even if you do have it cemented in your head, it could easily fade away if you don't program for extended periods of time (2-3+ months).

This is a fact which i experienced, on during my one year voluntary work in nigeria i could not talk Dutch to anybody for one year long ( even at my embassy they spoke french ).
I only spoke English for one year and the only times when i could speak Dutch was when i was talking to myself...

When getting back in Belgium i couldnt talk Dutch again that is i was talking 90% english and the rest was dutch...after two weeks that started to fade away and i could speak my mother tongue like i could before...

Its the same with programming so as long as you keep practicing it you remember it but once you dont practice it for a very long time you will forget even the most simple things...

Just my own tought though..

Brain Cell
10-07-2004, 07:38 AM
you have a defective brain cell
lol. If i had any , there would be more than one :p


it sounds like you are getting by, soley by "learning" what to type to make your program work. If you learn the algorithms, implementation will follow with ease.
actually i learn both but i forget things like functions with 4 arguments. I know what the arguments are but i forget their order.. things like that..

xEarth :
lol. I guess he's doing better than the students in my college. The proffessor once showed them how to print outputs with 'cout' and as an example he made a program with :
// first c++ program
cout << "Welcome to C++";

Most of the students were like "what if we change 'welcome to c++' to something else? will it still work prof?"

besides , they type exactly the same comment above , in every program, thinking the program wouldn't work without it ..

at least your friend is trying ;)



I was gonna reply but when I got to the bottom i forgot what the subject was...

Anywho.. aparrently this happens to me quite often. I'll get up off the couch to do something and by time a take a few steps I turn around and sit back down, cuz I forgot what I was gonna do.
lol thats way worse man :p



i guess ill just keep reviewing C every now and then so i won't forget it. How many languages can you guys handle? i mean without forgetting any of 'em

VirtualAce
10-07-2004, 07:46 AM
Well I only had one programming class and it was BASIC. By the time I got to the class I knew it so well that while other's were printing "Hello my name is dingbat" 5000 times on the screen, I was busy programming a missile command clone. Yep, in BASIC.

Some people just don't seem to get it and while the language has the same elements for every human being on planet earth, few use those elements correctly. That code is one good example.

My first 3D program was built entirely in QuickBasic 4.5 and it was a small gouraud shaded, cosine lighted 3D sphere. It really is not the language because all things can be done in all languages - notice I didn't say how well, but they can be done. It comes down to the programmer and the logic skills that they have. Some just don't have any. For more examples check the recent invasion of new posts on the C and C++ boards.

Usually if I've been away from C or something else for some time I spend a lot of time in the help file and help file index. When I came back to Direct3D after coding my terrain engine I couldn't believe how much I had forgotten. It came back in a day and now I could code you pretty much anything from scratch in Direct3D.

But you are right, there is a lot to remember and you won't ever remember how to implement everything you've learned, but if you have the concepts of C and C++ down pat the implementation is just details.

And right now I've been coding in C++ and Direct3D for so long that my assembly language skills are probably a bit rusty. However one program that made heavy use of assembly would bring it all back very quick. And now I'm learning NVidia's CG and MS's HLSL so that just adds more to the mix of stuff I need to remember.

I don't think it ever stops and if you like learning and are good at learning then you should be just fine. Don't be too concerned about forgetting stuff, because we all do.

Well, except for Salem and Prelude. But they don't count because they are not even humans. I think they are some kind of code deities or something.

;) :D

Vicious
10-07-2004, 11:27 AM
Bubba how long have you been coding! And what do you eat for breakfast?

I think you should be in that list with Salem and Prelude as the non human coding robots.

Perspective
10-07-2004, 04:58 PM
actually i learn both but i forget things like functions with 4 arguments. I know what the arguments are but i forget their order.. things like that..


this isnt out of the ordinary. Even professionals keep resources around for this type of thing.