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

  • From: James Scholes <james@xxxxxxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Fri, 8 Apr 2016 16:04:49 +0100

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

Other related posts: