20.08.2017, 19:33
Sure. The main ideas are to easily get access to a lot of powerful libraries such as the ones I mentioned, being able to use readily-available development tools more easily as Pawn is a rather unknown programming language, ease development and debugging by using a faster to read/write language and its built-in reloading features to see your code edits in real time, and so much more.
In general, it kind of goes the other way around from what your interesting response suggests: the idea is that people either don't know programming at all and would have an easier time learning Python, or they already know programming in which case Python is easier to pick up - assuming they don't know it already - than having to deal with all of the intricacies, limits or even outright built-in flaws of the pawn language and VM in everyday development.
Oh, and one major difference with Python is that it can ACTUALLY land you a job in real life. (I know it, because it's my job...)
In any case, Python is far more powerful than pawn - you can do extremely complex things with only a few clear lines of code. For example, Python's ConfigParser is more powerful than dIni or even y_ini ever could be ; its JSON stdlib is extremely easy to use and allows much more flexibility than ini ever would.
That's not even mentioning the extremely powerful libraries I mentioned above such as requests, which is way easier to use than trying to do HTTP using pawn - also more reliable, and supports HTTPS. Still not convinced? See it for yourself.
EDIT: Also, IMHO doing that "just to learn the language" would be a waste of time, it's really at the bottom of my list of priorities. I'm just trying to make everyone's lives easier.
EDIT2: If you're still not convinced, here's a little excerpt from my code for loading a given vehicle from SQL:
Notice the much easier syntax, and the very low amount of lines. Notice the dictionary structure that is being used to store the paintjob (could be an array for this specific case, but the point stands). Also notice the double assignation, which can't be done in pawn. This is only a few of the many features that makes your life easier and your development faster in Python.
And here is how I load all vehicles when the Python script starts:
For reference, in normal pawn + MySQL, you'd have to type "select id, model, pos_x, pos_y, pos_z, ... from cars" and then the whole mysql_store_result() thingy and mysql_fetch_row() etc etc... So much work for nothing.
Notice the use of a real iterator over the SQL results, which is a feature pawn doesn't have.
In any case, please keep in mind that I'm not here to argue about what makes Python good, but rather trying to see if the current community cares enough that it's worthwhile for me to make a tutorial.
EDIT3: You might want to go see the original plugin page and especially the "command processing" part. Notice how it's even easier than zcmd or ycmd.
EDIT4: TL ; DR: Python makes your life easier. Yes, there are MANY benefits, but you asked for it!
In general, it kind of goes the other way around from what your interesting response suggests: the idea is that people either don't know programming at all and would have an easier time learning Python, or they already know programming in which case Python is easier to pick up - assuming they don't know it already - than having to deal with all of the intricacies, limits or even outright built-in flaws of the pawn language and VM in everyday development.
Oh, and one major difference with Python is that it can ACTUALLY land you a job in real life. (I know it, because it's my job...)
In any case, Python is far more powerful than pawn - you can do extremely complex things with only a few clear lines of code. For example, Python's ConfigParser is more powerful than dIni or even y_ini ever could be ; its JSON stdlib is extremely easy to use and allows much more flexibility than ini ever would.
That's not even mentioning the extremely powerful libraries I mentioned above such as requests, which is way easier to use than trying to do HTTP using pawn - also more reliable, and supports HTTPS. Still not convinced? See it for yourself.
EDIT: Also, IMHO doing that "just to learn the language" would be a waste of time, it's really at the bottom of my list of priorities. I'm just trying to make everyone's lives easier.
EDIT2: If you're still not convinced, here's a little excerpt from my code for loading a given vehicle from SQL:
Код:
def load_vehicle(car_id): car = session.query(Car).get(car_id) if not car: return vehicle_id = CreateVehicle( car.model, car.pos_x, car.pos_y, car.pos_z, car.rotation, car.color_1, car.color_2, -1, ) vehicle_paintjobs[vehicle_id] = paintjob = car.paintjob ChangeVehiclePaintjob(vehicle_id, paintjob)
And here is how I load all vehicles when the Python script starts:
Код:
def OnPyInit(): for car in session.query(Car): load_vehicle(car.id)
Notice the use of a real iterator over the SQL results, which is a feature pawn doesn't have.
In any case, please keep in mind that I'm not here to argue about what makes Python good, but rather trying to see if the current community cares enough that it's worthwhile for me to make a tutorial.
EDIT3: You might want to go see the original plugin page and especially the "command processing" part. Notice how it's even easier than zcmd or ycmd.
EDIT4: TL ; DR: Python makes your life easier. Yes, there are MANY benefits, but you asked for it!