|
e: nm. yeah java requires explicit conversions for int/float/double/etc...
|
# ? Dec 30, 2014 18:41 |
|
|
# ? Jun 12, 2024 14:36 |
|
or alternatively because foo.setProperty(bar); looks like something that might throw IllegalArgumentException or recalculate stuff behind the scenes or fire an event that listeners might be subscribing to behind the scenes, and foo.property = bar does not.quote:sometimes being clear about what's going on is worth a few extra (automated) keystrokes. though while we're on accessorchat i'd have preferred the convention that java.nio uses: currentValue = foo.property(); foo.property(currentValue); because that way you don't have to do any stupid capitalisation and string concatenation/chopping poo poo to convert between the prop name and the accessor name. perhaps use a @Property attribute to emphasise that this is a getter/setter and not something like "transmit this buffer through this channel" or whatever. but i mean if you want to use that convention in ur code there's nothing stopping you, JavaBeans is a dumb old spec intended for Swing widgets anyway, everyone just latched onto the "have methods called getFoo and setFoo and a default constructor" bit.
|
# ? Dec 30, 2014 18:42 |
|
having first-class language support for types that don't share mutable state and default to non-mutating methods is great, but i don't know why you'd want those types to be like java/c# classes, i.e. subtypeable shared reference types if the type is completely immutable it shouldn't matter whether it's a shared reference or not if it's partly mutable then the sharedness of the reference makes static mutability tracking really complex and awkward. e.g. it introduces a lot of dumb expressivity problems with transitive mutability, like methods that should return mutable references when invoked on a mutable object and non-mutatingness is a pretty major restriction for a superclass method to impose on its overrides, especially as a silent default. it's another axis where an inappropriately annotated superclass can gently caress everything up for subclasses. and it's trivial to work around by keeping a spurious mutable reference to yourself... i just don't think it's worthwhile on reference types. it becomes an obstacle where well-intentioned annotations force endless sperging about the formal data model. keep it on value types where it's much more reasonable to assume non-mutatingness as a default because every value is meant to be independent anyway
|
# ? Dec 31, 2014 07:27 |
|
JewKiller 3000 posted:Portability non-portable I literally thought this was one of those contrast jokes when I was reading it.
|
# ? Dec 31, 2014 08:13 |
|
JewKiller 3000 posted:Portability non-portable pick two
|
# ? Dec 31, 2014 09:55 |
|
i like how ruby does private/protected methods. in ruby 2.5 they are going to change the keywords to private? and protected? which is cool
|
# ? Dec 31, 2014 13:48 |
|
MALE SHOEGAZE posted:i like how ruby bad luck
|
# ? Dec 31, 2014 13:54 |
|
MALE SHOEGAZE posted:i like how ruby does private/protected methods. in ruby 2.5 they are going to change the keywords to private? and protected? which is cool lol
|
# ? Dec 31, 2014 15:44 |
|
fleshweasel posted:waaaaait, can you really not do an implicit widening conversion from int -> float that would be a dangerous conversion. int can represent values which float can't
|
# ? Jan 1, 2015 08:29 |
|
what about int -> double which are the numeric types that people use 99% of the time since double must have at least 32 mantissa bits it ought to be able to represent all the values that int can represent, right?
|
# ? Jan 1, 2015 08:42 |
|
fleshweasel posted:what about int -> double which are the numeric types that people use 99% of the time yes, and that's one of the major reasons javascript uses double as its primary arithmetic type: it means it can use 32-bit signed/unsigned semantics for the bitwise operators and losslessly convert the result/operands to/from double java allows implicit promotion of int to float, i don't know what you guys are talking about. what it doesn't do is allow a promotion (a "widening primitive conversion") before a boxing conversion. i would guess that they were concerned about the possibility of better generic type annotations (turning a List into a List<Float>) changing the semantics of a program: if you could promote before boxing, adding an int to such a collection would compile in either case but add a different type of object I'm not sure java really made the right call here to allow this implicit promotion. given how different floating-point and fixed-point semantics are in many situations, it's better to ask users to be explicit about which they want on both sides, and it's usually not a problem because there's rarely a good reason to be mixing ints and doubles casually, outside of literals (which are already handled specially to allow narrowing conversions when the value fits) rjmccall fucked around with this message at 10:27 on Jan 1, 2015 |
# ? Jan 1, 2015 10:08 |
|
rjm when will swift stop crashing the xcode internals every 10 lines
|
# ? Jan 1, 2015 10:32 |
|
that's by design, gently caress you for not understanding our brilliant vision it's honestly supposed to be much better in the latest xcode, i'm sorry if it isn't. trust me that most of the team is really unhappy about the state of these early releases; i think this entire first year is best thought of as an extended beta, but that is not being communicated well, and users are suffering as a result. it really sucks and i honestly get kindof depressed about it sometimes
|
# ? Jan 1, 2015 10:48 |
|
dfleshweasel posted:what about int -> double which are the numeric types that people use 99% of the time double can losslessly represent ints but not longs
|
# ? Jan 1, 2015 12:09 |
|
Why would you use a float when doubles are available
|
# ? Jan 1, 2015 16:51 |
|
Bloody posted:Why would you use a float when doubles are available 12x faster on consumer gpus
|
# ? Jan 1, 2015 20:10 |
|
I don't think Java is gpu accelerated
|
# ? Jan 1, 2015 20:27 |
|
twice the throughput on a lot of hardware (simd stuff notably), half the memory use sometimes pretty relevant too fairly obvious, so i am not sure if you are trying to make some kind of point
|
# ? Jan 1, 2015 20:40 |
|
I've been wondering lately if mixins are a good idea... idk I feel like most often than not people make some lovely complex systems, dividing responsibility and putting them all over different places, making it hard to keep track of which class has what... so maybe just a huge sequence of ifs on one place would be much clearer idk idk I know I lust for pattern matching though
|
# ? Jan 2, 2015 16:15 |
|
TIL the phrase "Turing tarpit" http://en.wikipedia.org/wiki/Turing_tarpit#Examples quote:TSC, which stands for Text SCript, is a language used inside the Cave Story game engine for controlling non-player characters, events, and animated cutscenes.
|
# ? Jan 4, 2015 18:47 |
|
Symbolic Butt posted:I've been wondering lately if mixins are a good idea... mixins are an awful idea, obviously. Inheritance is a lovely mechanism anyway and mixins are the reductio ad absurdum of that horrible mistake. You obscure control flow and introduce all sorts of spooky action at a distance. Before you know it you're unironically reasoning about the MRO of a two-dimensional inheritance graph of objects in Python so you can work out exactly where it's possible to inject the stuff you need, and then you kill yourself.
|
# ? Jan 4, 2015 19:06 |
|
tbf either you centralize your boilerplate (necessarily) somewhere else or you copy&paste a bunch of poo poo and we all know how well that one turns out hell is implementing 50 tasks that originate from the squishy humans in the system which are mostly-identical but each unique in their own hosed-up way
|
# ? Jan 4, 2015 19:11 |
|
Mr Dog posted:hell is implementing 50 tasks that originate from the squishy humans in the system which are mostly-identical but each unique in their own hosed-up way This is my job at the moment it could be better
|
# ? Jan 4, 2015 19:36 |
|
i like django seems like every few months i read about some significant rails fuckup, half of which come from running on ruby python 3.x and django work very well, produce code that is well-understood by newcomers to a project, and have well-understood performance bottlenecks that a good group can alleviate at my side job we're running everything under python 3.4 and django 1.7.1 (going to update to 1.7.2 tomorrow) and everything is peachY
|
# ? Jan 4, 2015 21:15 |
|
Lysidas posted:i like django is python 3 better than 2 yet
|
# ? Jan 4, 2015 21:18 |
|
Flat Daddy posted:is python 3 better than 2 yet yes*, but good luck convincing people its worth switching * in places
|
# ? Jan 4, 2015 21:23 |
|
rust is cool but jfc everytime i decide to work on it for a weekend project saturday is spent just getting everything to compile with language changes and half of sunday is spent getting things to compile with the language changes that happened overnight saturday and im just talking about dependencies. i havent touched my own code yet and its like 4pm im glad theyre willing to adjust based on experience though instead of just designing ~the perfect language~ on a whiteboard like every other lang
|
# ? Jan 4, 2015 21:29 |
|
yeah I have had that a few times recently with rust they've gone into full break mode because they want to push an alpha out in a few weeks
|
# ? Jan 4, 2015 22:10 |
|
Rust's development model is a good thing on balance "I quickly realised that assigning syntactical significance to ASCII TAB characters in makefiles was a bad idea, but I already had 10 users by that point"
|
# ? Jan 4, 2015 22:29 |
|
they still have 21 bugs open with the tag that i thought indicates 1.0 blockers and i thought 1.0 release candidate was gonna drop in early january https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AP-backcompat-lang
|
# ? Jan 5, 2015 01:03 |
|
Flat Daddy posted:is python 3 better than 2 yet yep, and most of the libraries you want have caught up. worth it for new projects, unsure about migrating old ones
|
# ? Jan 5, 2015 05:26 |
|
Mr Dog posted:Rust's development model is a good thing on balance rust's development model will only prove itself to be good if golang shrivels up and dies i have a feeling that's not how it's gonna pan out. worse is better yada yada yada (just paste your favorite erik naggum rant in here)
|
# ? Jan 5, 2015 05:53 |
|
Notorious b.s.d. posted:rust's development model will only prove itself to be good if golang shrivels up and dies i don't quite get this. golang targeted c++ (and maybe java?) programmers and (predictably) failed at that and instead converted python programmers, its success or failure doesn't seem to have much bearing on rust's ability to convert c++ programmers
|
# ? Jan 5, 2015 06:11 |
|
Blotto Skorzany posted:i don't quite get this. golang targeted c++ (and maybe java?) programmers and (predictably) failed at that and instead converted python programmers, its success or failure doesn't seem to have much bearing on rust's ability to convert c++ programmers golang targeting c++ programmers is hilarious because it's a garbage collected language without generics that's slow as gently caress and has c interop via putting code into comments
|
# ? Jan 5, 2015 06:16 |
|
b0lt posted:and has c interop via putting code into comments lol what
|
# ? Jan 5, 2015 06:25 |
|
Notorious b.s.d. posted:rust's development model will only prove itself to be good if golang shrivels up and dies worse is better: a bitter lisp user cries over the lack of success, and cannot find fault with his approach and so proclaims "worse is better". lisp wasn't wrong, everyone else was wrong. worse is better is a core part of our cultural dissonance: tech is a meritocracy where the best ideas and people can succeed, all the way to the top, but the code they write is awful because worse is better. a shorthand for intellectual snobbery from a mind placid and unchallenged. could it be that go focused on user issues way more than rust did? no. it's because it's popular with the plebs. go got adoption and fame from being attached to google. meanwhile, mozilla hold a non-insignificant sway within the tech community. go has things like go fmt, go fix, go build. there are no goddam makefiles. the package management is a little janky, but the language stabilised early for better or worse. rust on the other hand has gone through major drastic changes, although the mechanisms for enforcing safety are there, the idioms aren't as much—a lot of the language is being discovered. go and rust have mighty different goals. go was "i want to write in C but lazier", rust was "I want to write in ML but with pointers and structs." for the people who don't write in go, or in rust, i guess from the outside they look pretty comparable, like python and ruby do, but the culture behind the language is quite different. rust has been built around browser components, cross platform was a big thing. go on the other hand has come from unix daemons and plan9—little services that copy bytes around. it isn't worse is better. worse is better did talk about cultural differences in approach but kinda stopped short of actually talking about the social factors at play. he then went on to rewrite it a bunch of times which no-one bothered to read, let alone the original essay.
|
# ? Jan 5, 2015 06:27 |
|
if rust doesn't take off it isn't because go exists.
|
# ? Jan 5, 2015 06:29 |
|
b0lt posted:golang targeting c++ programmers is hilarious because it's a garbage collected language without generics that's slow as gently caress and has c interop via putting code into comments it seems to have targeted "people who do not want to write c++" not "people who write c++" (i've seen more migrants from Python and C though)
|
# ? Jan 5, 2015 06:30 |
|
rust isn't there yet so i'm sure as poo poo not going to start a bigass project in rust only to have some rug or other pulled out from under my feet go seems cool i guess but for what it seems intended to do (servers) the best programming language already exists
|
# ? Jan 5, 2015 06:45 |
|
|
# ? Jun 12, 2024 14:36 |
|
Symbolic Butt posted:lol what it's the funniest poo poo ever
|
# ? Jan 5, 2015 06:47 |