Bring your karma
Join the waitlist today
HUMBLECAT.ORG

Blind and Visually Impaired Community

Full History - 2022 - 01 - 22 - ID#sajguk
7
Looking for strategies to read code efficiently without sight (self.Blind)
submitted by Fridux
A few days ago someone asked whether blindness affected our ability to code, and I did reply that in my case it barely does, however when I said that I only thought about writing and reading my own code since that's what I do mostly, and now feel like I kind of lied because I do indeed have trouble understanding other people's code. Not only that but the fact that I cannot use certain tools is slowing me down tremendously. For example I'm working on a Rust project and, since the only way I feel comfortable writing code on MacOS is using TextMate which is not an IDE, or Xcode which does not support Rust's syntax, I'm affected by not being warned about syntax, type, or borrow checker errors as I type, meaning that errors accumulate and when I finally try to compile code after a week of writing I'm presented with hundreds of errors, some of which impossible to solve without a structural overhaul due to missing a borrow checker rule, so in fact when I really do think about it, blindness really slows me down a lot and I just don't notice because I'm getting used to it. Even when I use Xcode to write Swift or Objective-C, the fact that I'm not interacting with it visually means that I miss a lot of relevant real-time information about my code that could have saved a lot of time if I had noticed the errors earlier.

Lately I've been seriously considering finding a job as an iOS developer, because MacOS, iOS, and Linux are the platforms that I had and have the most experience with both pre and post blindness. However I'm afraid that I might not be able to face real world conditions both due to my difficulty reading code written by other people, which affects my ability to work with existing codebases or integrate a team, and also due to my inability to take advantage of all the information conveyed visually by IDEs, which affects my productivity. As compensation I thought about only asking for the minimum wage as I really don't need the money, however I doubt that even that would be enough since my income, which was considered reasonable back in 2011 when I quit my job due to vision issues, was only 4 times the minimum wage here in Portugal, and the minimum wage has increased a lot in the last few years, so I do not have a lot of margin to negotiate.

While I do assume that there's nothing I can do about not being able to take advantage of the visual information conveyed by IDEs, I do wonder how other blind programmers tackle the problem of reading code written by other people. Both Xcode and TextMate have an option in the accessibility rotor that allows quickly jumping from function to function, which kind of offsets the inability to scroll, but I still have issues with punctuation, because in order to avoid going crazy I have the screen-reader set to ignore some of it.. I've considered using a Braille display, but decent Braille displays are prohibitively expensive, and in addition I struggle a lot with Braille due to lack of practice, so I'd never be able to secure government funding as proficiency is a requirement, and I'm not feeling like wasting 4000€ of my own money on a Braille display that might end up collecting dust if I don't manage to become proficient or end up having problems with Braille support on MacOS.
alinatwirpx 3 points 1y ago
Code is written once and read a thousand times. Even after 3000 hours of practice, I read unfamiliar code about ten times slower than when I used my sight. Like you I turned off some punctuation. I use indent nav addon for NVDA for reading lines at one level of indentation. I don't understand why other people can read code so fast and I can't.
devinprater 2 points 1y ago
Have you tried Emacs with Emacspeak? It takes a minute or 5 to set up,, but I like it. Its keyboard-centric approach makes it really good for me, and it does have a Rust-mode package, and probably other stuff for Rust too, like managing... cargos? I think that's the rust package thing.
Fridux [OP] 1 points 1y ago
As a vim user, I gave Emacs a try once a long time ago before losing my sight, and back then I did not like the fact that many of its commands use the Control key, which only exists on the left side of the keyboard on Mac laptops. Some people mapped CapsLock to Control instead, but that doesn't work for me since I actually use CapsLock for its intended purpose, it suffers from not being available on the right side of the keyboard just like the Control key, and nowadays I also use it for VoiceOver. However while researching the subject before replying to you I actually learned that Emacs can be configured to use the Command key instead, which exists on both sides of laptop Mac keyboards so it might actually work for me. Not only that but I've also been wanting to buy a Raspberry Pi to use as a Linux desktop and have been put off by the potential accessibility problems on Linux, but if Emacs can replace an entire desktop like I learned in my quick research, then it might actually make it possible for me to use Linux fully independently again, Therefore I'll definitely give Emacs another try with Emacspeak.
devinprater 1 points 1y ago
If you use RailwayCat's Emacs-mac homebrew cask, you can map command to Control in Emacs, and have one on both sides.
toastertop 2 points 1y ago
While this is not really addressing what you asked. Can you not create an auto build step to compile on save? That way you be made aware of issues sooner. Test driven development may be of use too
Fridux [OP] 1 points 1y ago
Checking code on save is what Xcode already does: it saves code a couple of seconds after you stop typing, checks it, and uses syntax highlighting on errors. This is completely useless to me, but I think it's the only practical way around the problem of having to search for expected errors in a sea of known issues, which is what I would have to do with Rust and TextMate if I actually ran cargo check on save.

As for test-driven development, while I do write extensive tests, I only do so after I'm satisfied with the interfaces that I've designed, as I think that the design by contract that test-driven development implies makes it very easy to design interfaces that set unrealistic expectations that are more likely to require refactoring both the code and the tests.

