Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @30Investment banks are about investment banking, by which I mean that you have confirmed a rumor/story/etc that I have heard from many directions over the years, namely that investment banking doesn't actually have cool tech because they're investment bankers who care about investments, not programming. I'm sure the HFT guys have cool tech (and I've even seen some--the disruptor pattern ate the world for a while), but HFT is kind of a special snowflake and they don't have a choice.There's nothing wrong with haskell. I even like it. But my personal projects are all audio stuff with tons and tons of mutability, and my professional projects are either microservices galore or the sort of stuff where only C will do, so my now-dated knowledge of it is sitting on the metaphorical mental shelf gathering dust, because at the end of the day Haskell is only really a good fit for a small subset of problems. URL: https://forum.audiogames.net/post/530314/#p530314 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @29 Yeah, I was really shocked by how little regard for having neatly styled code, commits, repos, and so on my work had in general. To be honest, the way it sometimes feels like is that we are playing at being a tech company, basically just copying whatever google or amazon was doing a couple years back at any given time.It definitely highly depends on which team you're in. I don't want to name the specific company but think of 3 mega huge investment banks and it is mostly definitely one of them. So being mega huge, it has many tech centers over the globe and at least 10s of thousands of software engineers. Approach of each team highly depends on the team lead.My lead is really cool guy, but is happy as long as the code is readable enough and he uses the same commit message for each commit in a feature branch. Not sure who started this strange and unhelpful practise, I think it is because intelliJ autopastes the last message when you open up commit dialogue, but half of the team does that. Then when I bring it up, one of the guys who does it says that's just how everyone else does it... smhI think it's probably an exception though, and other teams probably care more about such things, but not sure since I haven't looked at any other team's codebases.In regards to Haskell, that's cool, it's not for everyone. Not everyone wants to spend two months relearning how to code all over again. Just wanted to share how I handle indentation for it. Honestly I've never had a problem with code that doesnt use that convention for having regular indentation because I have it announced by tones since I am just looking for whether there is a increase or decrease. Also in such a case if I want to add a new line in the blockthen my editor will help me make sure it's lined up with prev line. So whether I am reading such code or making changes to it, I haven't had a problem with that. URL: https://forum.audiogames.net/post/530295/#p530295 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @27It sounds like your work is somewhat exceptional in that they allow for bad coding practices. My work is not nearly so lenient with respect to style, and I'm surprised to hear that an investment bank wouldn't be strict on this stuff for the sake of reliability. But then everyone says investment banks overall aren't so good at tech, so maybe that's not surprising. Most of what work does is C, part of what work does is a custom database, and both our CEO and CTO are programmers, so perhaps we're more strict because of that.I know about the Haskell indentation trick, but that doesn't help if the Haskell codebase in question doesn't use that style. My primary reason for not using haskell for personal projects is simply that it's not a good fit; if you want you can even use braces with it.You can't do a per-repository formatting config unless everyone uses the same editor or you have a formatting tool that's sufficiently flexible. I think using the same editor is more common in JVM land, but usually by the time anyone's thinking about "maybe we should use clang-format" the ship has sailed. URL: https://forum.audiogames.net/post/530213/#p530213 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. hi,@24, as someone who contributed to SoLoud, PyInstaller, etc, this is true everywhere.people tell you to do that with the style in mind (this is why projects make a contributing.md file in GitHub).also the line ending is important (I broke that once due to a mistake then my code got rejected). URL: https://forum.audiogames.net/post/530196/#p530196 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. I work at an investment bank on large codebases and it is true you cant just mash the autoformat button on files you are altering for a feature, because it might possibly reformat the whole file and the diff will be a huge mess to figre out what is actual code changes and what is just formatting changes. To get around this what I do is if I create a new file in a project I can feel reassured I can mash the autoformat button all I want and I am very happy. If I am altering an existing file I still use autoformat, but I just select the region of code I've edited and autoformat that, so the rest of the file remains unchanged for the diff. Problem solved!It can still be a big pain, since I still tend to manually check diffs before pushing to make sure I didnt push something weird. But to be honest a lot of my teammates can be super sloppy with their PRs, pushing massive amounts of whitespace-only changes along with a feature implementation, or just reusing the same commit message for all their commit messages. a good reminder that just being blind won't make you a worse programmer by default compared to a sighted developer. many sighted devs have personality issues like sloppiness. also churning out code changes at a sllwer pace isnt a bad thing, as long as those changes are of generally a higher quality.Looking back, the best strategy in my mind would be to set up a formatting configuration that is commited to the repository and so the whole team uses and to set up editor to autoformat on file change. would save most of these headaches and would make the code much easier to read. many times i will actually just autoformat a file just to read it when exploring a codebase since the current formatting is so poorr, like not having spaces after commas so it is like:def foo(bar,bas,args,kvargs):instead of:def foo(bar, bas, args, kvargs):another thing in some of our repos that makes me want to become an axe murderer is various instances of ninja programming, namely single letter variable naming. in one scala codebase there are so many instances of things likecase DataCacheEntry(a, b, c, d, e) =>...it just makes me want to git blame trace down who introduced such sadistic code and ask them how they can be so incredibly cruel.@15 at first indentation in Haskell seemed extremely painful to me, but it's actually really easy because if you follow some conventions then you can just do regular indentation like in python instead of needing to count spaces to make sure it lines up with previous column. let me give an examplefoo = bar * bas where bar = 42 bas = 1this is how it is usually shown, where bas needs to be lined up with bar in the where block for it to parse. super pretty for sighted people but annoying to format. however if you just start the where block on the following line then you can just indent by another regular unit (2 spaces here) and just follow the same regular indentation in the block. rewriting prev example:foo = bar * bas where bar = 42 bas = 1btw if you think that this is just a blindy thing to do and people in industry would complain, I've actually seen this convention used in a lot of haskell codebases so a lot of sighted devs prefer this convention as well.thanks for reminding me i could just set up a shortcut for toggling announcing of indentation. I gotten so used to my combo that I dont even think about it, but a single key is more useful indeed. and just took me half a minute to set up.for anyone else for reference, justnvda + n to open nvda menup to open preferencesn to open input gesturesshift+tab to go to search and type in indenttab back to tree and this command should be on top.alt + a to add key binding URL: https://forum.audiogames.net/post/530134/#p530134 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @!25Through a very significant amount of manual pain where you do git diff or whatever and find the parts that are just indentation/whatever and figure out how to reformat them so they don't show up in the diff when you pass it off to a code reviewer. If you are in a situation where you have to fix this and you didn't plan for maybe needing to fix it before you pushed the button, you're screwed.Alternatively you reset all your changes to the upstream and redo the patch from scratch.Which is why I don't pound on those buttons. If I do have to pound on those buttons, I commit my changes before hitting them so that I can just git reset --hard to whatever I had that was right before I tried modifying the style in some automated fashion (warning: git reset --hard can and will eat uncommitted work). URL: https://forum.audiogames.net/post/529934/#p529934 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Thanks for explaining. currently, since I mostly create programs for learning purposes, I do try to at least make sure that I can do the indentation as correctly as possible, (Or what I think it to be correct,) and I think that asking someone who is already has contributed to a project, or is working on a project, (If in a company,) for explanation of style should work fine.By the way, how do you fix a mistake like that? as in the editor made a mistake, and now you have to fix it? URL: https://forum.audiogames.net/post/529928/#p529928 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @22I'm saying be ready for your editor to fail you in a big way, and work on understanding why indentation and other parts of style exist. You should definitely use your editor when possible, but your editor is going to screw things up at some point, and in general going to the edit menu and hitting reindent this file isn't something you can do, since it will touch code that you're not working on as well. That holds true for anything else in the edit menu that's going to "fix" things. When you push those buttons, Git starts including those changes in your diffs or whatever, and your code reviews become an exercise in "can the reviewer spot the real changes?" which everyone hates.For open source you'll want to be able to at least mostly match the style, but otherwise just contribute. You're giving them your time for free, and they'll probably work with you (at least if your target project has a good community). When I did Rust, no one told me to get lost because I didn't have spaces in all the right spots, they pointed them out and said they needed fixing. Same at my current job at the beginning. People aren't going to just shut you down, as long as you actually figure out how to deal with it in the long run. But if your code currently has no consistency or is obviously written by a blind person, you should work on fixing it. URL: https://forum.audiogames.net/post/529919/#p529919 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. hi,beside the indentation, you need to be careful with variable naming (many of the companies don't use underlines at all, python classes are different as the operators require that), or in C++ they may prefix members with m_ or pointers with p_ (hungarian notation)for your own projects, go with whatever you want, noone can tell you anything.but when you are in a company, you should follow some standards.as someone who could see the screen before, I have to tell you that many of the people are dependent on their vision, and this is the reason that they can code faster and the style is the whole reason of faster coding for sighted.the reason that python uses indents rather than braces is readability of the code (I'm talking about sighted, not blind), so faster coding and less confusion. URL: https://forum.audiogames.net/post/529837/#p529837 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @Camlorn:So what you are saying that we should not rely on our editors for indentations and such, and we should do the formatting by hand?Sorry if I sound confused, when the thread gets so detailed, I tend to lose what everyone is trying to say.Also, aside from this, what other skills would you recommend before a blind programmer tries to contribute to open source? URL: https://forum.audiogames.net/post/529815/#p529815 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. The issue is that you've not worked on a large enough codebase. Your tricks for this work only when you're starting new files/modules/etc. It's not so much about team size--this can come up with just 2 people even--but about whether or not your patches touch existing things or not. But some style examples from work, which are also used by (I think) FreeBSD:1. Indentation is tabs, which are 8 spaces. But if you continue an _expression_ from the previous line, you do 4 spaces, and thus the indentation is mixed.2. There must be a space after for, if, etc. because they're keywords.3. In _javascript_, you have to have a space between function and () if the function is un-named.4. Functions which return void still need to end with a return statement.5. \ line continuations when defining macros need to line up in the same column, even though they're on the right side of the page.6. Data tables in Haskell need to have the columns aligned.Being at a C company makes this more tricky than, say, a Python company using Pep8 and black. But the real world looks like this, not like your editor's edit menu giving you a helping hand. So develop the skills now, while you can do so without pressure. URL: https://forum.audiogames.net/post/529565/#p529565 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. I will appreciate that my only team experience has been with either a large enough team where I was dealing with something out of the way of the rest of the team, or a small enough team where this sort of thing was not a real concern. That being said, the types of things I'm talking about here are formatting factors that can be altered with a menu option. Such as tabs Vs. Spaces. In other words, you shouldn't really be doing any kind of merging until the code is back to format. Things like casing sound to me to be too messy to not deal with standard right out of the box, but I mentioned that in my last post. Also, I wouldn't dream of thinking that a company/team should necessarily change the standards. Indeed, what I am talking about here is a way to still keep maximum readability for other screen reader users while still keeping standard formatting consistant across a project. URL: https://forum.audiogames.net/post/529401/#p529401 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. I mean: one true brace vs not one true brace is whatever. That's not my point. But I don't particularly think you're going to get my point until later.You can't actually come back and format after the fact in real world situations. You do have to get casing right. You can't just tell the team that you're going to use your own style, or that the company needs to change the style, or anything like that. When you go edit 5 lines in 20 files each you can't just come back and easily go "huh, what did I update, fix fix fix" or something. The code formatters and editor features destroy your git history once they start touching code that's not by you, which in a real project is going to be 90% of the file most of the time. Your strategy doesn't work on a team unless you get lucky and land somewhere using a language with something like go fmt or rustfmt where they also say that they're using the language-default formatting. That exists but you can't easily find it and if you're not in that situation you can't sweep this under the rug as an afterthought. URL: https://forum.audiogames.net/post/529393/#p529393 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @17 The example you give there isn't a particularly good one as that sort of thing has mechanical issues as well. To introduce a variable part way through like that could end up screwing you over in the long run. All bets are off if you're working with old-school C. That bit of formatting has some mechanics based history, much like header files. Nah, the type of thing I am talking about is something like this:void somefunc(){...}That wouldn't be bad, except, due to my java background, I'll also do that in C files. It should bevoid somefunc(){...}Let's not talk about naming conventions either. What I did their is a bad example, as it should probably look like this:void someFunc(){ ...}There. I think that's a good c function implementation. Wait, that on its own runs, so in a header file, I should remember to:void someFunc();Now, some of these things are good practice for mechanical purposes. Like the header thing for example. Some of the rest is just being consistant with the rest of the team. If you don't like working in the style, that's fine, just make sure you actually bring the format up to the team standard before submitting it. Then you must make the trade off of time spent writing Vs. time spent formatting. As it is my nature to format last anyways, I take the former option. I do the same with formal papers as well. Simply put, I do not disagree that formatting is important, but it shouldn't take front and center over something like making the thing run correctly and non-lethally. Then again, the stuff I'm talking about mostly is very superficial. As in tabs Vs. spaces, which I can just switch with the press of a button. And I have done so. The braces example is a bit harder to alter, but I'd bet a switch could be built. Casing is even worse, but I've not usually had an issue there. Though, I'd imagine that that can be harped on.EditAlso, thanks @14 for that. I am definitely going to have to use that. I have it turned on, so I'll see how well it fairs for me. URL: https://forum.audiogames.net/post/529384/#p529384 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @17 The example you give there isn't a particularly good one as that sort of thing has mechanical issues as well. To introduce a variable part way through like that could end up screwing you over in the long run. All bets are off if you're working with old-school C. That bit of formatting has some mechanics based history, much like header files. Nah, the type of thing I am talking about is something like this:void somefunc(){...}That wouldn't be bad, except, due to my java background, I'll also do that in C files. It should bevoid somefunc(){...}Let's not talk about naming conventions either. What I did their is a bad example, as it should probably look like this:void someFunc(){ ...}There. I think that's a good c function implementation. Wait, that on its own runs, so in a header file, I should remember to:void someFunc();Now, some of these things are good practice for mechanical purposes. Like the header thing for example. Some of the rest is just being consistant with the rest of the team. If you don't like working in the style, that's fine, just make sure you actually bring the format up to the team standard before submitting it. Then you must make the trade off of time spent writing Vs. time spent formatting. As it is my nature to format last anyways, I take the former option. I do the same with formal papers as well. Simply put, I do not disagree that formatting is important, but it shouldn't take front and center over something like making the thing run correctly and non-lethally. Then again, the stuff I'm talking about mostly is very superficial. As in tabs Vs. spaces, which I can just switch with the press of a button. And I have done so. The braces example is a bit harder to alter, but I'd bet a switch could be built. Casing is even worse, but I've not usually had an issue there. Though, I'd imagine that that can be harped on. URL: https://forum.audiogames.net/post/529384/#p529384 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Again, let me reiterate, after college style is *not* optional anymore. If you think you have bad style, you need to fix this.Sighted programmers are different from us. I don't think most blind programmers get that, not right away. Style feels like this stupid bullshit thing that doesn't matter, but that's because to us what really matters is things like "how far do I have to scroll". Blindie coding style, if I had to give it a name, is narrative--we're telling a story with our code, so we i.e. introduce variables right before they're needed, things like that. Sighted coding style is pretty universally "do the important parts jump out at me visually", which is where thins like all variables at the top of blocks, indentation, etc. come from, and if they don't your code is actually not just unpleasant, it's incomprehensible. Style guidelines for wherever you end up working exist so that someone who has 20 things to do today can review your code quickly because it looks like all the other code they have to review today, without reverse engineering your style (and god help us all if it's not at least consistent).So how this will go for you and many others on this forum is that you'll get as far as your first job or your first contribution to a major open source project or something, and then you will get slapped down for bad code style and they won't make exceptions because you're blind (nor should they, this is *not* a place you should have to use accommodations, nor is it fair to your sighted colleagues if you just keep giving them a visual spaghetti pile to review).For my personal projects (i.e. Synthizer) I've started making the style "whatever the formatter does" and coding that way, and that's fine as far as it goes. But you can't actually just apply formatters whenever and have to be harmonious with what's already there because otherwise it breaks the entire repository history when you rewrite every file. Then everyone has to reclone and fix all their in progress work to match the new style, and all the tools where you can say "what changed since last month" when a bug happens stop working since what changed since last month is every single file in the codebase. URL: https://forum.audiogames.net/post/529306/#p529306 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Hmm. To be fair, I do agree with 7 as I also tend to prefer brace-based blocks. That being said, I've gotten used to indent since, as has been stated, most other programmers tend to prefer that style of formatting. That being said, I'm sure I have more than one professor that silently seathes everytime they think of my programming format for one reason or another. LOL!!! And isn't that the entire purpose of programming, for us all to silently seathe at each other for pointless reasons? Now then, who wants to write an entire project in Assembly? Or we could use Brainf***. LOL!!! URL: https://forum.audiogames.net/post/529292/#p529292 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @14You can bind toggling indentation to a custom gesture with NVDA. I forget the exact procedure but mine is NVDA+i and I don't even have to open the dialogs.Lisps are indeed problematic. The only good solution I know of is Emacspeak, at least in theory. Given that Emacspeak is learning a whole new OS and a very, very complicated editor/screen reader from hell, I haven't bothered. Given that lisps are incredibly unpopular, I probably never will. I'm not making the claim that every language ever is blind friendly, just that the common indentation rules themselves can be dealt with trivially once you're used to it. The functional languages like Haskell where you have to line indentation up with non-indentation from the line above are a good example of where uncommon rules make things hard to nearly impossible, since you're not always using the same number of spaces, but since Haskell and similar languages that do that are also wildly unpopular that's not a big deal either.Also w.r.t. people who have always been blind, understanding indentation shouldn't be so bad if you just braille an example of it, though I guess being blind and not knowing braille is a whole thing that would make that harder. URL: https://forum.audiogames.net/post/529229/#p529229 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. I can understand how a blind since birth person might at first have trouble conceptualizing indentation but once you understand the point of it, there shouldnt be any problem adhering to it.for any languages that delimit code blocks using braces you can write as sloppily as you'd like and then just autoformat it and indentation is fixed like magic.Even for languages where code blocks are delimited by indentation like python, swift, and haskell, indentation is not a big deal. I personally I hate having screen reader announce change of indentation by announcing actual number of spaces for changes like "4 spaces", "8 spaces", etc. Because I find mysefl constantly doing trivial math and comparisns in my head.I greatly prefer having indentation change be announced by tones.there it feels much more intuitive for me. but i understand how others might prefer the other.I am really used to turning indentation changes announcement on/off so here is a handy set of shortcuts for nvda:ctrl + nvda + Dalt + Iarrow up/downENTERa note at those that scoff at blind people for shying away from languages because of the syntax. little while back I was looking into Racket, a dialect of Lisp. but gave up on it because of how its syntax is very poorly readable with a screen reader. I gave it a solid week of effort and decided that reading the syntax properly would require me to code up a code comprehension tool, just to get anything done and so not worth the effort at this time. URL: https://forum.audiogames.net/post/529182/#p529182 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @12Sadly not in the real world, no. You're right that it solves it for your personal projects but it doesn't solve it in a professional context in which you have to adhere to the standards of the project. If you don't believe me I can probably still dig up my Rust compiler PRs where people literally commented on missing spaces around -> in function declarations, among other things, and work can't use an auto-formatter because none of them actually support C well enough unless you're using Google or Mozilla formatting. If you ever want to go beyond audiogames as a programmer, you don't get to sweep formatting under the rug, and automated tools won't really solve it for you most of the time either.Suffice it to say that a vast number of us handle indentation fine, some of us learn to use it as a tool to help with brace counting, and any decent editor will help as much with Python indenting as your "I can just format with a button" examples. None of us are literally pressing space 20 times on every line or anything like that.Saying that whitespace being part of the syntax of the language is why you're choosing not to use a language is like saying that you don't eat vegetables because the sky is blue. In terms of actually getting anything done, whether the language is indentation-based or not doesn't make a difference either way. You need much weirder whitespace rules than Python before tools and screen readers stop helping you sufficiently that you don't have to think about it ever again after a few days of adjustment for the rest of your time as a programmer, and since an adjustment period and then it's fine forever describes every piece of assistive technology ever, whatever, it's not a realistic issue and it shouldn't factor in to the decision-making process. URL: https://forum.audiogames.net/post/529072/#p529072 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. actually that makes sense. But here's the thing, if I write any code, I'll just put it into my private code editor, click indent with python or pb or c, those are the ones supported for now and voila. All done. URL: https://forum.audiogames.net/post/529069/#p529069 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @10, I've suffered that too. Even with indenting it can gt tricky to figure out just where you went wrong. But its easier with screen readers being able to announce indentation. URL: https://forum.audiogames.net/post/529008/#p529008 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @7If you want sighted devs to take you seriously at all ever, your code needs to be indented anyway. If you want to work as a programmer, your code will also need to be indented, because every company on the planet will refuse code that isn't. Refusing indentation is literally grounds to fire you.Whether Python requires indentation or not, you will still have to learn this skill if you ever want to code beyond blindy developer ghetto. And the Python indentation style is what everyone uses even for non-Python, which is why Python made it part of the syntax. Once you realize that and put the effort in, it's not really a big deal anymore.But also, even as a blind person, I flinch back from code that's not indented. Why? because the screen reader will happily announce how many braces have been opened, since that always matches your indentation level. And then, when you close them, if there's something weird with the indent you know that something must be weird with brace mismatching since (for example) functions always end at indent level 1 or 0, and if you're still at indent level 2 then oops you still need more braces. The same holds for suddenly ending at an indent level that's too small. If your code is complicated enough, counting the braces becomes more of a headache than just using indentation to always have it counted for you, and in the real world you're usually talking 3 or 4 levels of nesting minimum, much more if it's mathematical or algorithms stuff sometimes, and having to play fight to find the missing brace really sucks. URL: https://forum.audiogames.net/post/528919/#p528919 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @2. thanks for that. I understand it now. I love how the NP plus plus addon tells you that. saves me the headake. URL: https://forum.audiogames.net/post/528904/#p528904 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Why do I have to type end every time I want to finish an if statement or a procedure. Honestly, I would lean towards pure basic, but I just can’t handle that. Give me my indentation right now! If you can’t tell, that was a joke. Also, fun fact. Indentation is present in everything assuming you use an IDE. I wonder why? URL: https://forum.audiogames.net/post/528895/#p528895 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. I don't see the point of indentation. Why can't I use my precious curly braces? Honestly, I would probably leanr python but for the stupid indents. Gimme curly braces now now now! URL: https://forum.audiogames.net/post/528807/#p528807 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Yeah. I've seen blind people do that too; it's kind of painful once you build up the necessary reflex to deal with 4 spaces. URL: https://forum.audiogames.net/post/528607/#p528607 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Thanks Camlorn for the black hint, I didn't know that.No he used one space, for first level, and 2 spaces for the second, ecc. For example :def play(sound_name, channel, wait): sound_object=pygame.mixer.Sound(sound_name) pygame.mixer.Channel(channel).play(sound_object) if(wait==1): while(pygame.mixer.Channel(channel).get_busy()==True): event_loop() time.sleep(0.1) URL: https://forum.audiogames.net/post/528585/#p528585 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Thanks Camlorn for the black hint, I didn't know that.No he used one space, for first level, and 2 spaces for the second, ecc. For example :def play(sound_name, channel, wait): sound_object=pygame.mixer.Sound(sound_name) pygame.mixer.Channel(channel).play(sound_object) if(wait==1): while(pygame.mixer.Channel(channel).get_busy()==True): event_loop() time.sleep(0.1) URL: https://forum.audiogames.net/post/528585/#p528585 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. @3Let me guess, tabs?tabs might be easier to learn with, but nothing anywhere uses them.If you want to take terribly formatted but working code and make it really nicely formatted and working ode, pip install black,then black myfile.py, and you get something out that's mostly PEP8 and will look nice to a sighted reader. URL: https://forum.audiogames.net/post/528580/#p528580 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. Camlorn said it right. A note about Nathan's tutorial. He does not use the indentation that is recommended, namely that of the 4 spaces. IN Python you can do it, because it is a language that leaves you very free. But I recommend using the correct indentation. I even found a site that automatically fixes the code. By sending the incorrect indentation, it fixes all the code with the 4 spaces. URL: https://forum.audiogames.net/post/528577/#p528577 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: python spaces, I still don't get how it works.
Re: python spaces, I still don't get how it works. You indent by 4 spaces anywhere you'd put a left brace. You unindent by 4 spaces anywhere you put a right brace. If you turn the screen reader indentation indication on, then you will get announcements only when the indentation level changes. You can divide this by 4 to determine how many braces deep you are.indentation only typically increases after statements ending in :.If you want some intuition as to why, think about what this looks like in braille. You can just run your finger down the left side of the page, and tell when a block started or ended without having to read all the code.If your problem is that indenting manually is painful, many editors have the ability to make the current line have the indentation of the previous, and use tab and shift+tab to indent and unindent by 4 spaces. With a setup like that, you hit tab where you'd hit left brace, you hit shift+tab where you'd hit right brace, and the rest of it mostly works on its own.If you need more than that you probably need to ask a specific question. URL: https://forum.audiogames.net/post/528564/#p528564 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector