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
carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

fart simpson posted:

c# has linq checkmate

every time i see linq it just looks like standard pipelining functions, what does it add? genuinely curious

Adbot
ADBOT LOVES YOU

FlapYoJacks
Feb 12, 2009

Powerful Two-Hander posted:

ffffuck why would you create a class that contains fields then only ever create instances of it so you can call its methods which all return lists of the class itself

what the actual gently caress. why not just create a struct and return lists of that and put the methods in a namespace that makes some goddamn sense instead of it being in the "models" namespace and accessing them by creating instances of the model every single time

I once had a C++ "programmer" ask me what structs are for.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

carry on then posted:

every time i see linq it just looks like standard pipelining functions, what does it add? genuinely curious

how good is java at pipelining functions

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

linq is monads

Powerful Two-Hander
Mar 10, 2004

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


ratbert90 posted:

I once had a C++ "programmer" ask me what structs are for.

some of this code (not that bit) dates back 10 years and is peppered with hungarian notation or whatever the gently caress it is so it has "m_" all over the goddamn place which fucks up trying to use Dapper to map poo poo and has also had a solid 7 years of offshore dev illogical naming applied to it. Like, what would you expect a class named "CloneFoo" to do? create a copy of Foo right?

Wrong. CloneFoo was instanced to access its methods that create lists of CloneFoo and these lists are actually the lists of things that you might want to clone an instance of Bar on to

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Sapozhnik posted:


half of the dumb poo poo in scala


Sapozhnik
Jan 2, 2005

Nap Ghost
posting on the hacker page

Sapozhnik
Jan 2, 2005

Nap Ghost
java 8 has streams. just as good as linq

.collect(Collectors.toList()) at the end of every pipeline is a bit wordy though. on the bright side you can collect to your own collection classes, such as Guava's immutable collections.

Shaggar
Apr 26, 2006
java streams are not great cause the function names are crap compared to linq.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Powerful Two-Hander posted:

some of this code (not that bit) dates back 10 years and is peppered with hungarian notation or whatever the gently caress it is so it has "m_" all over the goddamn place which fucks up trying to use Dapper to map poo poo and has also had a solid 7 years of offshore dev illogical naming applied to it. Like, what would you expect a class named "CloneFoo" to do? create a copy of Foo right?

Wrong. CloneFoo was instanced to access its methods that create lists of CloneFoo and these lists are actually the lists of things that you might want to clone an instance of Bar on to

ya that's hungarian notation. were required to use it in all our vb6 code here because vb6s intellisense suxxxx

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Sapozhnik posted:

posting on the hacker page

cinci zoo sniper
Mar 15, 2013




Sapozhnik posted:

posting on the hacker page

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
posting on the sex number page

Powerful Two-Hander
Mar 10, 2004

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


cis autodrag posted:

ya that's hungarian notation. were required to use it in all our vb6 code here because vb6s intellisense suxxxx

yeah this was written by former VB6 devs I think so that would explain it.

i wish the Hungarian guy that used to work here was still around so I could blame this on him somehow


Possible next horror, every single class inherits from a base that manually specifies destructors and these get called at seemingly arbitrary points, do we think this is:

a) "that's the way we've always done it"

b) this is really old and piles so much stuff into the session state that the ancient webserver it used to run on couldn't cope without aggressively throwing away objects

c) nobody knew what the using{} statement was or possibly it didn't exist

d) possibly a legit reason idk? I'm struggling to think why some classes would need to make explicit disposal calls but everything else doesn't. there are no unmanaged resources being used here btw


Edit:

e) 1337 hax

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Powerful Two-Hander posted:

yeah this was written by former VB6 devs I think so that would explain it.

i wish the Hungarian guy that used to work here was still around so I could blame this on him somehow


for the record the "m_" prefix usually means "global variable" if that helps u at all :)

Powerful Two-Hander
Mar 10, 2004

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


cis autodrag posted:

for the record the "m_" prefix usually means "global variable" if that helps u at all :)

in this instance it's indicating a private member that is then exposed through a public getter/setter combo

except most of the time the methods called that populate the fields are just writing direct to the private field rendering the exercise completely pointless

Mao Zedong Thot
Oct 16, 2008


postin on hacker page

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Powerful Two-Hander posted:

in this instance it's indicating a private member that is then exposed through a public getter/setter combo

except most of the time the methods called that populate the fields are just writing direct to the private field rendering the exercise completely pointless

that's what i mean. the m_Var thing means that this is a global field within the class. generally at least in vb6 land that also means that youre not going to bother to use the getters or setters within the class.

Share Bear
Apr 27, 2004

fritz posted:

hard to say w/o more context but could you have repeats in the y s?



does that help? I'm trying to figure out what the curly brackets mean or imply

silvergoose
Mar 18, 2006

IT IS SAID THE TEARS OF THE BWEENIX CAN HEAL ALL WOUNDS




Sapozhnik posted:

posting on the hacker page

Powerful Two-Hander
Mar 10, 2004

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


cis autodrag posted:

that's what i mean. the m_Var thing means that this is a global field within the class. generally at least in vb6 land that also means that youre not going to bother to use the getters or setters within the class.

oh right sorry, whenever i see "global" i read it as the "available anywhere in the application" sense aka what i used to do in Matlab because i did not know what variable scope was

Bloody
Mar 3, 2013

linq is good because it was the first modern instance of linq. java 8 doesnt get linq without c# doing it ten years prior

30 TO 50 FERAL HOG
Mar 2, 2005



Powerful Two-Hander posted:

in this instance it's indicating a private member that is then exposed through a public getter/setter combo

