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
Notorious b.s.d.
Jan 25, 2003

by Reene

spongeh posted:

javascript is flawed but still extremely popular and widespread, which makes it the perfect target for nerds who can't possibly fathom why their perfect and preferred replacement isn't as widespread

this is especially true as i am a good looking rich javascript dev and girls love me

"rich" javascript developer: can afford his own room w/out bunk beds

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

power botton posted:

seriously just use d3 and underscore and call it a day js isnt bad its just idiots overcomplicating things

d3 owns despite javascript, not because of it

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
pray, mr. eich, if you type the wrong code, will the right program come out?

Nomnom Cookie
Aug 30, 2009



qntm posted:

especially since javascript arrays already have foreach

the worst foreach in the history of ever

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Java 8 Released!

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

qntm posted:

especially since javascript arrays already have foreach

not in IE8 they don't

use underscore.js, target IE8, and use the absolute minimal amount of javascript to do what you need

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

sweet. hopefully oracle will drop official support for java 7 asap so i can convince the luddites we have to upgrade

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
nm

Notorious b.s.d.
Jan 25, 2003

by Reene

HORATIO HORNBLOWER posted:

sweet. hopefully oracle will drop official support for java 7 asap so i can convince the luddites we have to upgrade

5->6 and 6->7 uptake were both waaaaaay faster than 1.4->5, so i am hoping 7->8 will be like fuckin lightning

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

Notorious b.s.d. posted:

5->6 and 6->7 uptake were both waaaaaay faster than 1.4->5, so i am hoping 7->8 will be like fuckin lightning

security updates until april 2015 :sigh:

http://www.oracle.com/technetwork/java/eol-135779.html

Notorious b.s.d.
Jan 25, 2003

by Reene

yeah, so like 90% of customers will be on java 8 a year from now
sounds good to me

MononcQc
May 29, 2007

Gazpacho posted:

pray, mr. eich, if you type the wrong code, will the right program come out?

pray, mr. eich, why is your knife only made out of multiple very dull blades and no proper handle?

Notorious b.s.d.
Jan 25, 2003

by Reene
i can't blame eich personally

he was hired to design js sometime in 1995. the first public release was that december. all of the worst poo poo was already etched in stone with that first release, but who coulda done better with <12 months of work and 1995-grade tech?

instead i blame everyone who continued to use/extend/ship/clone javascript

MononcQc
May 29, 2007

I can get on board with that program

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Notorious b.s.d. posted:

i can't blame eich personally

he was hired to design js sometime in 1995. the first public release was that december. all of the worst poo poo was already etched in stone with that first release, but who coulda done better with <12 months of work and 1995-grade tech?

instead i blame everyone who continued to use/extend/ship/clone javascript

You would like to use Dart instead? How would we even start to kill something like Javascript?

Sapozhnik
Jan 2, 2005

Nap Ghost

:woop: :rock:

the best programming language just got better gently caress yeaaaaaahhhhhhhhhh :rock:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

MononcQc posted:

pray, mr. eich, why is your knife only made out of multiple very dull blades and no proper handle?
i'm still trying to figure out which parts of your earlier posts about map and varargs are serious

what kind of confusion of ideas can produce the belief that every built-in function should be designed around calling it via map, without any currying or other adaptation, and that this should always do what you need regardless of the particular scanario? is that possibly something that somebody has thought?

Nomnom Cookie
Aug 30, 2009



Nomnom Cookie
Aug 30, 2009



Gazpacho posted:

i'm still trying to figure out which parts of your earlier posts about map and varargs are serious

what kind of confusion of ideas can produce the belief that every built-in function should be designed around calling it via map, without any currying or other adaptation, and that this should always do what you need regardless of the particular scanario? is that possibly something that somebody has thought?

map should be designed around not being loving retarded and lovely. basically people are complaining that the JS implementation of map is a JS implementation

Notorious b.s.d.
Jan 25, 2003

by Reene

Gazpacho posted:

i'm still trying to figure out which parts of your earlier posts about map and varargs are serious

