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.
 
  • Locked thread
redleader
Aug 18, 2005

Engage according to operational parameters

Arcsech posted:

javascript as an ecosystem is a garbage fire of which we have never seen the like. this includes the browsers

christ yes. i can deal with the language, but the absolutely batshit ecosystem has become a parody of itself

Adbot
ADBOT LOVES YOU

go play outside Skyler
Nov 7, 2005


Zaxxon posted:

code:

var x = {}
var y = {}
var z = {}

x[y] = "get money smoke dust"

x[z] === x[y] //returns true

x[z] === x["[object Object]"]


look at me! i'm doing something ridiculously stupid in a dynamically typed programming language and expecting the results to have any meaning at all!

seriously though if you're doing this in JS you deserve any shitstorm that comes your way.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

i prefer languages that don't let you do that at all

go play outside Skyler
Nov 7, 2005


fart simpson posted:

i prefer languages that don't let you do that at all

well then maybe stop complaining about js and start using typescript or c#???

some people like the flexibility js offers.

because honestly poo poo like this is why i stopped using c# alltogether

code:
                    if (targetType == typeof(byte))
                        return value.ToByte();
                    else if (targetType == typeof(sbyte))
                        return value.ToSByte();
                    else if (targetType == typeof(Int16))
                        return value.ToInt16();
                    else if (targetType == typeof(UInt16))
                        return value.ToUInt16();
                    else if (targetType == typeof(Int32))
                        return value.ToInt32();
                    else if (targetType == typeof(UInt32))
                        return value.ToUInt32();
                    else if (targetType == typeof(Int64))
                        return value.ToInt64();
                    else if (targetType == typeof(UInt64))
                        return value.ToUInt64();
                    else if (targetType == typeof(float))
                        return value.ToFloat();
                    else if (targetType == typeof(double))
                        return value.ToDouble();

go play outside Skyler fucked around with this message at 12:57 on Oct 8, 2016

redleader
Aug 18, 2005

Engage according to operational parameters

go play outside Skyler posted:

look at me! i'm doing something ridiculously stupid in a dynamically typed programming language and expecting the results to have any meaning at all!

seriously though if you're doing this in JS you deserve any shitstorm that comes your way.

i don't see why it's unreasonable to expect object identities to matter when using objects as keys

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

redleader posted:

i don't see why it's unreasonable to expect object identities to matter when using objects as keys

js's objects are keyed off strings and always have been. if you try to use an object as a key js just does obj.toString() which comes out as "[object Object]". why is that weird or unexpected behavior?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

redleader posted:

christ yes. i can deal with the language, but the absolutely batshit ecosystem has become a parody of itself

tbf that's mainly because of browser wars

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Strumpy posted:

i work with a bunch of people that regularly come in at 11am or so. it's really great for me because i'm a morning person and generally get in by 8am. that's a lot of not having to listing to coworkers + getting a bunch of stuff done without minor distractions. i'll schedule any meetings after lunch and then spend the rest of the day pair programming, task managing, or helping out my team if they need it. if it wasn't for late starters i don't think i'd get any time to program.

imo 11 is kind of pushing it. there's nothing hard about getting to work at a normal hour and having a productive day except for a bunch of lazy man-children who want to keep rolling out of bed at noon because that's when they used to schedule their classes like so:

Soricidus posted:

lol just lol if you work somewhere that people care what time you come and go. do you also have to fill in a detailed time card and wear a suit and tie? lol at your literal wage slave life

Soricidus
Oct 21, 2010
freedom-hating statist shill

Blinkz0rz posted:

js's objects are keyed off strings and always have been. if you try to use an object as a key js just does obj.toString() which comes out as "[object Object]". why is that weird or unexpected behavior?

it's bad because there is literally no plausible situation in which it is the desired or expected behavior. it should be an error.

if you want to preserve the 'always coerce keys to strings' behavior for some bad reason then it should still be an error to use an object that does not override toString as a key.

redleader
Aug 18, 2005

Engage according to operational parameters

Blinkz0rz posted:

js's objects are keyed off strings and always have been. if you try to use an object as a key js just does obj.toString() which comes out as "[object Object]". why is that weird or unexpected behavior?

terrible programmer confession, but i actually didn't know that js turned everything into strings when using the values as keys

go play outside Skyler
Nov 7, 2005


i'm not saying js is a great language. but if you just read this book



and follow simple practices like including jslint in your release workflow, you will be a-okay

and before you say anything about needing to use a tool to program ... i dare you to write C# code without intellisense

redleader
Aug 18, 2005

Engage according to operational parameters

Blinkz0rz posted:

tbf that's mainly because of browser wars

i unno, i don't think we can blame the bower/gulp/grunt/webpack/etc/whatever situation on ie6

