[nvda-addons] Re: Developing Addons - The best way to get started?

  • From: "Damien Sykes-Pendleton" <damien@xxxxxxxxxxxxxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Fri, 8 Apr 2016 16:31:44 +0100

Hi James,
Installing Python isn't the struggle. It's knowing what and what not to install. Python, and especially the NVDA codebase, seems to have so many components and subcomponents and subpackages and other things which don't make it remotely clear as to what is necessary and what is just extra blah.
Of course Python compares nothing to small, area-based, sandbox scripting languages such as BGT, AutoIt, AutoHotkey etc. However it seems to relate more to C++, which has so many variants I ended up uninstalling it out of sheer frustration because it didn't work how I would expect a language to work, and not just in the way it presents information neither.
My current everyday language is FreeBASIC which, though a fully fledged programming language, only installs the bare basics along with a bunch of helper headers so you can use various API's. All you have to do then is find the libraries you need. Modules are linked with #include, libraries are linked with #inclib, there you have it, compile yourself a nice executable program, run it, be happy. Python seems immeasurably different to that, both in the language and its components, and it's partly that difference that is frustrating. I want to be able to get to grips with it, but I've no idea where to even start.
I don't know. Sometimes I don't even know myself exactly what the issue is. Sometimes I feel like I'm drinking a large glass of water and then it comes straight back out, or there's not enough of it to get to where I need to be. I feel like I'm taking one step forward and two steps back sometimes.
Kind regards,
Damien.

-----Original Message----- From: James Scholes
Sent: Friday, April 08, 2016 4:04 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Developing Addons - The best way to get started?

Damien Sykes-Pendleton wrote:

and the way it works with classes seems different as well (take for
instance the class of AppModule(appModuleHandler.AppModule) which I
believe refers to a class inheritance, looks like it is inheriting
from a class property instead of another class).

No.  appModuleHandler is a Python module, imported using:
import appModuleHandler
AppModule is a class defined in that module, thus,
appModuleHandler.AppModule

appModuleHandler has a lower case A, so it isn't a class.  Note that I'm
not saying that starting your class names with a capital letter is a
technical requirement, but it is a coding standard upheld by most Python
programmers and can be seen throughout NVDA.  Instance variables,
function/module names, all start with a lower case letter and use camel
case.  This is all covered on the NVDA wiki on GitHub.

For the most part learning a new language has been easy for me, since
its only difference is usually with syntactical differences, but
Python seems to change more concepts than just syntax, hence the
reason I find it more confusing.

The examples you mentioned, e.g. lists and dictionaries instead of
arrays, is simply a case of differing termanology.  A list is an
index-based array.  A dictionary is a key-based, or associative, array,
similar to a hash map in other languages.

I think that perhaps the other problem I am facing is that, because I
generally wouldn't consider writing in Python in an everyday setting
and thus would only use it for NVDA addons, and NVDA can
automatically create the relevant files based on the source code, I
haven't installed Python and therefore only have NVDA as a testing
mechanism. I may be wrong, but I have thought before now that
installing a whole component when you would possibly only use a minor
percentage of it is rather pointless, especially if you then have to
learn to run it as a full system. In this case Python, which relies
on command line usage to run scripts, separate compilers to compile
them to binary, and other dependencies for extra functionality etc.

This is, of course, up to you, but if you want to write NVDA add-ons,
you need a better understanding of Python than you apparently have now.
If you don't want to take the couple of minutes it takes to download
the Python installer and try out the interpreter, there's probably not a
lot any of us can do to help you.  Also, Python is, at least not in the
default cPython variant, a compiled language.  Other versions of Python
have just-in-time compilers, but NVDA doesn't use or run under any of
those other versions, so you don't need to concern yourself with them.
--
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: 
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: