|
TooMuchAbstraction posted:I've heard there are good technical-difficulty reasons why implementing generics is so hard, but I haven't heard what those reasons are.
|
# ? Jul 1, 2017 12:01 |
|
|
# ? Jun 5, 2024 20:42 |
|
or do type erasure, which is kind of like interface{} but with compiler type checking
|
# ? Jul 1, 2017 12:11 |
|
everyone involved with golang spends too much time talking past everyone else involved with golang golang was designed to be useful to google. millions of cargo cult nerds latched on to it, like they do with everything google does, and then wonder where their features are. at the end of the day, the people who are screaming about golang generics would probably be better off using another language to begin with.
|
# ? Jul 1, 2017 16:28 |
|
uncurable mlady posted:golang was designed to be useful to google. millions of cargo cult nerds latched on to it, like they do with everything google does, and then wonder where their features are. at the end of the day, the people who are screaming about golang generics would probably be better off using another language to begin with. What you're missing here is how many SWEs at Google are screaming for Go to get generics.
|
# ? Jul 1, 2017 16:38 |
uncurable mlady posted:everyone involved with golang spends too much time talking past everyone else involved with golang I am paid to write golang. If I got to use Python or Elixir or something I would, but I am not paid to write those. My boss has his reasons for choosing Go. I don't necessarily agree, but I'm not the boss. . You can say "well then get another job" but that's a bit pat. I like my job, even if golang drives me nuts. Of golang had generics I could like my job and tolerate golang a little better!
|
|
# ? Jul 1, 2017 17:12 |
|
eschaton posted:GCC 4.2.1 and earlier will always need to be accommodated, because of the switch to GPLv3 after that version
|
# ? Jul 1, 2017 23:08 |
|
Some organizations will not touch anything GPLv3, for a variety of reasons. You should be able to derive some of those reasons from the differences between GPLv2 and GPLv3. (I'm not really able to speculate on what reasons apply for mine.)
|
# ? Jul 1, 2017 23:30 |
|
generics are not hard to implement if you're talking about just straight up parametric polymorphism in a functional language. it's almost a natural consequence of hindley-milner style type inference. the hard part is making it interact well with a subtype-heavy object-oriented language. that's why java has bounded type parameters, which can be difficult to understand, and even the java implementers didn't get it right
|
# ? Jul 2, 2017 02:46 |
|
I've been intrigued for a while with the idea of a purely consequential type system. A type is just a collection of methods implemented. If a function takes a parameter x and somewhere calls x.sum, then the inferred type of a is anything that implements sum. Sure you can define a type by name, but it's really just an alias for the interface the individual members must implement. It seems like you'd get all the benefits of compile time type checking, while still being able to write code as if it were a dynamic typed language. I'm sure any actual implementation would be a horror in its own way, but from here it seems like a good idea.
|
# ? Jul 2, 2017 03:57 |
|
Welcome to C++
|
# ? Jul 2, 2017 04:12 |
|
KernelSlanders posted:I've been intrigued for a while with the idea of a purely consequential type system. A type is just a collection of methods implemented. If a function takes a parameter x and somewhere calls x.sum, then the inferred type of a is anything that implements sum. Sure you can define a type by name, but it's really just an alias for the interface the individual members must implement. It seems like you'd get all the benefits of compile time type checking, while still being able to write code as if it were a dynamic typed language. That sounds like row polymorphism, really.
|
# ? Jul 2, 2017 04:15 |
|
KernelSlanders posted:I've been intrigued for a while with the idea of a purely consequential type system. A type is just a collection of methods implemented. If a function takes a parameter x and somewhere calls x.sum, then the inferred type of a is anything that implements sum. Sure you can define a type by name, but it's really just an alias for the interface the individual members must implement. It seems like you'd get all the benefits of compile time type checking, while still being able to write code as if it were a dynamic typed language. Structural typing seems to be what you're describing. It's used by OCaml, Go, and you can also do this with templates in C++, actually.
|
# ? Jul 2, 2017 04:15 |
|
KernelSlanders posted:I've been intrigued for a while with the idea of a purely consequential type system. A type is just a collection of methods implemented. If a function takes a parameter x and somewhere calls x.sum, then the inferred type of a is anything that implements sum. Sure you can define a type by name, but it's really just an alias for the interface the individual members must implement. It seems like you'd get all the benefits of compile time type checking, while still being able to write code as if it were a dynamic typed language. That's how C++ templates work. The requirements of template parameters are essentially determined by the code that uses them. Biggest downsides are that interfaces are fragile, since they're implicit to the implementation, and aren't documented inherently by declarations. Also, error messages tend to suck, since they actual error is inside the template, not the user, although I suppose the kind of analysis you're talking about could help.
|
# ? Jul 2, 2017 04:17 |
|
Absurd Alhazred posted:Structural typing seems to be what you're describing. It's used by OCaml, Go, and you can also do this with templates in C++, actually. Also Typescript. It's becoming a powerful language with features like mapped types
|
# ? Jul 2, 2017 04:41 |
|
TooMuchAbstraction posted:What you're missing here is how many SWEs at Google are screaming for Go to get generics. i never said rob pike's dumbass idea was actually correct
|
# ? Jul 2, 2017 04:51 |
|
Absurd Alhazred posted:Structural typing seems to be what you're describing. It's used by OCaml, Go, and you can also do this with templates in C++, actually. Yeah Scala has this too.
|
# ? Jul 3, 2017 16:31 |
|
So I registered my Dell computer:
|
# ? Jul 5, 2017 09:30 |
|
canis minor posted:So I registered my Dell computer: I'll never understand how this happens, what do you have to do to a web/email app that turns off template rendering, and is subtle enough that you can do it accidently? Whatever the answer I'm sure it boils down to PHP.
|
# ? Jul 5, 2017 11:29 |
|
I'll bet someone flubbed the name of a token file somewhere. Making the rounds in my part of Twitter today:
|
# ? Jul 5, 2017 15:06 |
|
The only horror in that image is the glaring copy-paste error
|
# ? Jul 5, 2017 15:35 |
|
Meat Beat Agent posted:The only horror in that image is the glaring copy-paste error I'm gonna need line numbers for this one, cause I really don't wanna look at that more than I have to.
|
# ? Jul 5, 2017 15:55 |
|
Meat Beat Agent posted:The only horror in that image is the glaring copy-paste error Probably some customer requirement. E: TIL cherries are not considered berries. Nth Doctor fucked around with this message at 16:12 on Jul 5, 2017 |
# ? Jul 5, 2017 16:10 |
|
Pollyanna posted:I'm gonna need line numbers for this one, cause I really don't wanna look at that more than I have to. 31
|
# ? Jul 5, 2017 16:11 |
|
Nth Doctor posted:Cherries and watermelons are both berries, so it's close enough for me. Quick, what's the emoji for legacy code?
|
# ? Jul 5, 2017 16:12 |
boo_radley posted:Quick, what's the emoji for legacy code? 🤔
|
|
# ? Jul 5, 2017 16:13 |
|
boo_radley posted:Quick, what's the emoji for legacy code?
|
# ? Jul 5, 2017 16:18 |
|
boo_radley posted:Quick, what's the emoji for legacy code? 💩🔥
|
# ? Jul 5, 2017 16:26 |
|
boo_radley posted:Quick, what's the emoji for legacy code? � Or "NO-BREAK SPACE"
|
# ? Jul 5, 2017 16:31 |
boo_radley posted:Quick, what's the emoji for legacy code? J <font name=Wingdings>J</font> nielsm fucked around with this message at 18:25 on Jul 5, 2017 |
|
# ? Jul 5, 2017 16:33 |
|
The most fun unicode characters for code identifiers or slack handles are definitely the various space characters.
|
# ? Jul 5, 2017 16:37 |
|
<g>
|
# ? Jul 5, 2017 16:39 |
|
NtotheTC posted:I'll never understand how this happens, what do you have to do to a web/email app that turns off template rendering, and is subtle enough that you can do it accidently? Perhaps similar: it may be something about the way it is configured, but the I18n library we use just spits back out the translation key if it isn't found, rather than the desired translation.
|
# ? Jul 5, 2017 17:01 |
|
The fun thing is reading that code and seeing how stupid it actually is. It checks if FuncThatAlwaysReturnsFalse() == false and prints a poop emoji if so. Then it makes a vector of shared pointers to a bunch of virtual structs which print their corresponding emoji in a loop; and finally it returns.. std::rand()? As the output of main? Sure. Fine. Also let's not forget the monkey emoji enum that's defined and never used. Bad code, would not pass review, 0/10 Jewel fucked around with this message at 17:33 on Jul 5, 2017 |
# ? Jul 5, 2017 17:31 |
|
boo_radley posted:Quick, what's the emoji for legacy code? 🕴
|
# ? Jul 5, 2017 18:18 |
|
boo_radley posted:Quick, what's the emoji for legacy code? U+1F6AE PUT LITTER IN ITS PLACE
|
# ? Jul 5, 2017 18:28 |
boo_radley posted:Quick, what's the emoji for legacy code? U+1F92E FACE WITH OPEN MOUTH VOMITING.
|
|
# ? Jul 6, 2017 17:42 |
|
Zemyla posted:I thought it trended towards "ease of use for lowest common denominator programmers"? It's actually even worse than that -- it's "programmers are uniformly stupid and will blown their own arm off given the chance, so let's make a language even more stupid as the programmers that makes it hard as possible to blow off their arms." For example: If you iterate over the keys in a map, what order do they come in? In most languages, it's either "ordered ascending" (because the map is backed by a red-black tree) or "implementation-defined" which means unknown but consistent (because the map is backed by a hash table). In Go? It's randomized at runtime. The standard implementation of Go's map is a hash table, but it picks a random index at in the bucket list as the start point for iterating over the keys, so that not only is it implementation-defined, it's unpredictable. They did this by design because they figured it'd be impossible for programmers to notice and depend on an implementation-defined key ordering, if there was none. At times, Go feels like Google's last resort because they couldn't convince college grads to program in a nice safe harmless language like LOGO. ullerrm fucked around with this message at 18:36 on Jul 6, 2017 |
# ? Jul 6, 2017 18:34 |
|
ullerrm posted:For example: If you iterate over the keys in a map, what order do they come in? GALLANT: quote:"ordered ascending" (because the map is backed by a red-black tree) GOOFUS: quote:In Go? It's randomized at runtime. The standard implementation of Go's map is a hash table, but it picks a random index at in the bucket list as the start point for iterating over the keys, so that not only is it implementation-defined, it's unpredictable. They did this by design because they figured it'd be impossible for programmers to notice and depend on an implementation-defined key ordering, if there was none.
|
# ? Jul 6, 2017 20:24 |
|
Not sure if this is the right place, but at my new job (A Mix of Uniface and SQL coding for a University) they have no version control enabled beyond segmenting deploy scripts and deployed code by task in a file structure. I am in a team of 4, of about 5 teams. I think I know what my primary task for the next until it's implemented is. They use a shared Uniface development project so Uniface Version control is going to have to be done via exporting as XML and Versioning that for re-import into the development environment for rollbacks etc.
|
# ? Jul 6, 2017 20:36 |
|
|
# ? Jun 5, 2024 20:42 |
|
The map iteration order thing happened with the home-spun CMS at my last job. The original architect came up with the noble goal that components shouldn't communicate with each other and especially shouldn't assume other components on the page had already loaded their data. Fine. His way to enforce this was by putting the components in a hashtable and initializing them in the semi-random iteration order. Of course, if the hash codes are stable (they were constants), the iteration will happen in the same order every time, until somebody added a new component to the page and everything potentially hashed into different buckets. This obviously led to issues where a page would work fine, because everything had initialized in just the right order, then Creative would make a change and the house of cards would collapse. The fancy new solution was to have "early" components that would process first. Fine. This worked until one of them tried to rely on another's processing. (Well, it worked beyond that time for a while, until a new "early" component made everything hash into different buckets.) So now the solution was to have "logic" components, which never displayed anything on the page and only ever loaded and processed data. They did their work before the "early" components. Naturally, those started depending on each other, too! Also, the other components now had to declare which logic components they needed, or the functionality would be missing. (Unless a different component on the same page initialized the logic component, of course!) My solution was to have a static class with a lazy getInstance() function and make the classes as small as I could get them. I've been gone from that job for six months and I wonder how their code is doing! CPColin fucked around with this message at 20:40 on Jul 6, 2017 |
# ? Jul 6, 2017 20:37 |