There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Heavybell ,
@Heavybell@lemmy.world avatar

This looks like a python programmer that is mad they have to write C#…

clot27 ,
@clot27@lemm.ee avatar

looks clean tbh

p0windah ,

Inspired. Truly.

pineapplelover ,

I was like, “where are the braces?”. Then, I turned to the right

AlecSadler ,

And then I realized it’s python.

nexussapphire ,

Last day at the company, pushed over 5,000 commits. Just style changes, still passes all the checks.

KairuByte ,

This would never pass PR review.

Binette ,

Pseudo-python

MadMadBunny ,

WE CAN DO THAT!?!??

Skullgrid ,
@Skullgrid@lemmy.world avatar

… whitespace is whitespace.

Revan343 ,

I kinda like it, easy to see unbalanced braces

victorz ,

;}}}

MTK ,

Honestly, looks neat, might adopt this

Sanctus ,
@Sanctus@lemmy.world avatar
the_tab_key ,

I forgot Moses was in Tron

TunaCowboy , (edited )

What if I prefer this?


<span style="color:#323232;">#define CURLYOPENRIGHTCLOSEDLEFTBRACKET {
</span><span style="color:#323232;">#define CURLYOPENLEFTCLOSEDRIGHTBRACKET }
</span><span style="color:#323232;">#define CURVYOPENRIGHTCLOSEDLEFTBRACKET (
</span><span style="color:#323232;">#define CURVYOPENLEFTCLOSEDRIGHTBRACKET )
</span><span style="color:#323232;">#define PERIODWITHPERIODONTOP :
</span><span style="color:#323232;">#define COMMAWITHPERIODONTOP ;
</span><span style="color:#323232;">
</span><span style="color:#323232;">int main CURVYOPENRIGHTCLOSEDLEFTBRACKET CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">  if CURVYOPENRIGHTCLOSEDLEFTBRACKET 1 CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">    asm volatile CURVYOPENRIGHTCLOSEDLEFTBRACKET
</span><span style="color:#323232;">      "mov $1, %%raxn"
</span><span style="color:#323232;">      "mov $1, %%rdin"
</span><span style="color:#323232;">      "lea message(%%rip), %%rsin"
</span><span style="color:#323232;">      "mov $4, %%edxn"
</span><span style="color:#323232;">      "syscalln"
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP
</span><span style="color:#323232;">      PERIODWITHPERIODONTOP "%rax", "%rdi", "%rsi", "%rdx"
</span><span style="color:#323232;">    CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
</span><span style="color:#323232;">  CURLYOPENLEFTCLOSEDRIGHTBRACKET
</span><span style="color:#323232;">  return 0 COMMAWITHPERIODONTOP
</span><span style="color:#323232;">CURLYOPENLEFTCLOSEDRIGHTBRACKET
</span><span style="color:#323232;">
</span><span style="color:#323232;">asm CURVYOPENRIGHTCLOSEDLEFTBRACKET ".section .datan"
</span><span style="color:#323232;">  "message: .ascii "wut\n"n"
</span><span style="color:#323232;">  ".section .textn" CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
</span>
humbletightband ,

You can’t be helped, sorry. We will put you to an asylum for people like you

milicent_bystandr ,

Asylum? We have the electric chair for this.

humbletightband ,

Yeah, now I see why you want him dead. He used mov after lea

MajorHavoc ,

Thanks. I hate it.

z500 ,
@z500@startrek.website avatar

You win a free trip to the Hague

SkyezOpen ,

They don’t even deserve the trial. Straight to gulag.

dariusj18 ,

Can this be done with emoji?

xmunk ,

Acceptable, just FYI I added a pre-commit git hook, please rebase your changes.

magic_lobster_party , (edited )

I’m more concerned about that poor stack with all those recursions.

It’s also O(n^2) O(n!). I’m not sure what they’re trying to do, but I’m sure it can be done in O(n) (or at least polynomial).

Reject.

Fillicia ,
user224 , (edited )

Mmmm, perfectly level.

gofsckyourself ,

It’s just YAML…

Fillicia ,

YAML makes you appreciate Python’s 4 spaces indentation.

victorz ,

I thought python allowed whatever indentation you wanted as long as it’s consistent?

zalgotext ,

It does, but most style guides and autoformatters will use 4

HK65 ,

Python is one of the few languages with an official style guide, I think that guide says 4 spaces.

northendtrooper ,

Tabs!

nexussapphire ,

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.

ulterno ,
@ulterno@lemmy.kde.social avatar

I set my clang-format to tabs only (actual tabs ASCII 0x9, no alignment and there is a continuation tab instead), then anyone can set their editor to whatever tab length they feel like and look at their code however they want.

But no spaces on the left of my code. This is for C, C++ and JSON.

oscar ,

Linux uses 8 spaces. Excerpt from the official style guide:

Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

Rationale: The whole idea behind indentation is to clearly define where a block of control starts and ends. Especially when you’ve been looking at your screen for 20 straight hours, you’ll find it a lot easier to see how the indentation works if you have large indentations.

Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.

In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep. Heed that warning.

The reasoning seems sound, but I still prefer 4 personally.

Fillicia ,

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.

mariusafa ,

Literally me every time I want to program something slightly complex in Python.

some_guy ,

What the fuck!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines