|
qntm posted:
I guess I didn't have the right definitions because I thought the name binding inside the block was more of a scoping thing. let me change the example a bit code:
Symbolic Butt fucked around with this message at 01:29 on Dec 10, 2015 |
# ? Dec 9, 2015 21:12 |
|
|
# ? Jun 12, 2024 02:10 |
|
Elder Postsman posted:hey what do y'all think of Go I hear that someday it will support multiple threads
|
# ? Dec 9, 2015 21:17 |
|
qntm posted:
now consider a c++ class with a shallow copy constructor and an overloaded operator= e: oh wait yeah that'll teach me to read properly i'm dumb ignore me
|
# ? Dec 9, 2015 21:37 |
|
Symbolic Butt posted:today I just said in passing "java is pass by reference I think.... right?" are you familiar with the "single-element array output argument" pattern
|
# ? Dec 10, 2015 00:47 |
|
hackbunny posted:are you familiar with the "single-element array output argument" pattern as someone not particularly familiar with Java, what's the joke/horrors about Java's pass by reference?
|
# ? Dec 10, 2015 01:04 |
|
Maluco Marinero posted:as someone not particularly familiar with Java, what's the joke/horrors about Java's pass by reference? Java is pass by value for all primitives. for objects, Java passes the object reference by value...meaning you can modify the original object through the reference. not much of a horror but leads to a few gotchas.
|
# ? Dec 10, 2015 01:11 |
|
Symbolic Butt posted:I guess I didn't have the right definitions because I thought the name binding inside the block was more of a scoping thing. let me change the example a bit now consider in java code:
|
# ? Dec 10, 2015 01:17 |
|
java is pass by reference, but some objects are immutable/read-only (notably primitive types) java is pass by value, and references are a kind of value (and so you can't have a reference to a reference) but really, there are objects and primitive types. primitive types are copied so they are immutable, objects are passed around by pointer and may or may not be mutable/writable through their methods or (barf) exposed fields. .net formalizes them as value types vs reference types. yes, a lot of built-in .net value types are just type system drag for intrinsic VM types, but at least they are in the type system, unlike java primitives which are pure magic. boxed java primitives don't have to be read-only either, but they are to mirror the immutability of the underlying type. java arrays are pure magic too, hence the Arrays static class. it's not a bad system (I actually personally enjoy clunky verbose code) but I hate the hole it leaves in the type system Maluco Marinero posted:as someone not particularly familiar with Java, what's the joke/horrors about Java's pass by reference? since references are values, and values are immutable, you can't pass a reference by reference. what you can do is pass a reference to a mutable object that holds a reference to the object you want to return ("out" parameters in C#) or replace ("ref"). generics are pretty new to the language and type-erasing, so forget about a generic container object, but java has always had a non-type-erasing generic type, that also happens to contain fully mutable fields: arrays of course Java code:
|
# ? Dec 10, 2015 01:23 |
|
A lot of langs do that though? or is there subtle difference in the phrase 'passes the object reference by value' that I'm missing? e: this was a response to the shorter explanation, I don't think I fully get it yet but that helps hackbunny. Maluco Marinero fucked around with this message at 01:30 on Dec 10, 2015 |
# ? Dec 10, 2015 01:27 |
|
it's absolutely not a coincidence that all java primitives fit in a machine register. yes, it's a VM implementation detail floated up to the language surface. it's not that bad, the migration path for a C++ or even C programmer is pretty straightforward, you'll say references and they'll just nod and think "special integers, like pointers"
|
# ? Dec 10, 2015 01:27 |
|
it's just that java is a surprisingly low-level language, it's the C of the GC world. you can't return multiple values with a tuple not because it's impossible but (I guarantee it) because the syntax would be too convenient, just symbols and formatting and no class names, not explicit enough. java is not agile, everything that exists needs to be named (ok, exaggeration) and to some degree planned in advance. this philosophy is why it took 8 major revisions to have lambdas, and why despite the VM growing a new opcode (!!!) specifically for lambda invocation, lambdas are still so rigid it's a very conservative language and I think it's one of its strengths
|
# ? Dec 10, 2015 01:34 |
|
hackbunny posted:it's absolutely not a coincidence that all java primitives fit in a machine register. yes, it's a VM implementation detail floated up to the language surface. it's not that bad, the migration path for a C++ or even C programmer is pretty straightforward, you'll say references and they'll just nod and think "special integers, like pointers" apart from long, I think, on the 32-bit machines that were overwhelmingly popular when java was created
|
# ? Dec 10, 2015 02:21 |
|
pseudorandom name posted:I hear that someday it will support multiple threads not generics tho
|
# ? Dec 10, 2015 02:23 |
|
also i'm not sure why you describe special cases as "holes" in the java type system. the object/primitive distinciton is not as elegant as if everything was an object, but that doesn't stop primitives and arrays being part of the type system? like there are Class objects that represent their types etc.
|
# ? Dec 10, 2015 02:23 |
|
what's worse: "elegant" or "robust"
|
# ? Dec 10, 2015 02:49 |
|
Soricidus posted:also i'm not sure why you describe special cases as "holes" in the java type system. the object/primitive distinciton is not as elegant as if everything was an object, but that doesn't stop primitives and arrays being part of the type system? like there are Class objects that represent their types etc. that i can't use Map<int, Butts> means some types are more equals than others
|
# ? Dec 10, 2015 03:01 |
|
JawnV6 posted:what's worse: "elegant" or "robust" I looked one of my old resumes that fortunately I never sent out and it had "elegant" on it, I had to slap myself. Wouldn't have had that feeling with "robust."
|
# ? Dec 10, 2015 03:03 |
Brain Candy posted:that i can't use Map<int, Butts> means some types are more equals than others Wait, you can't use ints as a map key in java?
|
|
# ? Dec 10, 2015 03:33 |
|
VikingofRock posted:Wait, you can't use ints as a map key in java? no but you can use Integers
|
# ? Dec 10, 2015 03:35 |
|
and no it will not "autobox" thsi for you
|
# ? Dec 10, 2015 03:36 |
|
|
# ? Dec 10, 2015 04:30 |
|
Have some probably wrong observations about 3D Graphics APIs and Vulkan: http://blog.mecheye.net/2015/12/why-im-excited-for-vulkan/
|
# ? Dec 10, 2015 05:51 |
|
Elder Postsman posted:hey what do y'all think of Go there's some ranting about it earlier in the thread but rather than repeat it i'll link to some posts by go supporters explaining how not having dependency management is actually a good thing, and how checking error values for every call is not annoying because you can subvert it so the compiler can't check that you're handling errors https://blog.gopheracademy.com/advent-2014/case-against-3pl/ https://blog.golang.org/errors-are-values
|
# ? Dec 10, 2015 06:01 |
|
those posts are some hilarious stockholm syndrome
|
# ? Dec 10, 2015 06:15 |
|
suffix posted:there's some ranting about it earlier in the thread but rather than repeat it i'll link to some posts by go supporters explaining how not having dependency management is actually a good thing, and how checking error values for every call is not annoying because you can subvert it so the compiler can't check that you're handling errors lol that error one is great. the number of hoops he has to jump through to get even slightly away from how ugly that code is and jfc every time I read go code I'm taken aback by how ugly it is in general
|
# ? Dec 10, 2015 06:16 |
|
just write a wrapper class! then you could do so many things besides forget to check errors. like it may be ugly but at least the compiler is making sure you check for errors
|
# ? Dec 10, 2015 06:18 |
|
swift did it right though. make possibly-failing calls look different, do exception handling the way everyone already knows how. don't loving just look at c and go "hey, errno was a great idea, let's just make the compiler enforce it"
|
# ? Dec 10, 2015 06:20 |
|
just use c# for everything
|
# ? Dec 10, 2015 06:21 |
|
where all my ALGOL 60 and or PL/I programmers at?!
|
# ? Dec 10, 2015 06:33 |
|
Suspicious Dish posted:Have some probably wrong observations about 3D Graphics APIs and Vulkan: http://blog.mecheye.net/2015/12/why-im-excited-for-vulkan/ that's cool i have a hard time being excited about vulkan as a technology just because it's so low level that you'd never use it directly unless you were making a low level game engine but i suppose you could say something similar about X
|
# ? Dec 10, 2015 06:35 |
|
Elder Postsman posted:hey what do y'all think of Go do you like garbage languages that fail at basically everything they claim to achieve? the type system is next to useless. the lack of support for generics and iterator like operators means anything that requires a complex data structure that is not built in will almost certainly be cast to interface{} and then, at some point, downcast to some other type. hopefully it's original type but who really can tell? channels are a worthless abstraction. they block on send and receive so unless you use some sort of queue they provide only very limited concurrency and they are not preemptible so they are of limited use for parallelism. virtually every modern language has a better solution available as a library there is next to no type safety. almost any operation can return `nil` despite it's type signature. there is no pattern matching, no option/maybe type and no exceptions so every single operation must be checked for errors manually this one is pretty minor compared to the above but it's 2015 and go still has statements. there's zero excuse for statements in modern programming languages. there is absolutely no reason `isEven = if x % 2 { true } else { false }` shouldn't work this one is major. it's 2015 and go has zero support for immutable values. immutable values are the best reason to use erlang, clojure, scala and rust. they are a huge win for productivity and program correctness and go just doesn't have them presumably to simplify compilation i will concede go is alright if you need to ship something of limited ambition or complexity to customers/users. it's nice they can just download a binary without worrying about dependencies the talent deficit fucked around with this message at 06:41 on Dec 10, 2015 |
# ? Dec 10, 2015 06:35 |
|
suffix posted:there's some ranting about it earlier in the thread but rather than repeat it i'll link to some posts by go supporters explaining how not having dependency management is actually a good thing, and how checking error values for every call is not annoying because you can subvert it so the compiler can't check that you're handling errors why doesnt the official go site have syntax highlighting this is awful
|
# ? Dec 10, 2015 06:38 |
|
my stepdads beer posted:why doesnt the official go site have syntax highlighting this is awful rob pike unironically posted:Syntax highlighting is juvenile. When I was a child, I was taught
|
# ? Dec 10, 2015 06:49 |
|
what the gently caress
|
# ? Dec 10, 2015 06:59 |
|
lmao
|
# ? Dec 10, 2015 07:01 |
|
what the gently caress
|
# ? Dec 10, 2015 07:02 |
|
suffix posted:that's cool I was hoping the parts about politics and the stories of the battles between game developers and GPU manufacturers would be intriguing and interesting. I didn't actually write that much about Vulkan in comparison, other than as framing for that, and to help say "well, I'm happy this isn't happening anymore"
|
# ? Dec 10, 2015 07:02 |
|
Edit: Deleting this in honor of Cuisenaire rods.
sarehu fucked around with this message at 07:17 on Dec 10, 2015 |
# ? Dec 10, 2015 07:10 |
|
Ericadia posted:lmao
|
# ? Dec 10, 2015 07:26 |
|
|
# ? Jun 12, 2024 02:10 |
|
Suspicious Dish posted:Have some probably wrong observations about 3D Graphics APIs and Vulkan: http://blog.mecheye.net/2015/12/why-im-excited-for-vulkan/
|
# ? Dec 10, 2015 07:37 |