Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Fortaleza
Feb 21, 2008

If it’s the “walrus” operator it should be :3=

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

what’s the walrus operator

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

fart simpson posted:

what’s the walrus operator

:=

(duh)

MrQueasy
Nov 15, 2005

Probiot-ICK

fart simpson posted:

what’s the walrus operator

assignment expression

(x := 3) returns the value of x when it resolves.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

so it’s just a way to do variable assignment as an expression rather than as a statement?

MrQueasy
Nov 15, 2005

Probiot-ICK

fart simpson posted:

so it’s just a way to do variable assignment as an expression rather than as a statement?

Yes.

It's more useful in languages with strong scoping, but it lets you eliminate some nested ifs so I think it's nice, but most of the time in python it just highlights some tortured logic that needs refactoring anyway.

FlapYoJacks
Feb 12, 2009

MrQueasy posted:

Yes.

It's more useful in languages with strong scoping, but it lets you eliminate some nested ifs so I think it's nice, but most of the time in python it just highlights some tortured logic that needs refactoring anyway.

It’s great for return statements.

Python code:
if cloud := butt()
    return cloud
instead of:

Python code:
cloud = butt()
if cloud:
    return cloud

No Pants
Dec 10, 2000

Corla Plankun posted:

anyone have a good reference handy for C# parallelism/coroutines/whatever-the-gently caress for programmers that already understand the concepts and are just trying to figure out what the specific implementations look like in c#?

if you mean parallelism in general, the magic words are task parallel library

https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/task-based-asynchronous-programming

Corla Plankun
May 8, 2007

improve the lives of everyone

this looks extremely good, thank you! I'll check it out tomorrow when I'm on the clock

Ocean of Milk
Jun 25, 2018

oh yeah

MrQueasy posted:

public interface EnumerableAssert<SELF extends EnumerableAssert<SELF, ELEMENT>, ELEMENT> {
(from AssertJ)

I just stumbled upon this at work:

code:
public abstract class AbstractIterableAssert<SELF extends AbstractIterableAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>,
                                             ACTUAL extends Iterable<? extends ELEMENT>,
                                             ELEMENT,
                                             ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>>
       extends AbstractAssert<SELF, ACTUAL>
       implements ObjectEnumerableAssert<SELF, ELEMENT> 
:psyduck:

(tbf, they documented it)

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

MrQueasy posted:

assignment expression

(x := 3) returns the value of x when it resolves.

i like assignment expression but I hate ‘walrus operator’

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
go does a lot of things wrong but assignment expression and the way it handles shadowing aren’t two of them

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

in haskell basically everything is an expression, there are no statements

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


Why don't you marry Haskell if you love it so much

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


Fart Simpson | Haskell

Look the perfect Union

Workaday Wizard
Oct 23, 2009

by Pragmatica
:= is the chode operator

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Armitag3 posted:

Why don't you marry Haskell if you love it so much

maybe i will. thanks for the idea

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Armitag3 posted:

Why don't you marry Haskell if you love it so much

don’t think op is their type

Bloody
Mar 3, 2013

Boiled Water posted:

don’t think op is their type

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Boiled Water posted:

don’t think op is their type

lmao

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Boiled Water posted:

don’t think op is their type

lol

mystes
May 31, 2006

Armitag3 posted:

Why don't you marry Haskell if you love it so much
It has too many side effects.

Share Bear
Apr 27, 2004

Boiled Water posted:

don’t think op is their type

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Boiled Water posted:

don’t think op is their type

Soricidus
Oct 21, 2010
freedom-hating statist shill

Boiled Water posted:

don’t think op is their type

Shaggar
Apr 26, 2006

Boiled Water posted:

don’t think op is their type

lol

MrQueasy
Nov 15, 2005

Probiot-ICK

Ocean of Milk posted:

I just stumbled upon this at work:

code:
public abstract class AbstractIterableAssert<SELF extends AbstractIterableAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>,
                                             ACTUAL extends Iterable<? extends ELEMENT>,
                                             ELEMENT,
                                             ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>>
       extends AbstractAssert<SELF, ACTUAL>
       implements ObjectEnumerableAssert<SELF, ELEMENT> 
:psyduck:

(tbf, they documented it)

The Generics abuse by the AssertJ is nothing short of miraculous. It’s only tolerable/usable because their documentation practice is one of the best I’ve seen in Java land.

And it keeps them from having to use reflection/bytecode shenanigans more than they already do.

raminasi
Jan 25, 2005

a last drink with no ice

Brain Candy posted:

you'll never convince me that IFoo indicating that Foo is an interface is anything other than MS brain damage, sorry

better than Foo/FooImpl imo

Sapozhnik
Jan 2, 2005

Nap Ghost

raminasi posted:

better than Foo/FooImpl imo

Disagree because identifiers following the latter convention sort better

MrQueasy
Nov 15, 2005

Probiot-ICK

Sapozhnik posted:

Disagree because identifiers following the latter convention sort better

Look at this doofus not putting all his interfaces into a completely separate module so the sorting is hosed up no matter what you do.

Corla Plankun
May 8, 2007

improve the lives of everyone
god loving dammit guys shut up about variable names

psiox
Oct 15, 2001

Babylon 5 Street Team

Corla Plankun posted:

stop using hungarian notation you shitstains

Share Bear
Apr 27, 2004

ok how about this

https://pythonspeed.com/articles/faster-python/

so regular libc is faster than musl at the expense of size

however the flags you pass to build python can potentially impact performance up to 20%

i have a small project to attempt to fuzz the builds but it seems like a really stupid way to try and find other optimizations

Workaday Wizard
Oct 23, 2009

by Pragmatica

Corla Plankun posted:

god loving dammit guys shut up about variable names

Presto
Nov 22, 2002

Keep calm and Harry on.
C++20 has the UFO operator <=>

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I think ruby calls that the spaceship operator. but ruby also has flip flop operators so probably best not to follow ruby's lead

also I like the "wtf is that" feeling conveyed by "ufo"

Kazinsal
Dec 13, 2011
unidentified fuckup operator

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
ur hosed, op

Truman Peyote
Oct 11, 2006



you can always use git blame to identify the fuckup

Adbot
ADBOT LOVES YOU

MrQueasy
Nov 15, 2005

Probiot-ICK

Presto posted:

C++20 has the UFO operator <=>

Amateur hour.

Haskell has an owl combinator that looks like a topless woman wearing a necklace.

((.)$(.))

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply