Becoming a Better Scripter -
TKZ227 - 24.05.2013
Before we get started, I would like to say a quick word about myself. I am capable of scripting just about anything realistically necessary for a SA-MP server at this point in time (or rather the majority of things).
That being said, I am looking to gain a more "fundamental" knowledge of scripting for SA-MP. I have no other programming experience except for Pawn.
I have found that Pawn is a "C-like Scripting Language." If I want to learn more about the basics/syntax of Pawn, should I learn about C? If so, are we just talking about C or C#, C++, etc. I'm not really sure how to tell what I should be learning.
Also, if you already happen to know some good resources to gain a better understanding of the fundamentals of programming in a C-Like scripting language please let me know!
Re: Becoming a Better Scripter -
Scenario - 24.05.2013
I'm probably wrong about this, but I believe C# is the closest C-language to PAWN (out of C, C# and C++ that is).
Respuesta: Becoming a Better Scripter -
kirk - 24.05.2013
C# and C++ are object orientated, C is the one similar to pawn, just similar, if you want to become a better scripter to script with pawn, just learn about pawn, C has plenty of things pawn doesnt have and never could be used on pawn, but yeah i suggest you learn C++ if you have time, you will understand many things and depending from where you learn C++ you could probably improve your scripting.
Re: Becoming a Better Scripter -
Bakr - 24.05.2013
If you want to learn more about Pawn, read the Pawn documentation. Despite it being like C, it is a separate language.
Re: Becoming a Better Scripter -
TKZ227 - 24.05.2013
Like I mentioned earlier, I have a general understanding of Pawn (and I can script almost anything in it). The real information I'm looking to learn are the basics of the language itself. For example, I feel like I should be able to answer the questions below:
What do the compiler flags "-d", "-O", and "-a" do?
When would "static stock const" be appropriate as a symbol declaration?
I wish to run two different pieces of code, each once per second. Should they be combined in to a single timer, run as two separate timers, or done in some other manner? Explain your answer.
Give two reasons why a macro might be used instead of a function, and two reasons why a function might be more appropriate.
-------------------------------------
What would be the best way to learn how to answer questions like this?
Respuesta: Re: Becoming a Better Scripter -
kirk - 24.05.2013
Quote:
Originally Posted by TKZ227
.........
-------------------------------------
What would be the best way to learn how to answer questions like this?
|
Experience and self-understanding, study the pawn language, understand everything about it abstarct machine and the language itself, read and understand the pawn documentation just that, i know C, C++, java, assembly 8086 ..., ProLog .. but i never mastered pawn itself, so if your main goal is learn pawn then study pawn, if you wanna learn to program in any other language buy a book.
Re: Respuesta: Re: Becoming a Better Scripter -
TKZ227 - 25.05.2013
Quote:
Originally Posted by kirk
Experience and self-understanding, study the pawn language, understand everything about it abstarct machine and the language itself, read and understand the pawn documentation just that, i know C, C++, java, assembly 8086 ..., ProLog .. but i never mastered pawn itself, so if your main goal is learn pawn then study pawn, if you wanna learn to program in any other language buy a book. 
|
So do you need to do this sort of thing with every language? Will learning the Pawn language in depth make learning C++ any easier in the future?
Re: Becoming a Better Scripter -
SchurmanCQC - 25.05.2013
Quote:
Originally Posted by RealCop228
I'm probably wrong about this, but I believe C# is the closest C-language to PAWN (out of C, C# and C++ that is).
|
I believe you are in fact wrong here. C is closest to Pawn. C# incorporates classes and namespaces and the likes...
Re: Becoming a Better Scripter -
Scenario - 25.05.2013
Quote:
Originally Posted by SchurmanCQC
I believe you are in fact wrong here. C is closest to Pawn. C# incorporates classes and namespaces and the likes...
|
Figured as much!
Respuesta: Re: Respuesta: Re: Becoming a Better Scripter -
kirk - 25.05.2013
Quote:
Originally Posted by TKZ227
So do you need to do this sort of thing with every language? Will learning the Pawn language in depth make learning C++ any easier in the future?
|
Yes it would make it a bit easier, but its not the same anyway.