except most of the time the methods called that populate the fields are just writing direct to the private field rendering the exercise completely pointless

i do this for all class members even if the getter/setter is just a straight passthrough for consistency :shrug:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Powerful Two-Hander posted:

oh right sorry, whenever i see "global" i read it as the "available anywhere in the application" sense aka what i used to do in Matlab because i did not know what variable scope was

ya, in vb6 there's this horror show where the first 200 lines of your class end up being all these private global variables that control way too much of your class's behavior. you can of course do that in any language, but vb6 practically requires it to get any kind of complex behavior out of the thing.

CPColin
Sep 9, 2003

Big ol' smile.

Sapozhnik posted:

posting on the hax0r page

:krad:

Powerful Two-Hander
Mar 10, 2004

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


BiohazrD posted:

i do this for all class members even if the getter/setter is just a straight passthrough for consistency :shrug:

please stay away from my codebase tia, otherwise we will have a strong argument about who's view of the "correct" way to write code is "correct"


cis autodrag posted:

ya, in vb6 there's this horror show where the first 200 lines of your class end up being all these private global variables that control way too much of your class's behavior. you can of course do that in any language, but vb6 practically requires it to get any kind of complex behavior out of the thing.

this is exactly the root cause I guarantee because this app was written just after asp.net became available and before that everything in house was vb.net or older. you can almost literally see the changes in "best practice" over time as you look through the code....well where they're actually followed anyway.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Share Bear posted:

does that help? I'm trying to figure out what the curly brackets mean or imply

basically you have a set (indicated by the {} brackets)

each element of the set is a pair, containing the xi vector and the corresponding data point yi.

it doesn't actually have any deep meaning or anything, you should probably read forward until they start actually doing something with that data. once you know what they're trying to achieve, the representations chosen will make more sense

big shtick energy
May 27, 2004


Hungarian notation was in the coding standard here when I started and I never really questioned it because it seemed fine, but now I'm kinda questioning if it's worth it. I mean I guess it's a bit redundant since the compiler is checking your types

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

BiohazrD posted:

i do this for all class members even if the getter/setter is just a straight passthrough for consistency :shrug:

must feel really good to write code that your ide immediately tells you to delete

ThePeavstenator
Dec 18, 2012

:burger::burger::burger::burger::burger:

Establish the Buns

:burger::burger::burger::burger::burger:
it's me, the guy who has his IDE automatically generate getters and setters for every member

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Jabor posted:

basically you have a set (indicated by the {} brackets)

each element of the set is a pair, containing the xi vector and the corresponding data point yi.

it doesn't actually have any deep meaning or anything, you should probably read forward until they start actually doing something with that data. once you know what they're trying to achieve, the representations chosen will make more sense

instead of adding a column to the matrix like I said before, it kinda feels more like this set represents a function f where f(xi) = yi.

in naive set theory you start defining relations as sets of pairs and then you define functions from that. https://en.wikibooks.org/wiki/Set_Theory/Relations#Relations

this is probably not that important, like Jabor said you should just focus on where they're going instead of the particularities in the notation

Doom Mathematic
Sep 2, 2008

DuckConference posted:

Hungarian notation was in the coding standard here when I started and I never really questioned it because it seemed fine, but now I'm kinda questioning if it's worth it. I mean I guess it's a bit redundant since the compiler is checking your types

The idea behind Hungarian notation is that it makes incorrect code look incorrect. And also - irrespective of whether that first part is true or not - that nobody ever commits incorrect-looking code.

It's stupid, is what I'm saying.

Powerful Two-Hander
Mar 10, 2004

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


ThePeavstenator posted:

it's me, the guy who has his IDE automatically generate getters and setters for every member

.net MVC will fail (and won't tell you why either) to bind data if you don't have a getter and setter to indicate it's a field or whatever it is, so you have to pepper {get; set;} all over the place which i don't like but at least means you can refactor easily later.

and that is still not as bad as having 50 lines of properties and their getters spammed everywhere

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Powerful Two-Hander posted:

.net MVC will fail (and won't tell you why either) to bind data if you don't have a getter and setter to indicate it's a field or whatever it is, so you have to pepper {get; set;} all over the place which i don't like but at least means you can refactor easily later.

and that is still not as bad as having 50 lines of properties and their getters spammed everywhere

"convention over configuration" is a pretty good idea for compile time behaviour and a crime against humanity for runtime behaviour

Shaggar
Apr 26, 2006

Powerful Two-Hander posted:

.net MVC will fail (and won't tell you why either) to bind data if you don't have a getter and setter to indicate it's a field or whatever it is, so you have to pepper {get; set;} all over the place which i don't like but at least means you can refactor easily later.

and that is still not as bad as having 50 lines of properties and their getters spammed everywhere

public Butt TheButt { get; }

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Wheany posted:

posting on the sex number page

A/S/L?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

fart simpson posted:

c# has shaggar checkmate

FlapYoJacks
Feb 12, 2009
H3Y GuY5; Ju57 P0571NG 0N 7h3 B357 P4G3.

Arcsech
Aug 5, 2008

Sapozhnik posted:

java 8 has streams. just as good as linq

.collect(Collectors.toList()) at the end of every pipeline is a bit wordy though. on the bright side you can collect to your own collection classes, such as Guava's immutable collections.

oh my god, a thing is java is wordy??? the rest of the language is so concise, how could such a thing happen

Adbot
ADBOT LOVES YOU

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme
hi, am I the terrible programmer? It's convention where I work to prefix class data members with 'm_' and I didn't think it's that weird. Similarly, static variables typically get 's_' prefixes. This is all C and C++ stuff.

  • Locked thread