News for hackers. Stuff that matters.
Re:Learn AutoHotKey by stealing my scripts by BanazirGalbasi on Tuesday August 22, 2023 @01:44AM (#37219097)
Python uses indentation for nested scope (I think that's the right term). While other languages might use curly braces or even keywords like do and end to enclose loops and functions, Python uses indentation. It ensures code is readable, but coding newbies have to learn about whitespace errors AND scoping together. It's one of the parts of the language I dislike the most.
Re:Learn AutoHotKey by stealing my scripts by xchkr1337 on Tuesday August 22, 2023 @02:14AM (#37219270)
It's weird how python defaults to spaces rather than tabs, as tabs would make indentation errors less prevalent and a lot more obvious to people learning the language.
Re:Learn AutoHotKey by stealing my scripts by gattilorenz on Tuesday August 22, 2023 @07:44AM (#37221318)
Does it? You can perfectly use tabs, just dont mix them up (also a source of Python pains)
Re:Learn AutoHotKey by stealing my scripts by 2Gkashmiri on Tuesday August 22, 2023 @02:10AM (#37219241)
its like trying to learn to drive while the car is actively trying to not let you drive. you can do it but its not fun.

i want to do a loop, i dont want to learn to be forced to understand indentation. that kills the enthusiasm imo.

Re:Learn AutoHotKey by stealing my scripts by zo1 on Tuesday August 22, 2023 @02:30AM (#37219373)
It's like learning to drive the car whilst sticking to the rules of the road and staying under the speed limit. It's not supposed to be fun.

Besides, I don't know what backwards IDE you used. I've been doing python for 15 years and have never had to manually indent squat, ever.

It sounds more like you didn't actually try python but read about the whitespace indentation somewhere and decided to chime in. Either that or you tried it in notepad.

Re:Learn AutoHotKey by stealing my scripts by 2Gkashmiri on Tuesday August 22, 2023 @03:15AM (#37219631)
i have used notepad for ahk. that's the preferred IDE
Re:Learn AutoHotKey by stealing my scripts by hwayne on Tuesday August 22, 2023 @12:26PM (#37225010)
Use VSCode with the AHK extension, it's a million times better than notepad for AHK
Re:Learn AutoHotKey by stealing my scripts by abwizz on Wednesday August 23, 2023 @04:39AM (#37233329)
lol'd there

once the code gets more elaborate, syntax highlighting and the likes do indeed make ones life easier

Re:Learn AutoHotKey by stealing my scripts by Loocid on Tuesday August 22, 2023 @03:05AM (#37219571)
Is it really that different to being forced to understand scoping with curly braces in other languages?
Re:Learn AutoHotKey by stealing my scripts by 2Gkashmiri on Tuesday August 22, 2023 @07:23AM (#37221170)
look up a random autohotkey code. you can write it sideways, it will work. you can write it with indentation, it will work. it will work if the whole code is in a single line.

on one hand, it has the least amount of startup for a new programmer because it can teach you to do cool things. on the other hand, like me, the "habits" get wrong because i never learned to do pretty code.

Re:Learn AutoHotKey by stealing my scripts by pmontra on Tuesday August 22, 2023 @03:47AM (#37219797)
It's like learning to write but not wanting to learn punctuation. You might end up with the Ulysses but more likely than not you'd end up with something that other people and yourself won't be able to understand well when you look at it on the next day.

That said, I'm in the camp of curly braces (or equivalent) plus an autoindenter. Either a code formatter or the editor itself.

Braces and random indentation is the worst that can happen.

Re:Learn AutoHotKey by stealing my scripts by wruza on Tuesday August 22, 2023 @05:04AM (#37220247)
Scoping is essential for general purpose programming, so it is usually fused into the syntax of any GP language in a form of {…} or begin/do…end. Python is one of the languages which try to remove this character and keyword noise based on observation that to see scoping people usually correctly indent their scopes, so python makes indent itself important.

I can recommend using Notepad2 if you want to use GP languages but don’t want to use an IDE (which is understandable as it brings a cognitive overload when you learn). Notepad2 is a drop-in replacement for Notepad, but may be installed as a separate app. It’s not particularly for programming, but has related features that Notepad should have had for ages.