Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Shaggar
Apr 26, 2006
e: nm. yeah java requires explicit conversions for int/float/double/etc...

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
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.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
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

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

JewKiller 3000 posted:

Portability non-portable
Stability experimental
Maintainer Roman Leshchinskiy <rl@cse.unsw.edu.au>

I literally thought this was one of those contrast jokes when I was reading it.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



JewKiller 3000 posted:

Portability non-portable
Stability experimental
Maintainer Roman Leshchinskiy <rl@cse.unsw.edu.au>

pick two

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
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

Soricidus
Oct 21, 2010
freedom-hating statist shill

MALE SHOEGAZE posted:

i like how ruby

bad luck

tef
May 30, 2004

-> some l-system crap ->

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

Gul Banana
Nov 28, 2003

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

brap
Aug 23, 2004

Grimey Drawer
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?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

fleshweasel posted:

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?

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

MeruFM
Jul 27, 2010
rjm when will swift stop crashing the xcode internals every 10 lines

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
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

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
d

fleshweasel posted:

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?

double can losslessly represent ints but not longs

Bloody
Mar 3, 2013

Why would you use a float when doubles are available

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Bloody posted:

Why would you use a float when doubles are available

12x faster on consumer gpus

Bloody
Mar 3, 2013

I don't think Java is gpu accelerated

Cybernetic Vermin
Apr 18, 2005

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

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
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

Ator
Oct 1, 2005

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.

TSC is a Turing Tarpit because it contains about 8000 boolean variables total, all of which are global variables, and does not have basic data types such as integers, floats, strings, bytes, and so forth. It is notoriously difficult to use for large programs.

There is only 1 control flow command, which implements an if-goto statement that can only check if a certain boolean value is true. All numbers are base ten numbers, and they can be a maximum of 4 digits long. Numbers cannot be stored inside variables, because only boolean variables exist

seiken
Feb 7, 2005

hah ha ha

Symbolic Butt posted:

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

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.

Sapozhnik
Jan 2, 2005

Nap Ghost
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

distortion park
Apr 25, 2011


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

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
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 :)

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

Lysidas posted:

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 :)

is python 3 better than 2 yet

Soricidus
Oct 21, 2010
freedom-hating statist shill

Flat Daddy posted:

is python 3 better than 2 yet

yes*, but good luck convincing people its worth switching

* in places

Breakfast All Day
Oct 21, 2004

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

cowboy beepboop
Feb 24, 2001

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

Sapozhnik
Jan 2, 2005

Nap Ghost
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"

Vanadium
Jan 8, 2005

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

tef
May 30, 2004

-> some l-system crap ->

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

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr Dog posted:

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"

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)

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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

b0lt
Apr 29, 2005

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

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

b0lt posted:

and has c interop via putting code into comments

lol what

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

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)

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.

tef
May 30, 2004

-> some l-system crap ->
if rust doesn't take off it isn't because go exists.

tef
May 30, 2004

-> some l-system crap ->

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++" :v:

(i've seen more migrants from Python and C though)

Sapozhnik
Jan 2, 2005

Nap Ghost
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

Adbot
ADBOT LOVES YOU

b0lt
Apr 29, 2005

it's the funniest poo poo ever

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply