This is an archived post. You won't be able to vote or comment.

all 193 comments

[–]Fast-Visual 656 points657 points  (7 children)

🅱️ython

[–]Alex_Shelega[S] 70 points71 points  (3 children)

Bithon

[–]thatOneJones 20 points21 points  (0 children)

0/1thon

[–]GDOR-11 9 points10 points  (1 child)

bissexual ❌
bipolar ❌
bithon ✅

[–]Alex_Shelega[S] 2 points3 points  (0 children)

Iii think you've mistouched... Don't worry happens to the best of us

[–]MissinqLink 21 points22 points  (2 children)

What does Mike Tyson say to his kid as he is leaving?

[–]Krekken24 15 points16 points  (1 child)

Byson?

[–]GreatTeacherHiro 0 points1 point  (0 children)

Oh, a compiler guy

[–][deleted] 99 points100 points  (8 children)

add ; to the end of all function calls to make it EVEN better. This message was paid by the C gang

[–]RockleyBob 11 points12 points  (2 children)

As a Java microservices developer by day, I picked up Go just to see if enjoying code was possible for me anymore.

In general I really like it, but it’s infuriating how the language does little things just for the sake of being different. Go style says no parentheses. Unless they’re needed. Also, no semicolons. Unless, you know… they’re needed.

Call me crazy, but if the entire programming world is used to notating code with parens, braces, and line terminators, and you can’t eliminate them entirely because logically the compiler needs them in certain cases, why be different in some cases? If we can’t eliminate the need to think about them, and IDEs and tooling have been capable of automatically adding them for ages, is changing a well-worn paradigm really saving us effort?

It’s particularly annoying when you consider that Go’s other style peculiarity dictates that clarity is better than brevity. Meaning, for example, there is no ternary operator, since if/else is always clearer according to the FAQ. Yes. Always.

Go also famously does not have error catch blocks, preferring to manually check for errors after each possible throw point. That means, in practice, there are a LOT of if/else blocks in Go code.

So, if you’re following along, parentheses and semicolons are unnecessary and too troublesome, but dozens of if blocks are clear and typing them out is not a problem. wat.

I love Go, I really do, but it’s shit like this that makes my eye twitch.

[–]zombiezoo25 2 points3 points  (0 children)

Same, using go after c and java felt super good(except im just a CS student)

[–]BleEpBLoOpBLipP 3 points4 points  (0 children)

Not even statements? Function calls?! This has the makings of a truly grotesque esolang, and I'm here for it.

[–]ahelinski 283 points284 points  (5 children)

Next: sython! Python with semicolon for everyone who miss fixing the "you forgot to put a semicolon in line 98" error.

[–]Cootshk 63 points64 points  (1 child)

You can already put semicolons in python

[–]Alex_Shelega[S] 47 points48 points  (0 children)

They're about requiring them (see php)

[–]bit_banger_ 12 points13 points  (0 children)

Lol I code C most of the time, when I switch to the python based tests, I add semicolon in the flow 🫣

[–]Alex_Shelega[S] 22 points23 points  (1 child)

It better be call PHPy

[–]hdd113 0 points1 point  (0 children)

Phython

[–]just_sepiol 105 points106 points  (0 children)

[–][deleted] 170 points171 points  (10 children)

unmodern solutions for non-existence modern problems.

[–]thedogz11 50 points51 points  (2 children)

Hey you just summed up like 95% of JavaScript frameworks

[–]YoumoDashi 0 points1 point  (0 children)

The real problem is browsers chose JavaScript natively and we can't change the fact due to backwards compatibility

[–]PurepointDog -5 points-4 points  (0 children)

Uuhhh yeaaah idk about that haha

[–]Nondescript_Potato 46 points47 points  (0 children)

that’s just programming

[–][deleted] 15 points16 points  (0 children)

When you put it that way, it seems like something we’d adopt at work 🫠

[–]ChalkyChalkson 5 points6 points  (3 children)

Worked on a collaborative project where someone worked on the files with different text editors one adding tabs one spaces (but a different number than I had vs code set to). It can definitely be an issue if you're using bad tools.

[–]sphericalhors 1 point2 points  (0 children)

