|
hobbesmaster posted:Has he never heard of Scala or something? He mentions functional programming in the post so he obviously knows the phrase, but doesn't recognize what hes trying to do? Forget Scala, is he aware of Java 8's functional interfaces? I have never written a line of Java and I still know they're tailor-made for his design
|
# ? Aug 17, 2016 16:18 |
|
|
# ? Jun 5, 2024 06:07 |
|
VikingofRock posted:Does Java have auto yet? That made C++11 much less verbose IMO. No, but C# has had it for ages.
|
# ? Aug 17, 2016 16:32 |
|
Java has it in library form (lombok.val).
|
# ? Aug 17, 2016 16:40 |
|
Soricidus posted:Java has it in library form (lombok.val). Does this val get resolved at compile-time, or does it use reflection / late-binding / other runtime tools? The documentation seems minimal.
|
# ? Aug 17, 2016 16:55 |
|
NihilCredo posted:Speaking of Java boilerplate, am I the only one who sees this as a coding horror? I'd be far more impressed if everything was an iterator . http://pastebin.com/raw/TRCkiUvD (but it's really slow...) It's really funny whenever someone comes up with a fancy name for things like a tree of constructors. e: I didn't know that Java doesn't have list comprehension ... do you really have to make an interface for everything? ... Wait, he has one public method, but it's not a constructor? It looks like he's just making a weird expression tree? dougdrums fucked around with this message at 17:22 on Aug 17, 2016 |
# ? Aug 17, 2016 17:03 |
|
Lombok isn't Java.
|
# ? Aug 17, 2016 17:23 |
|
NihilCredo posted:Speaking of Java boilerplate, am I the only one who sees this as a coding horror? This is just verbose currying.
|
# ? Aug 17, 2016 17:39 |
|
Typical Java programmer dogma, a set of rules to follow rigidly and an implication that following them no matter what is more important than using your brain.quote:This technique does create an explosion of classes and you have to come up with names for all of them. It’s not always easy but whenever I struggle with this I feel like there is a concept that needs to be named, I just can’t think of the name for it. It’s rarely a situation where I feel like the concept doesn’t exist.
|
# ? Aug 17, 2016 17:49 |
|
Plato's cave allegory applies pretty much directly to the Java world when you think about it
|
# ? Aug 17, 2016 17:51 |
|
LOOK I AM A TURTLE posted:Haskell gets this right. If you want to compare objects using the == operator you have to derive the Eq typeclass, and for types with members that themselves don't implement Eq (e.g. functions) it's usually impossible to define Eq in a consistent way
|
# ? Aug 17, 2016 18:12 |
|
How would you define it? What metric would you use, outside of testing every possible value?code:
code:
Sinestro fucked around with this message at 18:21 on Aug 17, 2016 |
# ? Aug 17, 2016 18:14 |
|
Some pairs of functions can be proven equivalent, but there's no general way.
|
# ? Aug 17, 2016 18:21 |
|
Bongo Bill posted:Some pairs of functions can be proven equivalent, but there's no general way. In a language without side effects, you could do it by testing every single value of the input types, if it's even a type with a limited number of residents, but that'd quickly get impractical.
|
# ? Aug 17, 2016 18:23 |
|
Sinestro posted:How would you define it? What metric would you use, outside of testing every possible value?
|
# ? Aug 17, 2016 18:37 |
|
Type systems can only enforce what they can prove.
|
# ? Aug 17, 2016 18:46 |
JawnV6 posted:Why would function equality be impossible to define? Aren't they first class? You can define function equality, but it's impractical to do so in general. Here's some code that will work for any functions with enumerable, bounded inputs and equality-testable outputs, and I've provided an examples using functions of type (Bool -> Int) and (Int16 -> Int16): code:
VikingofRock fucked around with this message at 19:42 on Aug 17, 2016 |
|
# ? Aug 17, 2016 19:27 |
|
Hammerite posted:That's bonkers, but how did this issue get noticed in the first place? Do your testers go around typing stuff into the address bar without actually going to the page, just in case it has an effect? That's some comprehensive testing. I don't understand how it got picked up in the first place, unless there are other circumstances in which Chrome does this prefetching.
|
# ? Aug 17, 2016 23:05 |
|
Volte posted:Java's no inherently worse than any other language, but it does seem to be the lingua franca of "coders" who see programming less as a creative expression of sound engineering principles, and more as glorified paperwork---the software counterpart to pencil-pushing-bureaucrat-types whose definition of "good idea" is "follows the established procedure". It's hard to find beauty in a joyless world. Scala must be what Java programmers see when they dream at night... Oh yes. This, exactly.
|
# ? Aug 18, 2016 05:24 |
|
NihilCredo posted:Speaking of Java boilerplate, am I the only one who sees this as a coding horror? quote:“Extreme SRP” has all the advantages of SRP: LOL, yeah, when I think readability, I think having to read 20000 different files to get at what the hell a piece of code trying to do. I'd love to see some of those debugging stack traces, too.
|
# ? Aug 18, 2016 05:38 |
|
I just want to see what he names currying and how he'll gently caress it up.
|
# ? Aug 18, 2016 05:51 |
|
the single responsibility principle is an opportunity for extreme bikeshedding
|
# ? Aug 18, 2016 06:56 |
|
We can't just not paint the bike shed.
|
# ? Aug 18, 2016 07:57 |
|
Sinestro posted:How would you define it? What metric would you use, outside of testing every possible value? What about structural equality? Equality doesn't have to mean equivalence. It's not inconceivable to define a language where the bodies of functions (along with their lexical environment) must be kept around in order to permit structural equality. Hardly useful, though. And of course, plenty of languages just define function equality as equality of identity and compile it to a pointer comparison.
|
# ? Aug 18, 2016 09:51 |
|
NihilCredo posted:Does this val get resolved at compile-time, or does it use reflection / late-binding / other runtime tools? The documentation seems minimal. Lombok is all compile-time.
|
# ? Aug 18, 2016 10:24 |
|
Bongo Bill posted:We can't just not paint the bike shed. What if we seal it?
|
# ? Aug 18, 2016 11:55 |
|
Athas posted:What about structural equality? Equality doesn't have to mean equivalence. It's not inconceivable to define a language where the bodies of functions (along with their lexical environment) must be kept around in order to permit structural equality. Hardly useful, though. Then what's the point? Only being able to know if two functions are literally the same exact function by reference is dumb, and forces the compiler to not inline functions or have multiple copies in your program.
|
# ? Aug 18, 2016 16:00 |
|
Today CSS guy removed name attribute from a form because he didn't know what that attribute does. I... I just don't know how to respond to that. I guess, sure - if you've got options such as asking, or googling, or using common sense of not touching something you don't understand, you can always remove stuff...
|
# ? Aug 18, 2016 16:05 |
|
FamDav posted:Then what's the point? Only being able to know if two functions are literally the same exact function by reference is dumb, and forces the compiler to not inline functions or have multiple copies in your program. In what scenario would you (1) have multiple identical or equivalent functions in your code, and (2) be unable to delete the unnecessary copies?
|
# ? Aug 18, 2016 16:32 |
|
FamDav posted:Then what's the point? Only being able to know if two functions are literally the same exact function by reference is dumb, and forces the compiler to not inline functions or have multiple copies in your program. Avoiding having multiple copies of a function is generally good either way: it improves instruction cache performance. Even if you end up with multiple copies (I believe it can happen with DLLs), it's still possible to ensure that when the address is taken, it's to one canonical copy. And inlining has nothing to do with a language's function comparison semantics. Inlining is a primary feature of C++, and it only supports testing function equality by address comparison.
|
# ? Aug 18, 2016 16:39 |
|
Yes, but making an absolute guarantee of never having multiple copies of a function hurts performance, too. It's work that has to be done at load time for every single inline function, which hugely bloats symbol tables and makes program launch take forever. As far as I know, MSVC does not make any effort to ensure that the address of an inline function compares equal across DLL boundaries. I don't think PE supports that at all. ELF and Mach-O do, and the default behavior in GCC and Clang tries to preserve address-equality — but it's terrible for performance, which is why there are options like -fvisibility-inlines-hidden and -fvisibility=hidden. Also, inlining is not a primary feature of C++. "inline" doesn't say anything about whether a function will actually be inlined; it just changes the linkage rules of the declaration.
|
# ? Aug 18, 2016 16:55 |
|
NihilCredo posted:In what scenario would you (1) have multiple identical or equivalent functions in your code, and (2) be unable to delete the unnecessary copies? have you never written a single lambda in haskell? it is entirely possible to have multiple instances of the same function declared across multiple modules. eth0.n posted:Avoiding having multiple copies of a function is generally good either way: it improves instruction cache performance. Even if you end up with multiple copies (I believe it can happen with DLLs), it's still possible to ensure that when the address is taken, it's to one canonical copy. By inlining, I meant an inline declaration of an anonymous function in haskell and whether there will be a single canonical version of it across your entire program. Poor choice of words. a more general haskell-specific response is that allowing pointer equality would break referential transparency. EDIT: Also, suppose you have two functions which have separate declarations and bodies. The compiler decides after optimization that they are in fact logically equivalent and produces a single declaration that is used at either's call site. Do these compare equal, do they not? What about when a new compiler version decides it is faster for them to be declared independently? FamDav fucked around with this message at 17:06 on Aug 18, 2016 |
# ? Aug 18, 2016 17:02 |
|
FamDav posted:By inlining, I meant an inline declaration of an anonymous function in haskell and whether there will be a single canonical version of it across your entire program. Poor choice of words. C++ has those too, lambdas. Although only non-capturing lambdas can be equality compared (by decaying them into function pointers). rjmccall posted:As far as I know, MSVC does not make any effort to ensure that the address of an inline function compares equal across DLL boundaries. It does if you dllexport/dllimport it properly, like any other function. rjmccall posted:Also, inlining is not a primary feature of C++. "inline" doesn't say anything about whether a function will actually be inlined; it just changes the linkage rules of the declaration. Yes, I know what the "inline" keyword means. What I meant was inlining is central to the design and usage conventions of C++, so clearly a language with reference-equality functions can have inline functions (which, turns out, isn't what the OP meant to say, anyway). The main benefit of C++ is it allows highly abstracted concepts to translate into well-optimized assembly. If inlining weren't supported, the cost of abstraction would go way up, and performant C++ would have to look a lot different (and less readable/maintainable) than now. eth0.n fucked around with this message at 17:41 on Aug 18, 2016 |
# ? Aug 18, 2016 17:37 |
|
eth0.n posted:It does if you dllexport/dllimport it properly, like any other function. Ah, I see how they do it. Okay, yes, if you can identify a unique DLL that owns the inline function and you're willing to do an arcane dance with macros to make it happen, you can get pointers to inline functions to match across DLLs. My point stands that this is still basically a useless promise that does nothing but cost performance if you actually honor it. For example, I believe MSVC de-duplicates template instantiations, despite that being clearly illegal under the spec.
|
# ? Aug 18, 2016 18:58 |
|
toiletbrush posted:I don't know who the horror is here, but...
|
# ? Aug 19, 2016 00:17 |
|
Ralith posted:Isn't this sort of thing why you're never supposed to perform side effects as a result of a GET request? Yes
|
# ? Aug 19, 2016 00:26 |
|
canis minor posted:Today CSS guy removed name attribute from a form because he didn't know what that attribute does. I... I just don't know how to respond to that. Recently a guy at work accidentally (nobody has any idea how) deleted 1/2 of our code base in one commit with a message like "lol idk why this is happening this is weird" and then rolled it back with the next commit. Maybe... don't commit that poo poo in the first place?
|
# ? Aug 19, 2016 00:39 |
|
Volte posted:Typical Java programmer dogma, a set of rules to follow rigidly and an implication that following them no matter what is more important than using your brain. StockholmSyndromeFactoryFactory
|
# ? Aug 19, 2016 03:17 |
|
rarbatrol posted:Recently a guy at work accidentally (nobody has any idea how) deleted 1/2 of our code base in one commit with a message like "lol idk why this is happening this is weird" and then rolled it back with the next commit. hosed up his worktree and didn't know how to fix it?
|
# ? Aug 19, 2016 05:54 |
|
When you are too much in love with Java 8 (seen at work):code:
code:
|
# ? Aug 19, 2016 12:44 |
|
|
# ? Jun 5, 2024 06:07 |
|
http://help.adobe.com/en_US/livecycle/11.0/DesignerScriptingRef/search.html?gsa=1&q=app Oh Adobe
|
# ? Aug 19, 2016 13:08 |