|
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
|
# ? May 31, 2017 14:42 |
|
|
# ? May 25, 2024 05:27 |
|
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 I once had a C++ "programmer" ask me what structs are for.
|
# ? May 31, 2017 14:45 |
|
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
|
# ? May 31, 2017 15:02 |
|
linq is monads
|
# ? May 31, 2017 15:02 |
|
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
|
# ? May 31, 2017 15:09 |
|
Sapozhnik posted:
|
# ? May 31, 2017 15:12 |
|
posting on the hacker page
|
# ? May 31, 2017 15:22 |
|
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.
|
# ? May 31, 2017 15:23 |
|
java streams are not great cause the function names are crap compared to linq.
|
# ? May 31, 2017 15:24 |
|
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? ya that's hungarian notation. were required to use it in all our vb6 code here because vb6s intellisense suxxxx
|
# ? May 31, 2017 15:26 |
|
Sapozhnik posted:posting on the hacker page
|
# ? May 31, 2017 15:28 |
Sapozhnik posted:posting on the hacker page
|
|
# ? May 31, 2017 15:29 |
|
posting on the sex number page
|
# ? May 31, 2017 15:36 |
|
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
|
# ? May 31, 2017 15:41 |
|
Powerful Two-Hander posted:yeah this was written by former VB6 devs I think so that would explain it. for the record the "m_" prefix usually means "global variable" if that helps u at all
|
# ? May 31, 2017 15:51 |
|
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
|
# ? May 31, 2017 16:04 |
|
postin on hacker page
|
# ? May 31, 2017 16:09 |
|
Powerful Two-Hander posted:in this instance it's indicating a private member that is then exposed through a public getter/setter combo 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.
|
# ? May 31, 2017 16:12 |
|
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
|
# ? May 31, 2017 16:27 |
Sapozhnik posted:posting on the hacker page
|
|
# ? May 31, 2017 16:27 |
|
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
|
# ? May 31, 2017 16:29 |
|
linq is good because it was the first modern instance of linq. java 8 doesnt get linq without c# doing it ten years prior
|
# ? May 31, 2017 16:30 |
|
Powerful Two-Hander posted:in this instance it's indicating a private member that is then exposed through a public getter/setter combo i do this for all class members even if the getter/setter is just a straight passthrough for consistency
|
# ? May 31, 2017 16:32 |
|
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.
|
# ? May 31, 2017 16:33 |
|
Sapozhnik posted:posting on the hax0r page
|
# ? May 31, 2017 16:34 |
|
BiohazrD posted:i do this for all class members even if the getter/setter is just a straight passthrough for consistency 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.
|
# ? May 31, 2017 16:38 |
|
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
|
# ? May 31, 2017 17:10 |
|
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
|
# ? May 31, 2017 17:14 |
|
BiohazrD posted:i do this for all class members even if the getter/setter is just a straight passthrough for consistency must feel really good to write code that your ide immediately tells you to delete
|
# ? May 31, 2017 17:16 |
|
it's me, the guy who has his IDE automatically generate getters and setters for every member
|
# ? May 31, 2017 17:19 |
|
Jabor posted:basically you have a set (indicated by the {} brackets) 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
|
# ? May 31, 2017 17:28 |
|
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.
|
# ? May 31, 2017 17:28 |
|
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
|
# ? May 31, 2017 17:42 |
|
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. "convention over configuration" is a pretty good idea for compile time behaviour and a crime against humanity for runtime behaviour
|
# ? May 31, 2017 17:46 |
|
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. public Butt TheButt { get; }
|
# ? May 31, 2017 18:00 |
|
Wheany posted:posting on the sex number page A/S/L?
|
# ? May 31, 2017 18:08 |
|
fart simpson posted:c# has shaggar checkmate
|
# ? May 31, 2017 18:12 |
|
H3Y GuY5; Ju57 P0571NG 0N 7h3 B357 P4G3.
|
# ? May 31, 2017 18:19 |
|
Sapozhnik posted:java 8 has streams. just as good as linq oh my god, a thing is java is wordy??? the rest of the language is so concise, how could such a thing happen
|
# ? May 31, 2017 18:24 |
|
|
# ? May 25, 2024 05:27 |
|
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.
|
# ? May 31, 2017 18:31 |