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
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

tef posted:

.sort(reversed=True)

so you specify that per key in the tuple?

Adbot
ADBOT LOVES YOU

b0lt
Apr 29, 2005

tef posted:

i am really curious what cmp stuff people are doing because i really don't ever write them since i stopped doing java

the quasilexicographic order is pretty handy

tef
May 30, 2004

-> some l-system crap ->

Subjunctive posted:

so you specify that per key in the tuple?

oh reverse sort on a subset of a property? i guess you'd have to wrangle with a key function :v:

Shaggar
Apr 26, 2006

tef posted:

i use key more than i ever used cmp. most of the python types already have comparisons, and for user types, implementing <, >, >=, <= is usually enough.

i do a lot of sorting by property, but not as much as sorting in default order, and very rarely sorting with a custom ordering

it is the ultimate ironing of ironings that python managed to find the most boilerplate possible way of doing default comparisons

multigl
Nov 22, 2005

"Who's cool and has two thumbs? This guy!"
i have strong opinions about sorting,

Athas
Aug 6, 2007

fuck that joker

multigl posted:

i have strong opinions about sorting,

Any program is just a sort with a sufficiently complicated comparison operator. This is serious stuff.

gonadic io
Feb 16, 2011

>>=

Athas posted:

Any program is just a sort with a sufficiently complicated comparison operator. This is serious stuff.

i wish u'd sort ur posting out op

Max Facetime
Apr 18, 2009

tef posted:

i am really curious what cmp stuff people are doing because i really don't ever write them since i stopped doing java

something like
Java code:
	static void ehh(List<Point> points) {
		points.sort(Comparator.comparing(p -> p.x));
	}

Bloody
Mar 3, 2013

MononcQc posted:

Python programmers are known to work in memory constrained environments and never complain about speed of their programs, so that change was totally unwarranted.

Lol yeah lemme fire up a garbage collected interpreted scripting language for a loving memory constrained environment. Let's just add in some nodejs for when we need to get close to the metal.

tef
May 30, 2004

-> some l-system crap ->

Max Facetime posted:

something like
Java code:
	static void ehh(List<Point> points) {
		points.sort(Comparator.comparing(p -> p.x));
	}

this is using a key function ???

Bloody
Mar 3, 2013

the only time i have done something with a sort other than sorting numeric values or maybe strings in a default way was when i lazily used it to shuffle a list but i ultimately wound up adding a separate key to the item i was sorting that was pseudorandomly defined at instantiation (which was very important because for a given seed the random ordering had to be the same) and then sorting however c# wanted to on that key.

tef
May 30, 2004

-> some l-system crap ->

Bloody posted:

the only time i have done something with a sort other than sorting numeric values or maybe strings in a default way was when i lazily used it to shuffle a list but i ultimately wound up adding a separate key to the item i was sorting that was pseudorandomly defined at instantiation (which was very important because for a given seed the random ordering had to be the same) and then sorting however c# wanted to on that key.

again this is a key, not a comparator.

Max Facetime
Apr 18, 2009

tef posted:

this is using a key function ???

yes, isn't it amazing how flexible comparators are??

Bloody
Mar 3, 2013

tef posted:

again this is a key, not a comparator.

i also do not give even a single gently caress. i gave an object a property and asked linq to sort the objects on that property and it did.

MononcQc
May 29, 2007

Bloody posted:

Lol yeah lemme fire up a garbage collected interpreted scripting language for a loving memory constrained environment. Let's just add in some nodejs for when we need to get close to the metal.

:thejoke:

Bloody
Mar 3, 2013

:downs:

Cybernetic Vermin
Apr 18, 2005

this is a weird debate since there is literally no way to defend the decision of removing the cmp= bit, proven by loving *guido* showing regret, so what can we even argue about other than randomly explaining how some things are not java to shaggar?

Brain Candy
May 18, 2006

Cybernetic Vermin posted:

this is a weird debate since there is literally no way to defend the decision of removing the cmp= bit, proven by loving *guido* showing regret, so what can we even argue about other than randomly explaining how some things are not java to shaggar?

if you don't want to read page after page of nerds talking past each other over trivial bullshit, i don't know why you read this thread

leftist heap
Feb 28, 2013

Fun Shoe

Brain Candy posted:

if you don't want to read page after page of nerds talking past each other over trivial bullshit, i don't know why you read yospos

leftist heap
Feb 28, 2013

Fun Shoe
too easy really

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Staples Easy Button TM

MeruFM
Jul 27, 2010
there's many many good reasons to remove something that serves a similar purpose for the sake of language design

see js, c++

VikingofRock
Aug 24, 2008




Honestly I think that having more ways of doing something usually makes a language richer and more expressive, and I would much rather have many ways of doing something than be forced into something clunky because the natural way isn't "pythonic" or something.


Also C++ has its warts but it is a much, much, much, much, much better-designed language than javascript.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

i still don't get the joke???????

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Suspicious Dish posted:

Staples Easy Button TM

my girlfriend used to work at staples








i wish she had an easy button!!!!

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

MALE SHOEGAZE posted:

my girlfriend used to work at staples








i wish she had an easy button!!!!

she does

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
its just a lil hard to find

CPColin
Sep 9, 2003

Big ol' smile.

VikingofRock posted:

Also C++ has its warts but it is a much, much, much, much, much better-designed language than javascript.

One usually is greater than zero, yes.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

VikingofRock posted:

Honestly I think that having more ways of doing something usually makes a language richer and more expressive, and I would much rather have many ways of doing something than be forced into something clunky because the natural way isn't "pythonic" or something.


Also C++ has its warts but it is a much, much, much, much, much better-designed language than javascript.


Hm, yes, the design of a language designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support, can be meaningfully compared to

JewKiller 3000
Nov 28, 2006

by Lowtax
roflmao if you ever use python for anything

VikingofRock
Aug 24, 2008




MALE SHOEGAZE posted:

Hm, yes, the design of a language designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support, can be meaningfully compared to

meh I think you can compare the overall design of two languages even if they were designed to do different things. the post I was responding to said that C++ suffers from poor design and feature bloat, and I while you can make a case for both it's pretty ridiculous to imply that c++'s design is bad on the level of js.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

JewKiller 3000 posted:

roflmao if you ever use python for anything

i used to like python and then i figured out haskell is way better

VikingofRock
Aug 24, 2008




fart simpson posted:

i used to like python and then i figured out haskell is way better

the truth

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

fart simpson posted:

i used to like python and then i figured out haskell is way better

compuserved
Mar 20, 2006

Nap Ghost
C is Manly, Python is for "n00bs": How False Stereotypes Turn Into Technical "Truths"

compuserved
Mar 20, 2006

Nap Ghost

quote:

We should not beckon people into our field only to then ostracize them for the sin of learning PHP.

you are absolved of your sin, tbc

MeruFM
Jul 27, 2010
I think we'd all be happier not thinking about any of this and just make money pretending to know how to program.

MeruFM
Jul 27, 2010

VikingofRock posted:

meh I think you can compare the overall design of two languages even if they were designed to do different things. the post I was responding to said that C++ suffers from poor design and feature bloat, and I while you can make a case for both it's pretty ridiculous to imply that c++'s design is bad on the level of js.

I did not imply what you think I implied. Using multiple examples does not imply complete equivalence

akadajet
Sep 14, 2003


lol really?

Adbot
ADBOT LOVES YOU

compuserved
Mar 20, 2006

Nap Ghost
python is for snake aficionados

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