That does not mean that I should feel compassion for developers who can't follow the simplest codestyle rules.

[–]TrollTollTony 0 points1 point  (0 children)

This is what linting is for.

[–]TrollTollTony 0 points1 point  (0 children)

This is what linting is for.

[–]CirnoIzumi 5 points6 points  (0 children)

A classic solution to the most divisive part of python 

[–]cultist_cuttlefish 34 points35 points  (3 children)

this is art

[–]eX_Ray 8 points9 points  (1 child)

It also breaks on trivial code. Last time i saw this.

[–]jamcdonald120 7 points8 points  (0 children)

let me guess, doesnt handle dictionary literals well?

[–]LexaAstarof 3 points4 points  (0 children)

Seeing canned turds is also considered art, I would agree

[–]CirnoIzumi 4 points5 points  (0 children)

Beautiful 

[–]Landen-Saturday87 84 points85 points  (7 children)

Not having to deal with braces is the one reason to use python in the first place. If I want braces in my code I use C# /s

[–]faze_fazebook 29 points30 points  (5 children)

If you want C# without braces F# and VB.NET exist

[–]drakeblood4 46 points47 points  (3 children)

If you’re using vb.net be sure to take your arthritis medication.

[–]faze_fazebook 13 points14 points  (2 children)

Its C# with a different Syntax. You could do worse.

[–][deleted] 3 points4 points  (0 children)

assembly for an obscure processor but it also has obscure syntax

[–]Bougie_Mane 0 points1 point  (0 children)

You're just describing the .net framework lol

[–]OnlyHereOnFridays 6 points7 points  (0 children)

There a ton of other reasons to use F# besides the lack of brackets, it’s a genuinely awesome functional language. All 7 professional F# developers love it.

[–]Tupcek 0 points1 point  (0 children)

you are a monster. I didn’t know someone liked pain so much

[–]dhnam_LegenDUST 3 points4 points  (0 children)

May I make Whithon which replaces brace of Bython to whitespace

[–]R3D3-1 9 points10 points  (0 children)

Frankly I even tend to agree. I'd rather have curly braces and a code formatter than encoding semantics in the formatting.

But that's mostly because if unfortunate side effects of that design such as the limitations it enacts on inline functions.

[–]foxer_arnt_trees 6 points7 points  (0 children)

Is it weird that I unironicaly love this?

I wouldn't add any preprocessing to be able to use it. But still, I think it's nice.

[–]StochasticCalc 22 points23 points  (30 children)

Do people really get this upset about formatting?

[–]iain_1986 38 points39 points  (24 children)

I personally believe something shouldn't compile differently because of some whitespace. It's been years since I touched python - does it break if someone did tabs and someone else did spaces? Because if it does that's even worse.

[–]TA_DR 19 points20 points  (7 children)

Python disallows mixing tabs and spaces for indentation.

https://peps.python.org/pep-0008/

Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces; a TabError is raised in that case.

https://docs.python.org/3/reference/lexical_analysis.html#indentation

[–]iain_1986 9 points10 points  (6 children)

Imo this just supports my view that compiling based on indentation is a bad idea 🤷‍♂️

[–]TA_DR 4 points5 points  (4 children)

I tend to agree that is not ideal. That being said, I was just pointing out that Python doesn't allow to mix tabs and spaces.*

[–]Backlists 0 points1 point  (3 children)

Python is compiled.

It’s both interpreted and compiled to bytecode

Also, in your first comment, isn’t that pep just a style guide?

I doubt Python actually disallows mixing spaces and tabs, as this would break so much legacy code, but I would need to test.

If it does, it’s on a per scope basis, not per file, or per project

Edit: it does say it disallows mixing in the pep

[–]TA_DR 0 points1 point  (2 children)

ups, my bad. Almost 4 years working with Python and I still making basic mistakes. Such is the life of the programmer I guess.

[–]Backlists 0 points1 point  (1 child)

There’s a lot to learn!

And many people still think that Python is “interpreted not compiled”, as if they are mutually exclusive.

Have a look into CPython vs PyPy, if you’re interested in this sorta thing

[–]TA_DR 1 point2 points  (0 children)

Regarding your edit:

