Sign in to follow this  
eniCma

What is the best way to study Porgamming Language?

Recommended Posts

What is the best way to study Porgamming Language? -Read code and writing example during read? -Read code and imagine the result of code? (No need to write) -Read all concept first by don't care code example. After finish concept, go back to coding following the example. I dont know why I can not remember the Language syntax or Concept of C/C++ (in some topics such as Structure, Pointer, Template and another..)even I read it several times.... Even I try to set problem and writing the code to solve it which I stuck it once~!!!!! Anybody could you please kindly share your Programming Learning method to me... thank you so much

Share this post


Link to post
Share on other sites
For me the best way that I have found to learn something is to first read about it, then to do it. Read through a concept in a book, or something of the sort, then try something with that new concept on your own. Take for example pointers - read a section in a book (or online tutorial, or whatever you like), then try coding the examples in the book. Once you understand what is happening, try coding something a bit different from the book.

I would say for programming, it definitely takes practice and plenty of playing around to remember a new concept. At least that holds true for me.

Share this post


Link to post
Share on other sites
Quote:
Original post by Moe
For me the best way that I have found to learn something is to first read about it, then to do it. Read through a concept in a book, or something of the sort, then try something with that new concept on your own. Take for example pointers - read a section in a book (or online tutorial, or whatever you like), then try coding the examples in the book. Once you understand what is happening, try coding something a bit different from the book.

I would say for programming, it definitely takes practice and plenty of playing around to remember a new concept. At least that holds true for me.


Thank you so much, Moe
Why we need to coding the bit different from book? It will helping me to what? Please advise...

Share this post


Link to post
Share on other sites
Quote:
Original post by Moe
I would say for programming, it definitely takes practice and plenty of playing around to remember a new concept. At least that holds true for me.


Seconded.

Read a concept, think about it, then do it. Not all of the examples in the book/tutorial are going to interest you (if any at all), so use what you learned and change it around and write a program that YOU want to write using the new concept. This way, your writing your own program and not following the book. Your learning from the book, not following it.

Share this post


Link to post
Share on other sites
You should definately actually write and compile code while you're learning. Understanding it in theory is no replacement for actually implementing things and will get you no experience in the sorts of things that can go wrong.

Everyone learns differently, but I believe I agree with the others in saying that it's usually effective to
1) Read about it.
2) Type out any examples or excerices and make sure you actually get them working. Seek help if needed. If you can't figure it out and need an additional source of information a different book or an online tutorial may give you a different perspective.
3) Write your own example of some sort. If you really understand the concept you should be able to do this. It's perfectly fine if you still need to refer to a reference but if you're unable to get something working without copying directly from your book or tutorial then you probably don't understand it.


Also keep in mind that you won't remember anything and that there isn't anything unusual about that; very few people (if any) do. A good programmer learns syntax and a lot of common functions through experience, but more importantly will be able to quickly look up what they need to know when they can't remember something. Make sure you're actually writing programs - you'll never remember much from simply reading about it, but if you're actually writing code you'll find that over time you'll remember more and more.

Share this post


Link to post
Share on other sites
Quote:
Original post by eniCma
-Read code and writing example during read?
-Read code and imagine the result of code? (No need to write)
-Read all concept first by don't care code example. After finish concept, go back to coding following the example.


Well depending on the language... start with simpler tasks; a language like Java or C++ should have hundreds of websites with tutorials on it.

But really I started with a language called LPC, which is a variant of C that was used for by the MudOS driver for MUDs. I learned every thing initially about programming through trial and error with that language; I learned syntax by reading former code (namely that from Pinkfish and the Discworld mud library).

Then I started taking CSC classes at college and this is where I learned more complex information like dealing with memory (which if you want to get to 3D game programming becomes very important) and speed of certain standard library functions over others.

But basically I'd say... you will learn 90% of a language by buying books on the subject at a local Barnes and Noble, studying their code and writing it then hacking (altering it) so that you get new responses. You really do learn it by trial and error.

The other useful thing... ASK QUESTIONS! Find a good mentor... someone who knows the language you're studying and ask them questions when you're confused! They can usually make it analgous (sp?) to something you will understand and that helps you so much!

I couldn't learn C++ if it wasn't for a friend of mine being there to explain how the stack and heap work and why the hell I should care :)

