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
sarehu
Apr 20, 2007

(call/cc call/cc)
Just a general question. Is the PL world full of people that are incredibly stupid?

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

sarehu posted:

Just a general question. Is the PL world full of people that are incredibly stupid?

it has people in it

MeruFM
Jul 27, 2010
worse it has lots of academics

Soricidus
Oct 21, 2010
freedom-hating statist shill

sarehu posted:

people are incredibly stupid?

yes

Cybernetic Vermin
Apr 18, 2005

pl attracts a lot of very spergy people, obsessed with mindless consistency and perceived elegance, and then it attracts the exact opposite, who try to rebel by eschewing all thought and planning, mashing whatever catches their fancy that day together into barely functioning systems

it is a field very low on actual pragmatic planning

Workaday Wizard
Oct 23, 2009

by Pragmatica

sarehu posted:

Just a general question. Is the PL world full of people that are incredibly stupid?

werent you writing a pl? lol

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Cybernetic Vermin posted:

mashing whatever catches their fancy that day together into barely functioning systems

but they are functioning

Sapozhnik
Jan 2, 2005

Nap Ghost
copy-pasting a bunch of boilerplate over and over is often better than some mystical metaprogramming voodoo.

your ide can automate a lot of the copy-pasting.

netcat
Apr 29, 2008

Mr Dog posted:

copy-pasting a bunch of boilerplate over and over is often better than some mystical metaprogramming voodoo.

your ide can automate a lot of the copy-pasting.

I love copy-pasting bugs and having to fix the bug in multiple places.

more like dICK
Feb 15, 2010

This is inevitable.
Ah a golang programmer

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

more like dICK posted:

Ah a golang programmer

ive seen several go programmers bring out the "your ide can automate the copy-pasting" argument. i dont think ive seen any other kind of programmer make that argument.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
although i wouldnt be surprised to see a java programmer make it

Sapozhnik
Jan 2, 2005

Nap Ghost
sometimes the best thing to do is C&P. Other times it is not. There are upsides and downsides. Downsides are well-known and consist of increased maintenance burden and addition of visual noise that obscures important detail. The downsides are not absolute and sometimes it seems like the only way to make people care about the downside of metaprogramming monstrosities is to tell them that the performance is bad, as opposed to mentioning actual good reasons like the fact that it is not immediately clear what is going on.

Java is a good language because you can metaprogram in it (for rather lax definitions of metaprogramming) but it makes it just painful enough that it forces you to think twice about whether it is actually a good idea or not.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
yes but is it taking up so much of your time that you need to automate the process?

Sapozhnik
Jan 2, 2005

Nap Ghost
Kinda but not really. Like in Java you'll usually autogenerate your accessors. But that's good, because calling an accessor should look different from accessing a data member, I don't like C# style properties much although I don't have that strong an opinion on the matter.

jony neuemonic
Nov 13, 2009

Mr Dog posted:

Kinda but not really. Like in Java you'll usually autogenerate your accessors. But that's good, because calling an accessor should look different from accessing a data member, I don't like C# style properties much although I don't have that strong an opinion on the matter.

eh, i agree in principle but c# properties are so convenient that i end up never using public data members anyway.

FamDav
Mar 29, 2008
just use lombok

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

jony neuemonic posted:

eh, i agree in principle but c# properties are so convenient that i end up never using public data members anyway.

I like c# properties because they let you be really lazy while still making it easy to add logic to the getters and setters later if you need to.

Brain Candy
May 18, 2006

FamDav posted:

just use lombok

use http://immutables.github.io/ instead because who uses setters

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Brain Candy posted:

use http://immutables.github.io/ instead because who uses setters