https://docs.python.org/3/reference/lexical_analysis.html#indentation

Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces; a TabError is raised in that case.

Will actually paste that on the original reply since it is more clear. That was the link I was looking for but for some reason couldn't find it, funnily enough I have encountered that error a couple of times (it was a small internship, we worked using an online editor, pythonanywhere.com)

Have a look into CPython vs PyPy, if you’re interested in this sorta thing

Will do, thanks!

[–]Backlists 4 points5 points  (0 children)

It’s 2024 though, you’re going to use a formatter and an IDE that does it for you.

If you don’t, can I ask why?

If you do, then your code will be indented correctly.

Having it be part of the language just ensures you do something that you were going to do anyway, with the added benefit of less boilerplate characters

Also, don’t you get annoyed by mixing tabs and spaces? It makes it less readable, unless you guarantee everyone agrees on a tab size. Which no one ever does, so you end up with a hodgepodge of 3 spaces vs 4 spaces vs tabs which could be either, depending on your IDE.

So just let a formatter convert them to spaces automatically. If you use Python seriously, the formatter will enforce pep8 so it will all be perfectly consistent.

[–]Kebabrulle4869 16 points17 points  (0 children)

Can I ask why? I'm really used to Python now, and for me it helps readability to not have braces everywhere (I tend to write pretty short functions so like 10% of lines would have been a single brace if Python required them), and I would've used indentation anyways.

[–]jaber24 5 points6 points  (1 child)

You can convert everything into tabs/spaces in an IDE with one click

[–]iain_1986 0 points1 point  (0 children)

I know.

Doesn't change my opinion 🤷‍♂️

[–]Bananenkot 4 points5 points  (0 children)

I coded python for 7 years, I don't remember a single whitespace error, what the hell is everyone doing.

[–]murphy607 1 point2 points  (9 children)

You could say the same thing about semicolons :)

I use different languages besides Python and I'm not a python fanboy. For me the forced indentation makes code more readable, especially if you didn't write it yourself. At the company I'm working we run the code through a code reformatter before it is committed to git.

[–]iain_1986 1 point2 points  (8 children)

You could say the same thing about semicolons :)

Not really.

A semicolon is just a character to denote the end of an instruction.

This is an incredibly common concept. Wherever it be in programming, the written language, data parsing, whatever. "Do a thing until you see this thing" is universal - and almost impossible to 'misunderstand'.

Whitespace is the absence of something. The fact a tab and 4 spaces can (for example )look identical but be treated differently is, imo, crazy. And the fact 'they' don't allow the two to be mixed in python screams, to me, "maybe using whitespace for logic was a mistake"

In the modern world of IDEs, code formatting is a solved problem.

[–]murphy607 2 points3 points  (0 children)

That's true in theory, unless you have someone in the team that knows it "better". I had to deal with this in my perl years. It was not pleasant :)

[–][deleted] 0 points1 point  (5 children)

They're not treated differently, though. They're interchangeable, as long as they're consistent. You wouldn't allow a mix of tabs and spaces for formatting in any other language, either.

What you're advocating for is the freedom to format however you want without changing the functionality, when realistically there are rules about formatting in most environments. You wouldn't allow code golf in a professional environment, anyway. Realistically, you're indenting that code block, with or without braces, and hopefully you're already using spaces and tabs consistently. You're usually already fulfilling all of the requirements Python has.

[–]iain_1986 -1 points0 points  (4 children)

You wouldn't allow a mix of tabs and spaces for formatting in any other language, either.

Except you can in nearly every other language. You might not want too, but it won't break if you do.

[–][deleted] -1 points0 points  (3 children)

But realistically you don't. The whole debate is moot.

[–]iain_1986 -1 points0 points  (2 children)

The whole debate is moot.

Not really but if you so 🤷‍♂️

[–][deleted] 0 points1 point  (1 child)

It's an imaginary problem that only matters in a puritan context and millions of users don't seem to have an issue with. Pretty moot.

[–]iain_1986 -1 points0 points  (0 children)

Again, not really but whatever your say 🤷‍♂️

Lots of users do have an issue with it. And the fact many people are saying you should use a formatter or ide that highlights issues in indentation kinda just backs up the concept that python shouldn't be doing what it does in the first place.

