Is it worth learning? -
Splodyf23 - 18.09.2017
So I got into the very basic concepts of a few languages like HTML and Java. I had tried learning Pawn before, at the time I didn't know what "calling a function" meant. Now I am comfortable with it so I think I can learn how to Script with Pawn. So is it going to be worth learning to Script with Pawn?
I'm not asking how should I learn it, I have my sources to do so, but if you guys have an idea about how I should learn, It'd be appreciated.
Re: Is it worth learning? -
DBZdabIt3Bro7 - 18.09.2017
Quote:
Originally Posted by Kaperstone
|
Actually, use #pragma tabsize whenever you want, but as long as you write your code readable, removing the tabsize doesn't neccessariyl(TYR(&/

?) mean that your code is unreadable.
Take this for example:
PHP Code:
SetPlayerColor(playerid, strval("some color")),
printf("Some debug line, setting color to (%i)", strval("some color"));
This would return indention warnings in the PAWN compiler, but in reality, it's more readable now, because now we have connected two functions that has to do with eachother and we have tabbed the line that is not too important and can easily be removed or checked at.
Another example;
PHP Code:
#include <a_samp>
#include <another include>
new some_variable,
another_var;
enum maybeSomeEnumToo {
thatVar,
}
public OnGameModeInit() {
someCode();
return 1;
}
public OnPlayerSpawn(playerid) {
return 1;
}
This is more readable than doing the standard tab intention, so does this mean that every script using
Is horrible? No, it doesn't. I'm not saying everyone is using it properly, but if it's used properly, then you shouldn't complain about it.
Thank you.
Re: Is it worth learning? -
Kaperstone - 18.09.2017
Quote:
Originally Posted by DBZdabIt3Bro7
Actually, use #pragma tabsize whenever you want, but as long as you write your code readable, removing the tabsize doesn't neccessariyl(TYR(&/  ?) mean that your code is unreadable.
Take this for example:
PHP Code:
SetPlayerColor(playerid, strval("some color")),
printf("Some debug line, setting color to (%i)", strval("some color"));
This would return indention warnings in the PAWN compiler, but in reality, it's more readable now, because now we have connected two functions that has to do with eachother and we have tabbed the line that is not too important and can easily be removed or checked at.
Another example;
PHP Code:
#include <a_samp>
#include <another include>
new some_variable,
another_var;
enum maybeSomeEnumToo {
thatVar,
}
public OnGameModeInit() {
someCode();
return 1;
}
public OnPlayerSpawn(playerid) {
return 1;
}
This is more readable than doing the standard tab intention, so does this mean that every script using
Is horrible? No, it doesn't. I'm not saying everyone is using it properly, but if it's used properly, then you shouldn't complain about it.
Thank you.
|
It is always a better practice to write code with proper identation, especially when you're new to a language.
Sure, if you already know Pawn and you find it comfortable, go ahead if you wish to, but if another person needs to read it, you'll give him a hard time understanding that code.
You can resolve a single line identation issue by resetting tabsize to 4, like Y_Less already explained well here.
http://forum.sa-mp.com/showpost.php?...27&postcount=8
You can write however you wish the code, but it promotes a way to not write code in a single manner.