Elias_Maluco
Aug 23, 2007
I need to sleep
When I have to some simple javascript for simple web front-end stuff, Ill do it with in pure functional javascript with jquery and its ok, its easy, its fast, it works

But some time ago I made a medium-sized app for mobile using cordova. I used backbone.js and underscore and lots of other modern libraries and tried to keep it clean and well structured but it did eventually became this big ugly mess of code that its hard to understand and debug, and that I hate everytime I have to touch it again

Javascript is not bad, its easy and flexible. Doing big complex stuff in javascript though, that's not easy without messing it up

go play outside Skyler
Nov 7, 2005


redleader posted:

i unno, i don't think we can blame the bower/gulp/grunt/webpack/etc/whatever situation on ie6

what's wrong with bower/grunt? have you heard of gnu automake? autoconf? how about nuget packages?

to me these tools are just a sign of the js language finally becoming something serious instead of just a bunch of script kiddies copying/pasting a "NO RIGHT CLICK" one-liner

go play outside Skyler fucked around with this message at 13:23 on Oct 8, 2016

Soricidus
Oct 21, 2010
freedom-hating statist shill

Blinkz0rz posted:

imo 11 is kind of pushing it. there's nothing hard about getting to work at a normal hour and having a productive day except for a bunch of lazy man-children who want to keep rolling out of bed at noon because that's when they used to schedule their classes like so:

I get up at 7 like most adults. I go to work at about 11 or 12 because it is dumb and pointless to sit in rush hour traffic instead of travelling at quieter times of day, and also it is good to have some quiet hours at the end of the day when nobody's around to interrupt my concentration, and also it's nice to be out of the office in the mornings so I can go shopping while the shops are open, or receive deliveries, or w/e

nothing to do with being a lazy manchild, everything to do with being in control of my life instead of being controlled by petty tyrants who insist on applying weird and pointless rules like "everybody must sit in rush hour traffic because ... uh ... that's just what adults do ok"

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Soricidus posted:

I get up at 7 like most adults. I go to work at about 11 or 12 because it is dumb and pointless to sit in rush hour traffic instead of travelling at quieter times of day, and also it is good to have some quiet hours at the end of the day when nobody's around to interrupt my concentration, and also it's nice to be out of the office in the mornings so I can go shopping while the shops are open, or receive deliveries, or w/e

nothing to do with being a lazy manchild, everything to do with being in control of my life instead of being controlled by petty tyrants who insist on applying weird and pointless rules like "everybody must sit in rush hour traffic because ... uh ... that's just what adults do ok"

but now your schedule is shifted from your team's by 2 hours which means that while you're waiting for traffic to clear the rest of your coworkers can't meet with you. similarly you can't meet with your teammates after they leave while you're finishing up.

that's fine if you don't meet a lot but it breaks down when you have to schedule planning across an entire day and running a post-mortem is an exercise in futility because you can't get a calendar commitment from all of the stakeholders.

if you work in an office, be in the office when the rest of the people are in the office so that you can work as a team.

Blinkz0rz fucked around with this message at 13:30 on Oct 8, 2016

go play outside Skyler
Nov 7, 2005


Blinkz0rz posted:

if you work in an office, be in the office when the rest of the people are in the office so that you can work as a team.

https://www.youtube.com/watch?v=1nPVAh78n34

redleader
Aug 18, 2005

Engage according to operational parameters

go play outside Skyler posted:

what's wrong with bower/grunt? have you heard of gnu automake? autoconf? how about nuget packages?

to me these tools are just a sign of the js language finally becoming something serious instead of just a bunch of script kiddies copying/pasting a "NO RIGHT CLICK" one-liner

it's not the tools, it's the sheer and absurd amount of tool churn

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

the problem with comic sans was ubiquity

it doesn't matter that it was expertly designed. seeing it used everywhere to communicate the most anodyne and banal messages raises hackles

have you seen helvetica mate

qntm
Jun 17, 2009

redleader posted:

i don't see why it's unreasonable to expect object identities to matter when using objects as keys

JavaScript code:
Object.prototype.toString = function() {
    if(this.__str === undefined) {
        this.__str = uuid();
    }
    return this.__str;
};

go play outside Skyler
Nov 7, 2005


qntm posted:

JavaScript code:
Object.prototype.toString = function() {
    if(this.__str === undefined) {
        this.__str = uuid();
    }
    return this.__str;
};

i think that would open up a whole other can of worms

i don't know of any language who's toString() function would actually outpud a uuid.
i don't think this would work

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Arcsech posted:

javascript as a language isn't really worse than php or ruby or whatever really. its not good, but it's not the worst ever either

javascript as an ecosystem is a garbage fire of which we have never seen the like. this includes the browsers

two things which are inseparable are practically one thing

qntm
Jun 17, 2009

go play outside Skyler posted:

i think that would open up a whole other can of worms

i don't know of any language who's toString() function would actually outpud a uuid.
i don't think this would work