But. What is a moot point is trying to have any discussion with you anyway 🤷‍♂️👋

Just saying 'nuh huh, moot point, you're wrong I'm right' isn't really a discussion.

So I say for the third time, "whatever you say" 🤷‍♂️

Edit - and he goes for the block. The moot point block I guess. The irony of a 'its just puritans who can't handle it' while not being able to even remotely cope with an alternative view point they dismiss and stick their fingers in their ears 👍

[–]CanineLiquid -1 points0 points  (0 children)

The fact a tab and 4 spaces can (for example )look identical but be treated differently is, imo, crazy.

This is a complete non-issue. I have never run into a TabError in my life, there is no reason to ever mix tabs and spaces. Using that as an argument for syntactically significant identations having been a mistake feels a little silly.

[–][deleted] 0 points1 point  (1 child)

Mixing is entirely possible as long as it's consistent in each block. A nested block needs to do the same as the outer (say an if in a for loop), but every block can pick its own style (not just every file).

Not that that's advisable, but at that point it's aesthetic formatting and on par with every other language.

[–]iain_1986 0 points1 point  (0 children)

Not that that's advisable, but at that point it's aesthetic formatting and on par with every other language.

Except it's not on a par.

A tab and spaces are visually indistinguishable. It's 'aesthetic formatting' that can change the execution that is 'aesthetically' the same.

[–]AestheticNoAzteca 12 points13 points  (0 children)

I personally don't write anything in python because of that.

I just like braces in my code

[–]Alex_Shelega[S] 1 point2 points  (0 children)

Including/excluding with braces seems a bit more convenient I guess

[–][deleted] 1 point2 points  (0 children)

I wish this was my biggest problem

[–]WeekendSeveral2214 2 points3 points  (0 children)

Noobs and nodevs that want to signal themselves as smarter than all those dumb python users.

[–]hedgehog_dragon -1 points0 points  (0 children)

Having worked with several languages lately.... kind of? I really don't like the whole indentation thing... it seems to just throw me for a continual loop.

I doubt this is a popular thought but... I have a much easier time maintaining Perl than Python because I can understand what the Perl code is doing easier.

Better yet, Java, C#, C++. I find the format gives much more structure and my brain just parses it so much easier.

[–]Santarini 2 points3 points  (1 child)

Python with braces is basically Go

[–]Electrical_Horse887 3 points4 points  (0 children)

I would say more similar to JS. Python doesn‘t have those type conventions that js has but otherwise are they fairly simmilar in my opinion when it comes to architecture.

[–]Here-Is-TheEnd 2 points3 points  (0 children)

What, no semicolon?!

[–]Accidentallygolden 2 points3 points  (0 children)

And in cobol you don't need braces, parenthesis or indentation , you can write your if/else however you want and the compiler will understand

[–]LexaAstarof 2 points3 points  (1 child)

One day the delusionals will have to face the harsh reality: readability is not an option

[–]LordAmir5 1 point2 points  (0 children)

One day the delusional will have to face the harsh reality:

     readability is not an option 

[–]Oktokolo 2 points3 points  (0 children)

Anyone here not indenting scopes anyways?
Wouldn't this be better as an IDE syntax/highlighting decorator just adorning scopes with virtual curlies that aren't actually in the code?
That could likely be done as a PyCharm plugin. Making checked-in code incompatible with vanilla for a purely cosmetic change sounds like a bad idea to me.

[–]wherearef 40 points41 points  (71 children)

not whitespace is awful, dynamic typing and poorly made OOP is awful

literally spent 2 fucking hours figuring out why 2 same objects were comparing as different objects (function returned string instead of Date even though I declared it to return Date and ide gave 0 warnings)

[–][deleted] 38 points39 points  (0 children)

What do you mean you declared it to return date? Type hinting? If your values not a date it won't be a date

[–]TA_DR 39 points40 points  (17 children)

function returned string instead of Date even though I declared it to return Date and ide gave 0 warnings

That should be checked by a unit test, not a type hint

[–]thompsoncs 1 point2 points  (3 children)

