Bring your karma
Join the waitlist today
HUMBLECAT.ORG

Blind and Visually Impaired Community

Full History - 2022 - 05 - 10 - ID#umslt3
20
Question for fellow blind software engineers (self.Blind)
submitted by blind-coder
When you're working with a piece of code that has numerous levels of nesting (indentation), how do you keep track of how deep you are in the nesting? For example, right now I'm trying to make sense of a lengthy SQL query with numerous joins and subqueries and I'm getting totally lost. I use NVDA and have it set to emit a tone indicating indentation level but this isn't enough to help me keep track of it all in my head. Ideas / tools welcome!
LID919 12 points 1y ago
I don't need text to speech, but when I'm writing code with deep nesting one of my practices is to leave a comment at the end of each block relaying the block I'm exiting. For example:

void myFunction()
{
while(globalBool)
{
if(globalFlag)
{
anotherFunction();
} // end if(globalFlag)

else sleep(1000);
} // end while(globalBool)
} // end myFunction

This might be more convoluted in SQL than in C style languages, but it could be a style that could help.
codeofdusk 6 points 1y ago
I had an (also blind) manager at Microsoft who did things like this. Personally, I set my screen reader to announce indentation, and keep enough state in my head that I have an idea what “8 spaces” or whatever refers to.
[deleted] 5 points 1y ago
[deleted]
aNonHumanRobot 1 points 1y ago
This is the best answer in my opinion and is what I do as well. I don't use text to speech but this helps me so much.
oldfogey12345 9 points 1y ago
Wow! It looks like a lot of blind coders are here.
[deleted] 5 points 1y ago
[deleted]
jas122021 5 points 1y ago
I think so, too. I attended the 2022 APH Coding Symposium webinars today. There is definitely interest in this topic across communities.
retrolental_morose 3 points 1y ago
I'd join, but it'd be quiet.

I just learned some Google App scripting for work today. cool stuff
Nighthawk321 2 points 1y ago
/r/BlindDevelopers
[deleted] 1 points 1y ago
[deleted]
TechnicalPragmatist 2 points 1y ago
Don’t code quite yet but want to try my hand at it right now I am more in the information technology side of things but would definitely be interested.
DeGeaSaves 4 points 1y ago
I’m blind in one eye and am baffled by coders. This is so cool to see.
oldfogey12345 3 points 1y ago
Actually, programming is one of the most accessible jobs there is for people with that aptitudude. You basically have extremely talented people writing text files.

The tech has been around for several decades to do that.
BeforeSides 9 points 1y ago
I use the NVDA beeps bit as well for Python but also make use of the spoken indent level sometimes. It’ll announce “4 space” or “12 space” and so on. There’s also a few VS Code extension called Indentnav that lets you jump to blocks of indentation, jump to the parent or child blocks, and move only within the same block. Think there’s an NVDA add-on that’s needed to make it work properly though. When I’m back at work tomorrow I can get the specifics if you’re interested.
[deleted] 2 points 1y ago
[deleted]
Fridux 4 points 1y ago
Some editors have the ability to match pairs of parens, brackets, braces, and quotes. In TextMate 2 on MacOS, for example, pressing Control+Up/Down (requires disabling the global functionality assigned to these shortcut keys) inside a pair of parens, brackets, braces, or quotes will jump to the enclosing opening or closing character respectively, reading the line on which the cursor landed in the process. Visual Studio Code, which as I understand it works well with screen-readers on Windows, can do that as well.
codeofdusk 3 points 1y ago
In Emacspeak, placing point on a closing symbol and waiting for a second will announce the line containing its matching opening symbol.
Arqeria 4 points 1y ago
You can have it speak as well as beep, which helps a lot. If you don't want this to happen whilst you're doing other things, you can make a configuration profile for your text editor of choice. Beyond that, it's just a matter of getting used to it. I'm not aware of a more efficient solution.
mehgcap 3 points 1y ago
Apart from what others have said, I think modifying the query's structure can help. I've found over the years that following specific rules really helps me keep track of things. For instance, every where condition, every join, and every group or order by is on its own line. Subselects have the opening parenthesis on the line where they start, then all their code indented on subsequent lines. For instance:

```
select column1, column2, s1.column4
from table1
join table2 on table2.ptID = table1.id
join (
select someColumn as column4, id
from table3
) sub on sub.id = table1.id
where table1.id in (1, 3, 7)
order by table1.id
```

I sure hope that example makes sense. It's early, and I'm writing this on my phone. It should give you an idea of the way I structure things, at least. Of course, you don't have to use my rules. My point is that making rules which make sense to you, and which you always follow, can really help to clear up what a query is doing.
nadmaximus 2 points 1y ago
I'm not blind, but I am a developer. I wonder if this $1 idea has ever been produced commercially. The link is a .pdf, I hope it's readable.

Apart from that, I would say that keeping proper track of nesting is annoying whether you can see or not, and relying on indentation to guide you can bite you in the butt, because in many languages the whitespace is irrelevant. So, generally speaking I add comments to at least the closing of a nested block.
fireborn1472 1 points 1y ago
Braille. Always braille.
This nonprofit website is run by volunteers.
Please contribute if you can. Thank you!
Our mission is to provide everyone with access to large-
scale community websites for the good of humanity.
Without ads, without tracking, without greed.
©2023 HumbleCat Inc   •   HumbleCat is a 501(c)3 nonprofit based in Michigan, USA.