-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated STYLE.md for code formatting consistency #9
base: master
Are you sure you want to change the base?
Conversation
The prior style reference re: printing code output seemed inconsistent; especially in cases where multiple functions are within a single code block, it may at times be nonobvious whether the commented output refers to the function above (correct), or below (incorrect). This new code formatting reduces this ambiguity and is more consistent with the expression output syntax.
Good points! I agree that situation can be confusing. I have the following concerns, though:
I'm not sure if it affects your code very much since when you have multiple print expressions it's really clear which one causes which print statement, I believe. As a counter-proposal, we could drop the extra space and just do: some_expression
# Some printed output |
Great point re: accessibility - I wouldn't have considered the "space, space, space" audio thing. Though I'd suggest that this also renders our current formatting somewhat moot: as an example, the code segment, expression() # => True May read out "expression open parentheses close parentheses space hash equals greater than space true," - and I can imagine that the nice implication sign that we've devised (which I find to be a handy visual) then becomes a source of confusion for people using screen readers. Let's follow up in person in our sync today? |
Sure! I will briefly drop this resource in here that points out that reading punctuation is really difficult. Some of these decisions are actually design decisions that the screen readers have made. It's often preferable to read out the punctuation in these expressions rather than create confusion by omitting them. Also, I don't think that you gave the correct readout because the screen reader wouldn't read the spaces (just like it doesn't read spaces between words). Finally, someone could create a macro that reads Okay, looks like I accidentally gave a more detailed answer. Sorry for getting carried away – this is just something I'm really passionate about! |
I didn't know that about screen readers - that was interesting to learn how some punctuation is read and some omitted, thanks for sharing the resource! 😊 I hear what you're saying about the macros, but I don't think we should rely on someone making a macro for the use case of this symbol in our course - just something to keep in mind. Also, a question - do you know what screen readers do re: indentations in code? Since I can't imagine that a Python expression within an if statement within a for loop would be read as "space space space space space space space space space space space space expression," I suspect there's some functionality built in to manage repeated spaces. The question is whether it would kick in after a hash symbol, or whether it would only kick in if the spaces are leading padding on the line. |
Not sure how, but it looks like they made it into this PR anyways. I'll leave it to @cooper-mj to update the print statement things we discussed.
The prior style reference re: printing code output seemed inconsistent; especially in cases where multiple functions are within a single code block, it may at times be nonobvious whether the commented output refers to the function above (correct), or below (incorrect). This new code formatting reduces this ambiguity and is more consistent with the expression output syntax.