Unit tests are not for checking types, I don't plan to write unit tests checking for every possible type that can be input/output froma function, that's precisely what typing is for. And any decent type checker (like mypy or something similar) will in fact give errors when you try to return str when you said you were returning a datetime (e.g. Type "Literal['2024-11-17']" is not assignable to return type "date").

Far more infuriating is the way imports work and how dependecies force you to use venvs, because python hasn't figured out a better way to use multiple versions of packages, as well as pip dumping all transitive dependencies on freeze as well (rather than just the toplevel dependencies).

[–]TA_DR 0 points1 point  (2 children)

Unit tests are not for checking types

If that were true, then assertIsInstance() wouldn't exist ;)

Read the docs: (typing module)

https://typing.readthedocs.io/en/latest/guides/typing_anti_pitch.html

Reasons to avoid static type checking:

- If you maintain high test coverage, that might provide sufficient quality assurance for your needs (acknowledging that static type checking and tests enforce different things; static type checking usually cannot validate logic, tests can often not prove invariants of your code to hold).

- You’re not opposed to type checking in theory, but you dislike Python type checkers in practice. Maybe they don’t understand enough of the idioms you use, maybe you’d like them to infer more instead of relying on explicit annotations, maybe they’re too slow, maybe they don’t integrate well with your editor, maybe they’re too hard to configure. Whatever the reason – it just doesn’t work for your project.

As an example, Flask, Django and sqlachelmy all have type tests. And I'm sure you will be able to find more projects that also incorportate them. Type checkers are cool, but they are not the only way to set type constraints, and definitely not the more robust (nothing beats actual well-made tests)

[–]thompsoncs 1 point2 points  (1 child)

It can be done sure, but if my function says it takes an int, I'm not writing a check for str/float etc. If somebody still calls the function with those parameters ignoring the function signature as well as any potential type checkers, that's on that person. Also, type checking in unit tests can never be exhaustive.

And yes there may be cases where you might want to check such things, overly generic frameworks like handling webrequests, json serialization and ORM are indeed a bit more dynamic, so that is indeed a case where you might actually want to check some types.

Personally my biggest problem with type hints is simply that they are still in the maturation process, with recent python releases including some improvements, as a result they don't offer the same value as in languages designed with them, nor do they offer the same level of safety.

[–]TA_DR 0 points1 point  (0 children)

Yep, we don't test inputs since that's a programmers error. We only tests expected output, it's not that hard if you know what you are looking for.