of course it wouldn't "work", it's a disgustingly ugly hack which undermines the fundamental structure of JavaScript at huge cost to performance

however:

JavaScript code:
var x = {};
var y = {};
var z = {};

x[y] = "get money smoke dust";

console.log(x[y] === x[z]); // false
console.log(x[y] === x["[object Object]"]); // false

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

go play outside Skyler posted:

what's wrong with bower/grunt? have you heard of gnu automake? autoconf? how about nuget packages?

to me these tools are just a sign of the js language finally becoming something serious instead of just a bunch of script kiddies copying/pasting a "NO RIGHT CLICK" one-liner

gnu automake and autoconf are giant underdocumented piles of bullshit shell code and perl that 99% of users don't actually understand, they just grep for likely-sounding config strings in the directory (because configuration is spread in a couple different places) and google around until it works.

huh good comparison

Shaggar
Apr 26, 2006

Arcsech posted:

javascript as a language isn't really worse than php or ruby or whatever really. its not good, but it's not the worst ever either

javascript as an ecosystem is a garbage fire of which we have never seen the like. this includes the browsers

yeah javascript isn't any worse than the other 2 worst languages

Sapozhnik
Jan 2, 2005

Nap Ghost
Idk i am doing an embedded linux thing that uses an autotools build and i like it

I even have automated tests templated config file generation and all that fun stuff. and by adhering to conventions my openembedded image builder cross compiles, packages, and installs things in accordance with those conventions without me needing to go out of my way to make that possible

go play outside Skyler
Nov 7, 2005


qntm posted:

of course it wouldn't "work", it's a disgustingly ugly hack which undermines the fundamental structure of JavaScript at huge cost to performance

however:

JavaScript code:
var x = {};
var y = {};
var z = {};

x[y] = "get money smoke dust";

console.log(x[y] === x[z]); // false
console.log(x[y] === x["[object Object]"]); // false

and how exactly would that work when you want to print out all the array keys of something? or serialize it to json?

every language has its perks. i don't think this isn't one. it's just a side effect of something being designed one way and programmers making mistakes they shouldn't be doing in the first place

in the meantime, strictly-typed languages won't allow me to *gasp* store a string and a number in the same array without writing convoluted poo poo code

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

go play outside Skyler posted:

in the meantime, strictly-typed languages won't allow me to *gasp* store a string and a number in the same array without writing convoluted poo poo code

well yeah, this is a really stupid thing that you shouldn't be doing

Mao Zedong Thot
Oct 16, 2008


Soricidus posted:

lol just lol if you work somewhere that people care what time you come and go. do you also have to fill in a detailed time card and wear a suit and tie? lol at your literal wage slave life

go play outside Skyler
Nov 7, 2005


Asymmetrikon posted:

well yeah, this is a really stupid thing that you shouldn't be doing

that's something you believe, not necessarly a fact.

it's just a matter of opinion. apples and oranges.

js programmers like to mix numbers and strings and take the risk that something will go wrong at runtime. others like the compiler to catch these errors early on at the cost of writing more code.

i like js because it allows me to get poo poo done quickly when i know what i'm doing. i admit it's a little harder to maintain on a large scale than say c#, but i think you shouldn't put all your eggs in one basket anyways.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Ruby is the best language because so far it's made me the most money.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

go play outside Skyler posted:

i like js because it allows me to get poo poo done quickly when i know what i'm doing.

i feel bad for the people that have to clean up after you.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
having a time punch and then having to manually fill a separate time sheet at the end of every week loving owns.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
makes me feel like an adult

LordSaturn
Aug 12, 2007

sadly unfunny

once upon a time I was contracted to a contractor to a primary

four timesheets a week

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Doc Hawkins posted:

Ruby is the best language because so far it's made me the most money.

fffffuuuuuuuccccckkkkk yooooouuuuuu

Su-Su-Sudoko
Oct 25, 2007

what stands in the way becomes the way

go play outside Skyler posted:

in the meantime, strictly-typed languages won't allow me to *gasp* store a string and a number in the same array without writing convoluted poo poo code

code:
stringAndIntList :: [Either String Int]

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Blinkz0rz posted:

fffffuuuuuuuccccckkkkk yooooouuuuuu
I once saw a guy fully commit to the argument that the success of facebook and wordpress proved that PHP was the best language, and all criticism was sour grapes over unimportant details. I sometimes think he must have been the inspiration for php_ceo.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


I call it the McDonalds Fallacy, because I am a huge prick.

Adbot
ADBOT LOVES YOU

brap
Aug 23, 2004

Grimey Drawer
yeah, c#'s type system is just inadequate because there are no sum types/discriminated unions/whatever you want to call them.

the iterating over object keys thing is kind of a reflection job, which is slow, but eh people do it all the time for serialization and all sorts of other applications.

  • Locked thread