what kind of confusion of ideas can produce the belief that every built-in function should be designed around calling it via map, without any currying or other adaptation, and that this should always do what you need regardless of the particular scanario? is that possibly something that somebody has thought?

i dont know, maybe it is just how every sane language from the last forty years has worked

maybe that has created the expectation that consistency is good and inconsistency is bad, or that names for things should match what they do

Notorious b.s.d.
Jan 25, 2003

by Reene

Maluco Marinero posted:

You would like to use Dart instead? How would we even start to kill something like Javascript?

it is a little late now. there were some opportunities in the past.

microsoft tried to kill js back when they had 99% browser market share, but their replacement was vbscript, which was unambiguously worse.

sun made hotjava, where applets were so lightweight you didn't really need anything else. but they didn't want to be in the browser business, and their deal with netscape created the nsapi jvm disaster

Sapozhnik
Jan 2, 2005

Nap Ghost
and a good thing too, imagine if every browser today was required to be a jvm application :stonk:

Marty McFly in 2014-A: "what the gently caress is a smartphone??"

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr Dog posted:

and a good thing too, imagine if every browser today was required to be a jvm application :stonk:

Marty McFly in 2014-A: "what the gently caress is a smartphone??"

this is a joke post, right?

there have been full-featured browsers implemented w/ java on blackberry. phones so limited they make your iphone look like a supercomputer, that could still browse the internet well

not to mention the insane success of dalvik

Notorious b.s.d.
Jan 25, 2003

by Reene
reminder: hotjava ran pretty well on a 110 MHz sparcstation 4

the internet is really really old guys

Bloody
Mar 3, 2013

is there type inference yet

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
if only apple had pushed hypertalk into the browser, then you could all complain that it doesn't understand every english preposition

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Notorious b.s.d. posted:

i dont know, maybe it is just how every sane language from the last forty years has worked
this is a lie and you know it

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
oh wow modena looks really nice, i was about to ask if java 8 had fixed the "godawful looking gui" problem

Luigi Thirty
Apr 30, 2006

Emergency confection port.

yes, the full-featured java browser on the blackberry 8300 i had in high school that took 30 seconds to start and ran out of memory and crashed regularly trying to render somethingawful

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION
http://cache.fxexperience.com/wp-content/uploads/2013/01/Modena-Windows.png

idk if i'd call this "really nice" but its about a million times better than what was there before

Notorious b.s.d.
Jan 25, 2003

by Reene

Luigi Thirty posted:

yes, the full-featured java browser on the blackberry 8300 i had in high school that took 30 seconds to start and ran out of memory and crashed regularly trying to render somethingawful

i was talking about opera.

the native browser was poo poo on a shingle

Notorious b.s.d.
Jan 25, 2003

by Reene

uncurable mlady posted:

oh wow modena looks really nice, i was about to ask if java 8 had fixed the "godawful looking gui" problem