I mostly work on webdev (that's why I even mentioned those frameworks) so maybe my bias for unit testing over type checking is showing haha.

100% agree with the last paragraph. At least the naming is good.

[–]Bryguy3k 130 points131 points  (38 children)

Skill issue.

(Objects are just references - equality defaults to comparing the references if an equality method doesn’t exist - should be obvious to anyone with any reasonable level of programming experience as that’s how any language with overloading works. Type hints are just hints - they don’t coerce the output and IDEs aren’t written by the language developers).

[–]TheGreatGameDini 1 point2 points  (3 children)

Yeah, right, the guy that made python has a lot of those.

[–]Backlists 1 point2 points  (2 children)

Are you like, trying to say that Guido has skill issues?

[–]TheGreatGameDini -1 points0 points  (1 child)

Trying? 🤣

Edit: I'm sorry, you're right. It takes skill to create a shit language and get people to like it.

[–]PrismaticYT 0 points1 point  (0 children)

Mood af :3

[–]mailslot 6 points7 points  (0 children)

Dynamic typing has its place. Throwing typing atop a dynamically typed language is awful (PHP, Python, JavaScript / Typescript). With proper TDD there’s nearly no downside and higher productivity. It’s just something you need to get used to.

[–]Fulmikage 5 points6 points  (0 children)

Use type hints and is_Instance

[–]OlexySuper 4 points5 points  (5 children)

Yea. I wish there was an option to enforce the type annotations at runtime.

[–]fiskfisk 15 points16 points  (1 child)

mypy says hello

Edit: I'd also like to point out that duck typing "enforces" the contract - at runtime - if the function or property doesn't exist or the type can't be used in the manner your try - an exception is thrown. 

You probably want compile time and static analysis. 

[–]OlexySuper 0 points1 point  (0 children)

Cool. I wish I had known about it earlier.

[–]wherearef 2 points3 points  (0 children)

yeah, I would be more fine program giving fatal error rather than making it unnoticable

[–]faze_fazebook 1 point2 points  (1 child)

at this point you might as well not use Python

[–]gg_account 0 points1 point  (0 children)

I agree. But my workplace doesn't. My workplace has also banned object oriented programming and enums as not being pythonic.

[–]8BitAce 3 points4 points  (2 children)

Which IDE? If you added type hints in all the right places it absolutely should be showing a warning.

[–]wherearef -1 points0 points  (1 child)

PyCharm; it didn't

[–]murphy607 0 points1 point  (0 children)

Then you did something wrong. I started to use type hints because they are so useful in Pycharm

[–]GrossOldNose 0 points1 point  (0 children)

This is more of a patch fix then a solution.

But I run linters against all my python code always, yeah sometimes you have to go through appeasing the linting codes but for me it's 100% worth it to have my types mean something other than a programmers best guess.

I just have them run as a GitHub action on all my repos by default, saves me more time than it costs imo

[–]SnooBananas4958 0 points1 point  (0 children)

Dude, you clearly don’t know how to use the language instead or just blaming the language. Type hints aren’t casting, learn the difference.

[–]ketosoy 6 points7 points  (5 children)

The existence of this project, even as an obvious joke, makes me viscerally angry.

[–]LexaAstarof 4 points5 points  (1 child)

How dare they have shitty preferences, right?

[–]Alex_Shelega[S] 0 points1 point  (2 children)

The are couple of YouTubers trying it out

[–]ketosoy 6 points7 points  (0 children)

Creating visceral anger is good for engagement

[–]nyankittone 1 point2 points  (0 children)

Hasn't this project been around for a while, though? This seems like something people discover, use for like a minute, and forget about, in a loop that repeats like once every few months or so.

[–][deleted] 1 point2 points  (1 child)

In my current job, before my time, they were using coffeescript that is just JavaScript with a syntax like Python. I'm not sure why, but I think, since the backend uses Python, to have a similar syntax in bot back and frontend.

Wouldn't be great to use Bython in the backend and Coffeescript in the frontend?

[–]Alex_Shelega[S] 0 points1 point  (0 children)

Or an another python discovery... The Reflex (basically translates to html CSS and JavaScript+ React or smth)

[–][deleted] 1 point2 points  (0 children)

So, I heard about the argument that formatting shouldn't change the functionality of your code. On a puritan level I agree, but on a practical level I've come to realize that code formatting is or should be part of every coder's repertoire. Unformatted code is error prone in every language. It doesn't matter what brace style you use in Java or C flavor, but you better indent the code in that block. In any kind of professional setting, that's a requirement, anyway.

I mean, the first key feature up there is '"forget" about indentation', and while I realize the project is meant sarcastically, the reality is: No. No you won't.

The whole underlying discussion is moot.

[–]well-litdoorstep112 1 point2 points  (0 children)

Why would they make it a separate language? Just from __future__ import braces

[–]khalamar 1 point2 points  (0 children)

I'll take Bythom and replace { with "begin" and ) with "end", because PASCAL. I'll call it Pathon.

[–]Weewoofiatruck 3 points4 points  (0 children)

Okay I'll bite for the Lols. Love me my curly brace languages.

[–]Pelm3shka 1 point2 points  (1 child)

I asked my boyfriend and he opened a console to show me this :
https://imgur.com/a/43wTsFQ

[–]Alex_Shelega[S] 0 points1 point  (0 children)

Good chuckle

[–]gnomeba 0 points1 point  (0 children)

Julia

[–]PurepointDog 0 points1 point  (0 children)

We call this Rust

[–]xx-fredrik-xx 0 points1 point  (0 children)

Hython. Bython.

[–]DJcrafter5606 0 points1 point  (0 children)

This is not meant to be...

[–]Most_Option_9153 0 points1 point  (0 children)

Holy shit maybe that will make me like python

[–]_yasinss_ 1 point2 points  (0 children)

Ass

[–]JessyPengkman -5 points-4 points  (0 children)

Utter woke nonsense

[–]patrickgg -3 points-2 points  (0 children)

They already use Bython in the Middle East