So review...
- Trial and error
- Grab some books
- Look up web resources
- Get a good compiler
- Ask Questions
- Find a mentor
:)

Share this post


Link to post
Share on other sites
Learn by doing.

I had a lecturer at uni who told us every class that if we didnt program for at least an hour every day then we would fail.
He was exaggerating, but his point still stands.

If you want to learn all the tricks of the trade, and remember them, you have to use them, and often.

Only once you've made all the mistakes yourself will you remember how to avoid them.


Dont just read pages of code without typing some if it yourself. And preferably you shouldnt just type in other peoples example code - you should read their example code to understand the algorithm, write the algorithm down, then try and code it yourself by only looking at your notes on the alogoritm and not at their example code.

Share this post


Link to post
Share on other sites
Personally I handle learning in different ways, depending on the situation.

I've found that for learning how to use a library, reading code that makes use of it so you can see a visual result works best, along with reading the documentation. For file formats, I just... implement them in a way I can think of based on the information I have. For implementing concepts like trees and linked lists, just experiment, try things, see what works, see what doesn't.

But like Kaz said, it really depends on the person.

Share this post


Link to post
Share on other sites
Thank you so much for the valuable from all of your suggestions.
I think my problem is "I DO NOT CODING FOLLOWING THE EXEMPLE AFTER READ EACH CONCEPT, I JUST ONLY READ AND IMAGINE THE RESULT Oh....Gozzz"

So, today after I read all of your advised. I try to coding follow the one example (got from book).

This is example which I coded, see below code..
#include <iostream>
using namespace std;
class myfirstclass
{
public:
int number;
void greeting();
};
void myfirstclass::greeting()
{
for(int i = 0; i<= number;i++)
{
cout<< "Hello World \n";
}

}
int main ()
{
myfirstclass myfirstobject;
myfirstobject.number =3;
myfirstobject.greeting();
return 0;
}
==============================================
Then... I run it, sure +++ it work fine (becuz I copy all to paste it ;)

More over (by using your advised) I try to modified/alter the code... just some line/some snip code


this is modified completed version...

#include <iostream>
using namespace std;

// Class declaration
class myclass
{
public:
int n;
void greeting();
};

//Function definition of calss myclass
void myclass::greeting()
{
for(int i=1;i<n+1;i++)
{
cout<<"say"<<" "<<" "<<i;
cout<<" "<<"hello world\n";
}
}

//Program start here
int main()
{ myclass myobject;

//asking for count of hello world
cout<<"How many times would you like to say Hello world??";
int j;
cin>>j;

myobject.n=j;
myobject.greeting();

myclass *pTomyclass;
pTomyclass=&myobject;
cout<<"myobject is location address"<<" "<<pTomyclass<<"\n";

// string m;
// m=pTomyclass;
//pTomyclass=pTomyclass+1;
//myclass m;
//m=*pTomyclass;
//cout<<m.greeting;
// cout<<pTomyclass<<"\n"; // Fault on this line..... don't know why....

//char c;

//} while (int j>0);

char x;
cout<<"wait a minutes...";
cin>>x;
return 0;
}

===============
It can execute fine!!!!

But...I hard working to modifying the code before it can working follow my desire...I found many "error message" during compile the program...

I known that, I am often read the code/concept (C/C++) in the place without PC in front my face. DO this often.... often.... often


Just to show my practices after read your advised....for my conclusion...
It's seem that I need to back to read all concept from begining again..."Read and real coding, NOT ONLY Immagine....the code"


=================
Any comment and suggestion, pls. free fell to post ...
eniCma












Share this post


Link to post
Share on other sites
Quote:
Original post by eniCma
But...I hard working to modifying the code before it can working follow my desire...I found many "error message" during compile the program...


Good, and well done for getting through that process and actually getting it working. This is some of the most useful learning you can do.

Share this post


Link to post
Share on other sites
PhilMorton,
I have a question for you? how is the game community in Down Under?

eniCma,
Also, it is easy to understand the concept if someone explains to you face-to-face. Sign up for a programming class at AIT( Asian institute of Technology):)

Share this post


Link to post
Share on other sites
Coding and compling while or after you've read a tutorial or text in a book is probably the best way to learn. The only thing I find better is to implement it into an actual project, that is the ultimate way to learn something, atleast for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this