pojos :(

JewKiller 3000
Nov 28, 2006

by Lowtax
look you are supposed to have a nullary constructor and then for every field x, you have getX() and setX(), so your class is basically just a stupid struct. you do this because it means you have a java bean. what is a java bean? nobody knows. why would you need one? nobody knows.

Soricidus
Oct 21, 2010
freedom-hating statist shill

JewKiller 3000 posted:

what is a java bean?

a miserable pile of servlets

Soricidus
Oct 21, 2010
freedom-hating statist shill
or possibly a programmer played by rowan atkinson

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
we are all java beans

Sapozhnik
Jan 2, 2005

Nap Ghost

JewKiller 3000 posted:

look you are supposed to have a nullary constructor and then for every field x, you have getX() and setX(), so your class is basically just a stupid struct. you do this because it means you have a java bean. what is a java bean? nobody knows. why would you need one? nobody knows.

look at this scrub who isn't using builders

also nio-style accessor supremacy

(java beans are user interface components adhering to certain conventions, most of which have been totally forgotten about. somehow people started getting the idea that you should apply some random subset of a user interface component convention to objects carrying your poo poo to and from a database)

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Mr Dog posted:

copy-pasting a bunch of boilerplate over and over is often better than some mystical metaprogramming voodoo.

your ide can automate a lot of the copy-pasting.
Now your mystical metaprogramming voodoo is implemented in various incomplete, poorly documented, and mutually incompatible ways in your users' IDEs.

Cybernetic Vermin
Apr 18, 2005

yeah, i really don't think the ide code generation thing is a good route overall, if you can express what you wanted to do in a few keypresses in the ide it very likely should be a few keypresses in the actual code, possibly with the ide giving some *view* of the keypresses which makes it more readable, but actually realizing a huge chunk of code from the keypresses at once is really dubious

Cybernetic Vermin
Apr 18, 2005

copy-paste otoh is itself not necessarily bad, trying to generalize code excessively when you need a couple of different variants with "real" differences added may create more dependencies than is really desirable

Fututor Magnus
Feb 22, 2016

by FactsAreUseless

Cybernetic Vermin posted:

pl attracts a lot of very spergy people, obsessed with mindless consistency and perceived elegance, and then it attracts the exact opposite, who try to rebel by eschewing all thought and planning, mashing whatever catches their fancy that day together into barely functioning systems

it is a field very low on actual pragmatic planning

Also fascists, e.g. Moldbug

raminasi
Jan 25, 2005

a last drink with no ice

Cybernetic Vermin posted:

copy-paste otoh is itself not necessarily bad, trying to generalize code excessively when you need a couple of different variants with "real" differences added may create more dependencies than is really desirable

and sometimes two different parts of the codebase just happen to need to do the same thing but aren't really conceptually the same. i saw this a lot when novices got ahold of inheritance and would do poo poo like inherit Point from Vector because they both have x, y, and z.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

raminasi posted:

and sometimes two different parts of the codebase just happen to need to do the same thing but aren't really conceptually the same. i saw this a lot when novices got ahold of inheritance and would do poo poo like inherit Point from Vector because they both have x, y, and z.

affine spaces sucks, vector spaces ftw

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
copy and pasted code is easy to delete

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

raminasi posted:

and sometimes two different parts of the codebase just happen to need to do the same thing but aren't really conceptually the same. i saw this a lot when novices got ahold of inheritance and would do poo poo like inherit Point from Vector because they both have x, y, and z.

i see a lot of the reverse where people excessively factor out tasks within a function into private helper functions to make the code look cleaner but they're functions that receive 90% of the state of the caller via arguments and could never conceivably be used elsewhere. Sometimes this is OK if you can do it with one or two arguments and a clean return value, but more often than not I see people just encapsulating each loop or bit of logic a function does into helpers that take 15 arguments with out params and stuff and it's horrible.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
yeah when i refactor i often start with a "reverse refactor" where i copy "factored out" code into each function and then clean it up

VikingofRock
Aug 24, 2008




edit: I'm dumb

Volte
Oct 4, 2004

woosh woosh

LeftistMuslimObama posted:

i see a lot of the reverse where people excessively factor out tasks within a function into private helper functions to make the code look cleaner but they're functions that receive 90% of the state of the caller via arguments and could never conceivably be used elsewhere. Sometimes this is OK if you can do it with one or two arguments and a clean return value, but more often than not I see people just encapsulating each loop or bit of logic a function does into helpers that take 15 arguments with out params and stuff and it's horrible.
this is why nested functions are necessary

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

LeftistMuslimObama posted:

i see a lot of the reverse where people excessively factor out tasks within a function into private helper functions to make the code look cleaner but they're functions that receive 90% of the state of the caller via arguments and could never conceivably be used elsewhere. Sometimes this is OK if you can do it with one or two arguments and a clean return value, but more often than not I see people just encapsulating each loop or bit of logic a function does into helpers that take 15 arguments with out params and stuff and it's horrible.

there's a whole school of thought that this is the best poo poo ever. typically these people also advocate for arbitrary limits on the number of lines or blocks in a function. i dont get these people.

gonadic io
Feb 16, 2011

>>=
ask me about having a coworker that obsessively moves half of the lines of code in any given method into a 1-line 1-use helper function for each one. it's not like they're long or complicated lines but there are so many functions like

code:
private def removeButts(bodyParts: List[BodyPart]): List[BodyPart] =
  bodyParts.filterNot(isButt).filterNot(isAss).filterNot(isTushie)
and it drives me insane

gonadic io fucked around with this message at 22:10 on Jun 29, 2016

Vanadium
Jan 8, 2005

Volte posted:

this is why nested functions are necessary

and why nested functions in rust are poo poo

Adbot
ADBOT LOVES YOU

raminasi
Jan 25, 2005

a last drink with no ice

HappyHippo posted:

there's a whole school of thought that this is the best poo poo ever. typically these people also advocate for arbitrary limits on the number of lines or blocks in a function. i dont get these people.

if this school of thought is the one i'm thinking of it also basically mandates that the extracted functions be binary at most, and i think it works well as long as you follow that rule too. doing it with four ref parameters or whatever is just insane.

gonadic io posted:

ask me about having a coworker that obsessively moves half of the lines of code in any given method into a 1-line 1-use helper function for each one. it's not like they're long or complicated lines but there are so many functions like

code:
private def removeButts(bodyParts: List[BodyPart]): List[BodyPart] =
  bodyParts.filterNot(isButt).filterNot(isAss).filterNot(isTushie)
and it drives me insane

see, i like this (but only if you have nested functions)

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