modena is a javafx skin. nobody uses javafx :(

it will not affect the broken dpi settings and ugly skins in your old awt/swing apps

MononcQc
May 29, 2007

Gazpacho posted:

i'm still trying to figure out which parts of your earlier posts about map and varargs are serious

what kind of confusion of ideas can produce the belief that every built-in function should be designed around calling it via map, without any currying or other adaptation, and that this should always do what you need regardless of the particular scanario? is that possibly something that somebody has thought?

Basically JS has a non-obvious varargs implementation that is enabled for all functions and all calls no matter the arity, which is the same mechanism used to provide default values to arguments (via x == undefined comparisons in the implementation).

This mix makes it that it is both impossible to provide a function that has a default value for a second argument and use it in a map, unless this second argument is expected to be an index in an array when being called by map.

This means a function like ParseInt is bound to either: always be wrapped in an anonymous function, or have a MappableParseInt function that does it for you. Which frankly kind of sucks, because it's not obvious, and why not just offer ArrayToInt(array) then anyway?

So pick your poison. Any of these would work:
  • map shouldn't be adding a 2nd argument to all calls that is the index in the array you're passing in to preserve more composability over the entire language and prevent such surprises
  • force fixed arities (map(ParseInt(_), array) or something semantically equivalent) when passing in higher order functions
  • Support a different mechanism for default function arguments and varargs to avoid having to conflate both uses in some cases, and also make it clear that you have to consider both
  • do your functional programming in a language that is actually functional
The first option is likely the one I'd see make more sense here to avoid bad surprises without keeping people from altering the language's syntax or having to care about how to write functions that are mappable all the time.

In general, I'm just mad at JS' vararg design. I mean, many languages have varargs (from PHP to Scheme), and most of them make it obvious they're a language feature, and do it in nicer ways.

PHP has func_num_args() and func_get_args(), Scheme has (define (f . varargs) ...) and will error out if you call a function that doesn't take varargs with more arguments than expected, Python has *args and **kwargs, and so on.

Javascript has the feature more or less hidden, and introduces a variable called arguments that can be overwritten or declared over at any time and represents all arguments, even those already matched in the function head (except if one of them is called 'arguments', in which case it disappears as a feature).

It's just bad.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Notorious b.s.d. posted:

modena is a javafx skin. nobody uses javafx :(

it will not affect the broken dpi settings and ugly skins in your old awt/swing apps

:smith:

there a reason why? i've honestly never really used java that much. the project i'm working on now involves a lot of java though so i've been getting more accustomed to it and it ain't as bad as i had thought

Notorious b.s.d.
Jan 25, 2003

by Reene

uncurable mlady posted:

:smith:

there a reason why? i've honestly never really used java that much. the project i'm working on now involves a lot of java though so i've been getting more accustomed to it and it ain't as bad as i had thought

javafx was originally a sort of flash-replacement library for use in applets and installers and things. It didn't build on top of, and wasn't really compatible with, awt/swing. as a result, i have never even seen a javafx app in the wild

something I did not notice until just now: java 8's javafx will let you embed (and interact with?) swing stuff in a javafx layout. maybe that will create an incentive for its use

abraham linksys
Sep 6, 2010

:darksouls:

MononcQc posted:

vararg sadness

so, in terms of just wanting to not deal w/ the arguments array, es6 at least does this:

code:
function add(...arr) {
  return arr.reduce((acc, n) => acc + n, 0);
}

console.log(add(1,2,3)); // 6
unfortunately, no kwargs-style default arguments yet (es6 i think will have default arguments but they won't be keyword-style), so this isn't really solved:

quote:

Support a different mechanism for default function arguments and varargs to avoid having to conflate both uses in some cases, and also make it clear that you have to consider both

in modern userland js, functions that need "default" arguments usually take a hash as a poor man's kwargs, i.e. parseInt('15', { radix: 10});. there are javascript wunderkinds who like to do "default" arguments like you mentioned, but it always leads to poor code - backbone's source is some of the worst code i've ever seen in a popular library, and part of the reason is functions that open like this

i think the real problem w/ this example is, as you said, that map has an unexpected signature. that said, since javascript doesn't have any way of enforcing argument contracts, i do often end up wrapping map/reduce/forEach callbacks in an anonymous function, and if nothing else es6 will make that a bit more terse

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
like the only languages that approach this crazy "map-readiness" standard are haskell and some of its lazy predecessors that even fewer people use, and even then if you don't happen to be binding the last argument you have to write syntax to fill out the other arguments, it's the most incoherent basis for bashing JS i can imagine

Notorious b.s.d.
Jan 25, 2003

by Reene

Gazpacho posted:

like the only languages that approach this crazy "map-readiness" standard are haskell and some of its lazy predecessors that even fewer people use, and even then if you don't happen to be binding the last argument you have to write syntax to fill out the other arguments, it's the most incoherent basis for bashing JS i can imagine

...or perl, or ruby, or python, or java, or C#, or, you know, pretty much any language in common use other than C.

Bloody
Mar 3, 2013

Luigi Thirty posted:

yes, the full-featured java browser on the blackberry 8300 i had in high school that took 30 seconds to start and ran out of memory and crashed regularly trying to render somethingawful

this differs from chrome in that

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Bloody posted:

this differs from chrome in that

i don't know i use firefox

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