Re: First steps in addon development


 

Hi,
NVDA versions and user environments: while I have NVDA alpha builds installed on my computer, I have several portable copies designed to test add-ons under beta, stable, and portable alpha releases.
As for code disassembly, don't do it as part of the first add-on. Only if you really wish to know the internals of Python execution model and/or need to optimize add-ons for size and/or speed should you learn about the "dis" module.
Regarding lint results, mostly comments and/or trying to keep statements under line length limit (110 characters per line if using NVDA's lint configuration).
Type hints are useful (you may come across these while looking at NVDA source code), and more so as running tools such as Mypy will find bugs after annotating code with component from typing module.
As for the add-on development guide: I think you might be thinking about NVDA's own development guide. The one I'm talking about is:
https://github.com/nvdaaddons/DevGuide/wiki/NVDA-Add-on-Development-Guide
Cheers,
Joseph

-----Original Message-----
From: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> On Behalf Of Ramón Corominas
Sent: Monday, August 15, 2022 7:19 AM
To: nvda-addons@nvda-addons.groups.io
Subject: Re: [nvda-addons] First steps in addon development

Hi Joseph, thank you very much for your quick and detailed answer!

> No IDE, just Notepad++ & command-line tools

Well, I'm now in my transition to using VSCode as my primary editor after years of coding using Ultraedit and I'm interested in any experiences with different editors. I tried Notepad++ some time ago but I had some accessibility problems with it, maybe I can give it a second chance...


> I keep latest versions of various NVDA development builds (channels) so I can replicate user environments.

Could you please elaborate this? I'm not sure of having understood it.
Anyway, I assume this is because some of your addons are somwhat complex or interact with the system and you need to test them very well, isn't it?


> I use what I wrote initially – NVDA add-on development guide

Yes, I've read that and it's great for understanding the basics of how
NVDA addons work . Regarding that guide, I'm curious about the remote
python console that is mentioned in the last part of that guide... Do
you know how it works? I've managed to launch it and I see that the port
is listening, but I don't know how to connect to it to send python
commands and obtain the results, if possible.


> I disassemble Python bytecode as part of optimization work from time
to time (a topic that requires a dedicated thread to discuss as it is
quite advanced).

I didn't know that this was even possible... It would be great if you
could elaborate a bit more, I'm now intrigued 😉


> NVDA screen reader development setup, complete with Visual Studio
2022 Community ...

You mentioned that for editing code you use Notepad++, I suppose you use
Visual Studio Community just for builds and not for coding, isn't it?


> Flake8 (linter)

Is this a command-line tool? I've seen some settings in VSCode to use
flake8, but I don't have much experience with linters and I guess that
it will need some setup. Is there a particular setup for NVDA's code?


> Here are four example add-ons to showcase them:

Thank you very much for these examples, they will be great for my
learning. I also did a quick read of your articles about specific addons
you developed and I'm sure I will learn a lot from them! ☺


> I also include type hints, lint results, and lots of source code
comments.

I also try to use type hints, but sometimes I find it difficult to
define the arguments' types when they are not native or accept multiple
types, any hints on type hints will be appreciated 😉. I don't know what
are those "lint results", could you please elaborate on this?


> As for my add-on development methodology, I tend to follow agile,
iterative development method

Hopefully I'll understand agile... Someday... 😂


> 1. Read and write a lot
> 2. Have clear and reasonable set of goals
> 3. Test and test again

Although I'm not new to programming, I am a complete newbie to NVDA's
code and I think these are three of the best tips on programming that
I've ever received! In particular, the second one is a very good
reminder, everytime I learn something new I feel so excited that tend to
explode on ideas for "solving" everything 😂


> learn to remove color from pictures.

Great tip, too, as developers we tend to forget that we are working for
users and that we need to know how they will use our apps... Thanks!

Cheers,
Ramón.

Join {nvda-addons@nvda-addons.groups.io to automatically receive all group messages.