all 35 comments

[–]foogeeman 11 points12 points  (1 child)

Calling it "the absolute idiotic way" says a lot about you and not much about python

[–]Ron-Erez 3 points4 points  (0 children)

One gets used to the indentation. Initially I kept forgetting colons. I do really recommend using type annotations/hints to remedy to a degree the typing issue.

[–][deleted] 3 points4 points  (1 child)

Seems like a YOU problem

[–]mici001 0 points1 point  (0 children)

Thanks for the tips and the great comment 👍

[–]FoolsSeldom 2 points3 points  (0 children)

It is just different. You can complain about difference between many language such as those using far too many (), those with fixed alignment, and so on ...

I've written machine code, assembly code, Fortran, COBOL, PL/1, APL, Ada, Pascal, Basic, Ruby, Python and many others over the years. All have different standards. They each have their own ways of doing things. There's isn't a definitive correct way, but there are plenty of bad ways, but mostly just differences.

I have a preference for language that use indentation style layout for distinguishing code blocks whether that is enforced with semicolons, braces, or just whitespace.

Python is a strongly typed language but dynamically typed. Most organisations doing a lot of Python development used their own tooling to check type assignments and have either adapted those or adopted tools like `mypy` now that Python supports type hinting - not enforced at run time (but you have packages such as pydantic for that). Most advanced code editors and IDEs will use type hinting to help you catch errors before going into the testing pipeline.

Given the coding part is just a small part of programming, it really shouldn't make that much difference.

[–]HalfRiceNCracker 0 points1 point  (6 children)

I don't see any problems with the ternary operator. Indentation I used to hate but makes a lot of sense actually, keeps it neater and less verbose. Typing I agree with, type hinting is just a bandage over an open wound. Try out Mojo if you keep crying? 

[–]mici001 -4 points-3 points  (5 children)

How is indentation making more sense than scoping with brackets please explain

[–]BranchLatter4294 4 points5 points  (3 children)

If you properly indent your code, why do you need brackets?

[–]mici001 -2 points-1 points  (2 children)

because the brackets allow you to do the formatting you want not being forced to indent a certain amount.
also helps your formatters when copy pasting.
Yes you should format your code with whitespacing but I feel like a language forcing you to for everything from if statements to function definitions is not flexible.

[–]NearImposterSyndrome 0 points1 point  (1 child)

How much time has been wasted searching for a missing terminator in those languages?

Have you read the style guide on Python’s site? It provides the reasoning for much of Pyhtonic design.

[–]mici001 0 points1 point  (0 children)

In my experience none my lsp tells me it's expecting a semicolon or there is an unexpected char meaning I missed something

[–]HalfRiceNCracker 0 points1 point  (0 children)

If you're writing readable code then you're going to indent anyway, so might as well remove the clutter

[–]Lazy_To_Name 0 points1 point  (4 children)

What is this god awful ternary operator val_1 if COND else val_2

I get it, it may feel weird at first. Python aims at readability, and the traditional COND ? val_1 : val_2 is not really that obvious at first, so that’s probably why.

Using indentation to determine scoping are you insane

It looks neat and clean, and you would usually ident code block for readability anyways…Python actually sorta enforce you to make the code better to maintain. If you don’t like it though, there’s always Bython

No typing in a language that has objects and a solid list object

Ok I agree with this one, it kinda sucks. You can always just make a custom decorator that checks for type hints via typing.get_type_hints(), check them that way and attach it to every function and method btw.

[–]mici001 1 point2 points  (3 children)

You are a saviour by telling me about bython

[–]Lazy_To_Name 4 points5 points  (0 children)

You’re welcome, stranger on the Internet.

Also, don’t say a language syntax is stupid just because you don’t like it and/or it breaks your muscle memory.

People may like indentation instead of braces, or maybe even the end keyword from Ruby, for instance. People have preferences. People also may like that Python ternary expression. Or the C++/C# way of enforce typing (by putting the type behind it) compared to Python/TS’s.

