What if I prefer this?
#define CURLYOPENRIGHTCLOSEDLEFTBRACKET { #define CURLYOPENLEFTCLOSEDRIGHTBRACKET } #define CURVYOPENRIGHTCLOSEDLEFTBRACKET ( #define CURVYOPENLEFTCLOSEDRIGHTBRACKET ) #define PERIODWITHPERIODONTOP : #define COMMAWITHPERIODONTOP ; int main CURVYOPENRIGHTCLOSEDLEFTBRACKET CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET if CURVYOPENRIGHTCLOSEDLEFTBRACKET 1 CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET asm volatile CURVYOPENRIGHTCLOSEDLEFTBRACKET "mov $1, %%rax\n" "mov $1, %%rdi\n" "lea message(%%rip), %%rsi\n" "mov $4, %%edx\n" "syscall\n" PERIODWITHPERIODONTOP PERIODWITHPERIODONTOP PERIODWITHPERIODONTOP "%rax", "%rdi", "%rsi", "%rdx" CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP CURLYOPENLEFTCLOSEDRIGHTBRACKET return 0 COMMAWITHPERIODONTOP CURLYOPENLEFTCLOSEDRIGHTBRACKET asm CURVYOPENRIGHTCLOSEDLEFTBRACKET ".section .data\n" "message: .ascii \"wut\\n\"\n" ".section .text\n" CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
You can’t be helped, sorry. We will put you to an asylum for people like you
Asylum? We have the electric chair for this.
Yeah, now I see why you want him dead. He used mov after lea
Pack him, boys: https://youtu.be/hHuLZFuugTQ
You win a free trip to the Hague
They don’t even deserve the trial. Straight to gulag.
Still need at least troyka to send to gulag. Or regular court outside of stalinism.
The taxi chauffeur can be judge and do it on the way to the gulag.
Obviously the sentence is predetermined.
Can this be done with emoji?
😫
Acceptable, just FYI I added a pre-commit git hook, please rebase your changes.
Thanks. I hate it.
Mom, can we stop and get some Python?
No, we have Python at home.
Python at home…
Python with extra steps
Literally me every time I want to program something slightly complex in Python.
It’s just YAML…
YAML makes you appreciate Python’s 4 spaces indentation.
I thought python allowed whatever indentation you wanted as long as it’s consistent?
pep8 calls for 4 space but it is a guidance not a rule.
Google internal style guide recommend(ed?) 2 spaces to accomodate the line length limit.
It does, but most style guides and autoformatters will use 4
Python is one of the few languages with an official style guide, I think that guide says 4 spaces.
Tabs!
I’ve set tabs to four spaces in vim because who the fuck defaults tab to eight spaces. That shit looks alien and pushes text off the screen fast.
4 tabs is a bit overboard, don’t you think?
4 spaces? Hard core Python programmers must have a callus on their thumbs.
Just assign tab to 4 spaces.
Mmmm, perfectly level.
I’d love to see your .editorconfig.
…
…
What’s that in your project root? …pom.xml? Misread that at first as porn.xml.
porn.xml
If I had a nickel every time I read it like that
I’m not the OG on this, just an old reddit post I remembered
https://old.reddit.com/r/ProgrammerHumor/comments/9fhvyl/writing_yaml/
But yaml forces the indentation
Python programmer encountering a real programming language for the first time.
Or a former BASIC programmer who really hates braces . . .
[urge to mention that @dosuser123456@lemmy.sdf.org codes in basic intensifies]
WE CAN DO THAT!?!??
… whitespace is whitespace.
deleted by creator
I low key love it. It’s unconventional, but it’s not hard to read
it’s not hard to read
Until there’s missing brace somewhere
I think this could be better for reading but harder for writing. Like you could write a script that converts between this and the easier to write way if you are working on a project with others.
On braces are not used in
if
orfor
statements
I was like, “where are the braces?”. Then, I turned to the right
And then I realized it’s python.
Wait what? It’s Python? But there are semicolons
They mean that the code is being written like it were python. You can’t get rid of the curly braces, but you can shove them all under your bed where mom can’t see.
Thank you. I couldn’t see the problem.
And if this layout is auto generated, maybe I still don’t see the problem.
This looks like a python programmer that is mad they have to write
C#Java…Pretty sure that is Java, not C#
No, you`re right.
This should be its own language. Pyava.
Or Jathon (pronounced like Mike Tyson would pronounce JSON)
Or we can round out the confusion and call it PythonScript
Idk why but i fell in love with this and might just use it now
God
I just realised why we do live coding interviews.
It would be nice and easy if we had elastic tabstops
That’s true, I wanted to port that to Kate for me to test, but I’m too dumb to port the Scala implementation to QT/KDE framework
My credo on this kind of thing is never do something that will make your successor so mad that they find out where you live and post parts of your body to Interpol.
Good fences make good neighbors.
Corollary: server-side commit hooks make good teammates.
Last day at the company, pushed over 5,000 commits. Just style changes, still passes all the checks.
This would never pass PR review.
Jokes on you, we don’t have PR review.
Dear god
He can’t hear you all the way down here.
This is fine.
Do your code reviewers subscribe to the didn’t check looks good model? Joking btw.
I kinda like it…
I think you’ll like Ruby. It has mostly done away with braces and code blocks end with
end
, e.g.def create unless admin redirect_to new_session_path and return @product = Product.new product_params if @product.save flash[:success] = "New product has been created!" redirect_to edit_product_path(@product) and return else flash[:error] = "Something went wrong! render :new end end
This is working code that I simplified a bit from an old project of mine.
Ruby syntax is nice although I prefer python way of enforcing indentation instead of adding "end"s. Personally I just want a statically typed language with enforced indent as syntax.
Funny, the forced indentation is what I hate about Python. If you think a missing semicolon can be hard to catch, don’t ever think about a missing whitespace :p
The
end
keyword really isn’t a big deal for me. I find it to be a good way to easily spot the end of a method. But if you wouldn’t like it I’d still find it a good compromise to avoid syntax issues due to whitespace.i can count on one hand how many times ive had white space issues in 15 years of using python. its just not an issue
Same and agreed, especially if you keep your functions small and focused as you should. 3-5 indents is nbd to keep track of, and if you need more than that… No you don’t, refactor.
I’ve had way more hangups with brackets then indentation, personally, not that either is a super frequent issue, but I’m indenting anyway, so brackets are redundant and just another thing I have to keep track of
}
helps me easily spot the end of stuff.end
just blends into the statements.
Just add a linter to your build lol. Now if it’s indented wrong it breaks!
That’s just Algol instead of B. Most languages use the one or the other, then there’s sexpr-based languages (lisp, scheme), lua (technically Algol but not needing semicolons while also not needing newlines so it’s definitely special), and layout syntax (Haskell, or, if you want a bad implementation, python).
Who’s going to write the extension so that they are all hidden and automatically inserted?
Might check out the Haskell layout rules.
Basically, when you leave out the ‘{’ then Haskell uses your intendation to insert ‘;}’ on later lines between the leading whitespace and the first token.
There some really old Haskell code out there that lines up the ‘{;}’ characters on the left under block-introduction keywords.
It’s not just old Haskell code that’s how you write Haskell if you want explicit braces. Well, mostly generate, but it’s still the idiomatic formatting (and when you generate you always generate braces because it’s easy to get layout subtly wrong when generating).
Haskell also does the whole
data Foo = Bar | Baz | Quux foo = [ Bar , Baz , Quux ]
thing, makes sense to apply it to braces especially as they’re seen only very rarely. Single-line, yes, but not multi-line.
Pseudo-python