In any case I think you're right that I should aim at leaving the code in a state where it does compile and can run tests as often as possible. I do admit that I get carried away and only compile and run tests on code once the feature that I'm working on is fully implemented, and I've never introspected on why I actually do this.
toastertop 1 points 1y ago
I think just creating a git branch before working on the next feature as at least you'll have some to refer back to when was working last
Fridux [OP] 1 points 1y ago
I said that I agree with you when it comes to making sure that code is compilable and testable as often as possible, but I really don't understand how what you're saying now solves any of the problems mentioned in my original post or relates to my previous comment. Can you elaborate?
mdizak 2 points 1y ago

I feel ya. All I can say is "cargo run" every 10 minutes, haha.

I'm in the middle of a couple Rust contracts myself, both of which were well underway by the time I started. I know what you mean by working with other people's codebases, especially when they are large and using a more complex language such as Rust.

Couple things I did to tackle this. First, one of the senior devs on the project gave me access to the repo and told me to read through the code and familiarize myself with it. Aside from browsing through the file / directory structure, I didn't really bother, and instead just asked for an objective. I'm not about to spend hours aimlessly reading thousands upon thousands of lines of Rust code via screen reader, as that's just pointless.

Instead, I pressured them into giving me objectives, but told them to keep the objectives small and focused for the time being. I clearly told them, don't just throw me three pages of specs and expect me to hammer it out, because that's not going to happen. Instead, give me small and focused objectives -- add a function that does this, modify this function at accept these arguments, add these fields to these few structs, et al.

Then I basically find myself playing a game of hide and seek within the code base, but I know what I'm looking for and am aiming to accomplish. This has worked quite well because as I'm completing these small tasks, I'm naturally learning the codebase more and more. After a while, I get to a point where I'm comfortable enough with the codebase that I'm capable of taking on larger and more complex tasks.
No-Satisfaction7842 2 points 1y ago
I am a software engineer but I have little experience using a Mac and no experience writing iOS apps, so I can’t give you much specific advice there. The two main IDEs I use our Microsoft visual studio and VS code, both of which are extremely screen reader friendly in my experience.

I totally know what you mean about thinking everything is fine and then realizing you are missing things or moving at a slower pace than your sighted colleagues. That said, the more you master the shortcut keys of your IDE of choice and really get comfortable with the layout and all the debugging and code review tools available in it, the faster and more efficient you will become. At this point I hardly feel like my being a screen reader user is slowing me down in comparison to my peers but I definitely felt that way for the first few months.

I’m also blessed to be working with several really great senior developers who are very generous with their time and knowledge, so I feel like I’m learning from really talented people who are willing to be patient with me considering I do things in a very different way.
Fridux [OP] 3 points 1y ago
My problem aren't the shortcut keys, as I'm very used to them already in Xcode. My issues are not being able to take advantage of syntax highlighting to fix errors right when the language server notices them and having the reading comprehension of a newbie when it comes to code written by others.

Elaborating on my first issue: as an IDE Xcode is capable of highlighting not only code that is not syntactically correct but also code that is not semantically correct, and as a blind programmer I cannot take advantage of this. As a result the only way I can tell whether there are errors is by attempting to compile the code and checking the Issue Navigator, at which point lots of errors have already piled up as wrong assumptions accumulate and I have to spend hours fixing them all. In addition I cannot use the modified mouse combinations to jump straight to the documentation or the definition of identifiers, cannot see tooltips when typing or hovering over identifiers with the mouse during a debug session,, and cannot even use certain debugging tools such as the memory graph which is very useful for detecting memory leaks caused by strong reference cycles. This has a very strong and negative effect in my productivity that I'm already getting used to but figure will cause issues if I decide to work as a developer again, however I'm not even asking for solutions to this problem in particular because I don't think they exist.

What I want to learn is what other totally blind programmers do to actually understand code written by other people, as to me that's a more pressing issue. I can live without pretty much all the quality of life offered by IDEs, but I doubt that I can survive professionally with my very limited ability to read unfamiliar code, and I fear that both issues combined might devalue me below minimum wage..
No-Satisfaction7842 1 points 1y ago
Yeah, those are good points. Even with visual studio which is really accessible in windows, some of those in-line helpers you mentioned for quickly identifying errors and such aren’t fully screen reader compatible. It would be cool if there was an option short of building/compiling, such as, “gather errors,” that would quickly put all those things into an easy to navigate list box or something so we could review them.

As for reviewing others code, does your team use GitHub? Code reviews on the GitHub website seems to be fully accessible. To be honest, I’m pretty new at my job still and haven’t had a ton of exposure to reviewing other peoples code, at least not doing deep dives, so perhaps I just haven’t encountered the types of challenges you have, yet.
Fridux [OP] 2 points 1y ago
I don't have a job yet, and my concern is more about navigating existing codebases or having to modify or understand code written by other people in my team, not as part of a review but as part of the normal development process.
No-Satisfaction7842 1 points 1y ago
Oh OK, understood. So if I’m hearing you correctly, it sounds like there are two related but distinct concerns, yeah? First, there are concerns about using the IDE to identify errors because of non-screen reader compatible features, and then there’s also the concern about how you will read and comprehend others code, whether or not it’s part of a formal code review. Is that right?
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.