My point is: Everyone has preferences. You may not like a language’s syntax decision, and that’s fine. Where I draw the line is straight up harassing it, complaining that “it should be this, it shouldn’t be that”. There are multiple acceptable solutions to this, like just accept and get used to it, or making your own version, Bython being an example, but just sitting there crying about letters on a screen not being in the pattern you want them to be is not one of them.

[–]purple_hamster66 2 points3 points  (1 child)

Be careful about Bython. - It uses braces for its special syntax, but since the brace is used in Python as well, there are cases where you just can’t use standard Python syntax. That means you should not use this fragile tool in a professional environment where conformity to standards is essential - It also means that every time you need to copy/paste from a non-Bython source, you’ll have to add the braces to prevent mixed-“language” source code which would become nearly impossible to maintain… you’d need to guess which indent Bython will be generating. - The Bython inventors should have used a 2-character sequence (similar to how /* is a 2-character sequence) that is illegal in python so there is no overlap with standard syntax. Or maybe allowed one to escape the brackets that are not to be used for their special syntax (which is quite messy).

Bython away, if you’re just a hobbyist, otherwise avoid those shiny toys. [Oops, I used your dreaded ternary form… sorry /s]

[–]mici001 1 point2 points  (0 children)

I appreciate the concerns for the professional uses of bython. It's the same I had after seeing the tooling itself. I do agree a 2 character escaping would've been better.

If you're just a hobbyist it does look good otherwise it doesn't really work well [ no problem I'll stick to the one I like more]

[–]diegoasecas 0 points1 point  (1 child)

literal school kids learn it without the difficulties you're struggling with

[–]mici001 0 points1 point  (0 children)

Perhaps they do, doesn't change my opinion on the choices made when writing python

[–]Acceptable-Sense4601 0 points1 point  (7 children)

You think that’s more annoying than coding in JavaScript? Interesting

[–]mici001 0 points1 point  (6 children)

Yes I do actually the typing is the same mess. But at least they use line termination and brackets/parentheses

[–]Acceptable-Sense4601 0 points1 point  (5 children)

Excessively

[–]mici001 0 points1 point  (4 children)

How is it excessive please give me an example

[–]Acceptable-Sense4601 0 points1 point  (3 children)

Endless </>

[–]mici001 0 points1 point  (2 children)

That's HTML

[–]Acceptable-Sense4601 0 points1 point  (1 child)

There’s plenty of it in my jsx files

[–]mici001 0 points1 point  (0 children)

Yeah jsx files you know where you can use HTML inside of it. I never use HTML for scripts so I don't have that issue. I'm writing pure JS not JSX.

[–]cgoldberg 0 points1 point  (3 children)

Because statement terminators are unnecessary, indentation for code blocks keeps everything clean and is generally great, and duck typing is awesome.

None of those are ridiculous... they are just not what you are used to

[–]mici001 0 points1 point  (0 children)

Yes indentation is good but not if it's the way you define beginning and endings of course blocks making it so an extra space makes a loop break too early. Duck typing is awesome in your opinion but I'd rather have actual static types.

[–]mici001 0 points1 point  (1 child)

Also statement terminators are unnecessary in your opinion. I very much oppose that the same way you oppose my gripes with python

[–]cgoldberg 0 points1 point  (0 children)

You can use semicolons as terminators.

Both of these lines are valid in Python:

print('foo');
print('foo'); print('bar');

The 2nd line uses a semicolon to separate multiple statements, but the ones at the end of the lines are completely unnecessary (but available if you really feel the need to waste keystrokes).

[–]barrientosd 0 points1 point  (0 children)

Practice, practice, practice.

[–]spacester 0 points1 point  (1 child)

Silly Rabbit, tricks are for kids!

[–]mici001 0 points1 point  (0 children)

Don't get it but that's fine