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.
 
  • Locked thread
triple sulk
Sep 17, 2014



MeruFM posted:

this is why php is the best language

please dont summon tbc

Adbot
ADBOT LOVES YOU

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Notorious b.s.d. posted:

let me get this clear: we're already discussing one of the most short-term-memory intensive activities in all of human endeavor, and you consider it a net win to add more context-specific behavior?

"short-term-memory intensive activities" is why we use shorthand stuff like "5 + 3" instead of "five plus three" in the first place. common operations are worth having operators for

Valeyard
Mar 30, 2012


Grimey Drawer
Stringbuilder.add("lol")

Notorious b.s.d.
Jan 25, 2003

by Reene

HappyHippo posted:

"short-term-memory intensive activities" is why we use shorthand stuff like "5 + 3" instead of "five plus three" in the first place. common operations are worth having operators for

i would be totally ok with "5.plus(3)"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

i would be totally ok with "5.plus(3)"

how come it doesn't bother you that '.' means both 'the end of a sentence' and 'call a method defined on this object' and 'a decimal number'

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Notorious b.s.d. posted:

i would be totally ok with "5.plus(3)"

thats really gross

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

HappyHippo posted:

"short-term-memory intensive activities" is why we use shorthand stuff like "5 + 3" instead of "five plus three" in the first place. common operations are worth having operators for

is there evidence for a big difference in cognitive load once the expression is familiar? I'm not up on whatever part of neuropsycholonguistics that is, would love to know more.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Subjunctive posted:

is there evidence for a big difference in cognitive load once the expression is familiar? I'm not up on whatever part of neuropsycholonguistics that is, would love to know more.

can a mod please rename this thread 'big hot cognitive loads'

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

how come it doesn't bother you that '.' means both 'the end of a sentence' and 'call a method defined on this object' and 'a decimal number'

because it doesn't mean "the end of a sentence." it's not overloaded

brap
Aug 23, 2004

Grimey Drawer
I'm fine with 5 + 3. I'm fine with 5.plus(3). I'm fine with (+ 5 3). it doesn't really matter.

leftist heap
Feb 28, 2013

Fun Shoe

fleshweasel posted:

I'm fine with 5 + 3. I'm fine with 5.plus(3). I'm fine with (+ 5 3). it doesn't really matter.

what about 5 3 +

Notorious b.s.d.
Jan 25, 2003

by Reene

rrrrrrrrrrrt posted:

what about 5 3 +

this is also fine, assuming nobody ever redefines + to be an arbitrary non-mathematical operation

b0lt
Apr 29, 2005
i prefer the whitespacespace operator for string concatenation

printf("foo" "bar");

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
mathematical operations are totally fine though, right? so for example, if you have some sets, it's totally reasonable to use the + operator to create the union (the additive combination) of those sets. similarly, if you have a ordered collection, it's reasonable to use + to construct the additive combination by appending the contents of another collection.

the real question is why most languages only let you use those operators on a small subset of the types for which they make sense.

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

Jabor posted:

mathematical operations are totally fine though, right? so for example, if you have some sets, it's totally reasonable to use the + operator to create the union (the additive combination) of those sets. similarly, if you have a ordered collection, it's reasonable to use + to construct the additive combination by appending the contents of another collection.

the real question is why most languages only let you use those operators on a small subset of the types for which they make sense.

this but the strings are sets of character sequences

Fullets
Feb 5, 2009
i guess set union and sequence concatenation etc don't overflow thus making them unfit of the purity and beauty of +

cowboy beepboop
Feb 24, 2001

you all love to recommend java but for web frameworks it's a very weird place for a p-langer to come to. play seems to be exclusively scala/gradle and only accidentally and very reluctantly supports java, spring is trying super hard to be modern but if you try and get past the very basic tutorials you need to understand the whole stack and drop wizard seems okay but it assumes you've been programming java since 1.2 and really know why you need guava or guice or whatever the gently caress

did I miss any. oh wait ninja. it can't be good it's called ninja.

Stringent
Dec 22, 2004


image text goes here

my stepdads beer posted:

you all love to recommend java but for web frameworks it's a very weird place for a p-langer to come to. play seems to be exclusively scala/gradle and only accidentally and very reluctantly supports java, spring is trying super hard to be modern but if you try and get past the very basic tutorials you need to understand the whole stack and drop wizard seems okay but it assumes you've been programming java since 1.2 and really know why you need guava or guice or whatever the gently caress

did I miss any. oh wait ninja. it can't be good it's called ninja.

you know it's bad when people unironically recommend grails

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
i sorta agree w/ bsd in that operator overloading is a super horror but + is one of those cases where its so intuitive for it to be string concatenation that its stupid to argue against it

id still rather a good "".format() method for string ops tho

qntm
Jun 17, 2009
I have no problem with using + to concatenate strings together but it bugs me that this is the sole instance of operator overloading in the entire Java programming language

fritz
Jul 26, 2003

PleasureKevin posted:

are there any books are team treehouse videos specifically on content discovery. as in the feature every social media app has where you can find, say, tweets that the computer thinks you might like.

i just need to make the dumbest proof of concept version of that and i'm wondering what other people are doing.

like a "recommender system"?

fritz
Jul 26, 2003

+ is totally fine to combine strings with, if you want a mathematical justification, strings are just elements in the free group generated by all single characters and the + is just the group operation


or you can just deal w/ it, idc

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

qntm posted:

I have no problem with using + to concatenate strings together but it bugs me that this is the sole instance of operator overloading in the entire Java programming language

it's not, really. + on doubles is a different operator from + on integers just like it's a different operator from strings. they're overloaded on types, you just can't extend the set of types.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
ya but the plus operator in foo + bar could be foobar or ? encoded (f + o + o) + (b + a + r) or w/e

having + be the accepted operator for string concatenation doesn't mean that it makes sense

basically what i'm trying to say is that operator overloading is awful and no one should ever do it ever because it literally makes all other programmers looking at your codebase want to murder you

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Blinkz0rz posted:

ya but the plus operator in foo + bar could be foobar or ? encoded (f + o + o) + (b + a + r) or w/e

having + be the accepted operator for string concatenation doesn't mean that it makes sense

basically what i'm trying to say is that operator overloading is awful and no one should ever do it ever because it literally makes all other programmers looking at your codebase want to murder you

sure, and you could encode division differently for floats and integers (some language do) -- does it bother you when they share a symbol?

Shaggar
Apr 26, 2006

my stepdads beer posted:

you all love to recommend java but for web frameworks it's a very weird place for a p-langer to come to. play seems to be exclusively scala/gradle and only accidentally and very reluctantly supports java, spring is trying super hard to be modern but if you try and get past the very basic tutorials you need to understand the whole stack and drop wizard seems okay but it assumes you've been programming java since 1.2 and really know why you need guava or guice or whatever the gently caress

did I miss any. oh wait ninja. it can't be good it's called ninja.

asp.net is the best web stack currently

Shaggar
Apr 26, 2006

qntm posted:

I have no problem with using + to concatenate strings together but it bugs me that this is the sole instance of operator overloading in the entire Java programming language

a better way to think of it is that javas designers correctly realized strings were the only place overloading made sense.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Subjunctive posted:

sure, and you could encode division differently for floats and integers (some language do) -- does it bother you when they share a symbol?

not really. i'm fine with language designers using the same operator to do similar operations on similar types

but letting other programmers do it is terrible

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

qntm posted:

I have no problem with using + to concatenate strings together but it bugs me that this is the sole instance of operator overloading in the entire Java programming language

its more irritating that '+' on strings isn't commutative so it should be something like & or * or something

cool languages just let u define a monoid instance and call it a day!!!

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
people get way too annoyed about operator overloading. its very useful when you really need it and annoying enough to do that most people dont bother when you dont.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

HappyHippo posted:

people get way too annoyed about operator overloading. its very useful when you really need it and annoying enough to do that most people dont bother when you dont.

When do you really need it though

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
vectors, matrices, bigints (if not built in), complex numbers, that sort of thing

also overloading [] has good uses. it would be pretty annoying if std::vector didn't overload it

HappyHippo fucked around with this message at 14:40 on Apr 1, 2015

Shaggar
Apr 26, 2006

MALE SHOEGAZE posted:

When do you really need it though

mostly only math majors need it for doing their math homework and who cares about them.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
careful there we wouldnt want to do any math with our computers

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

HappyHippo posted:

vectors, matrices, bigints (if not built in), complex numbers, that sort of thing

also overloading [] has good uses. it would be pretty annoying if std::vector didn't overload it

allocation control via operator new, smart pointer implementation

e: functors, natural cross-language syntax

Subjunctive fucked around with this message at 14:45 on Apr 1, 2015

Notorious b.s.d.
Jan 25, 2003

by Reene

my stepdads beer posted:

you all love to recommend java but for web frameworks it's a very weird place for a p-langer to come to. play seems to be exclusively scala/gradle and only accidentally and very reluctantly supports java, spring is trying super hard to be modern but if you try and get past the very basic tutorials you need to understand the whole stack and drop wizard seems okay but it assumes you've been programming java since 1.2 and really know why you need guava or guice or whatever the gently caress

did I miss any. oh wait ninja. it can't be good it's called ninja.

wicket is a little more "batteries included" than spring mvc

Forums Terrorist
Dec 8, 2011

HappyHippo posted:

careful there we wouldnt want to do any math with our computers

let's be honest programming stopped being math a decade or so ago, now it's all just bashing poo poo together like cavemen

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Subjunctive posted:

"that story doesn't add up"

"OF COURSE IT DOESN'T IT'S A SERIES OF EVENTS AND NOT MEMBERS OF A CLOSED SET"

brap
Aug 23, 2004

Grimey Drawer
+ to append to a list is fine but functional programmers go too far and start making up >>= and poo poo that is 1. unreadable 2. impossible to google and get documentation for

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

fleshweasel posted:

+ to append to a list is fine but functional programmers go too far and start making up >>= and poo poo that is 1. unreadable 2. impossible to google and get documentation for

https://www.haskell.org/hoogle/?hoogle=%3E%3E%3D

  • Locked thread