« first day    last day (26 days later) » 

12:00 AM
@BenjaminGruenbaum that's an example of how typed systems might stand in your way
because the main bag is, essentially, type-erased pretty much completely
however, one important difference is that you can't do any operation on the bag except putting stuff in and removing it
 
Ooh, I got one! How come 10 is 10 is true and 9+1 is 10 is true, and 1000 is 1000 is true but 999+1 is 1000 is false?
Silly language lol!
 
@BenjaminGruenbaum what?
 
also, that thing where finally blocks can change the return value... what's up with that?
And that sort function returning nothing explicitly, lol! What were they thinking?
Oh wait, those are all Python nvm.
:D
 
@BenjaminGruenbaum isn't python dynamically typed?
 
@BartekBanachewicz it is.
 
12:03 AM
well...
 
@BartekBanachewicz You know, if a method has a default parameter in Python and you change it in one call, it'd stay changed in the next? Pretty funny huh? So if you have an empty list as a default parameter and you change it in the method, it'll actually stay changed the next time you call the method instead of giving you a new default.
 
@BenjaminGruenbaum anyway, I don't think this is the room you're looking for if you want to bash python :)
@BenjaminGruenbaum I'm not a particularly huge fan of python.
 
@BartekBanachewicz I'm not bashing Python - I'm making a point of how easy it is to point out stupid things in languages you never run into anyway.
 
but it has nice module support and libraries.
@BenjaminGruenbaum you're missing the point of the room then
also "never" is very subjective
as are your all remarks about static typing slowing you down
and how easy it is to catch errors with dynamic typing
 
@BartekBanachewicz it was mainly to @copy because of that !!> function() {} + new Date + [] + {} + 3 + "banana" + NaN thing :P
 
12:07 AM
@BenjaminGruenbaum that illustrates the fact that + operator is broken
essentially weak typing.
 
@BartekBanachewicz no it really doesn't, it illustrates that you can abuse it.
 
+ should be used only for mathematical addition
 
Betteridge's law of headlines is an adage that states: "Any headline which ends in a question mark can be answered by the word no." It is named after Ian Betteridge, a British technology journalist, although the general concept is much older. The observation has also been called "Davis' law" or just the "journalistic principle". Betteridge explained the concept in a February 2009 article, regarding a TechCrunch article with the headline "Did Last.fm Just Hand Over User Listening Data To the RIAA?": This story is a great demonstration of my maxim that any headline which ends in a question...
 
@BenjaminGruenbaum it shouldn't allow you to
 
12:09 AM
@BartekBanachewicz Why not?
 
@BenjaminGruenbaum no, it's a perfectly spot on problem.
@SomeKittensUx2666 because + is addition.
not string concatenation
not string cast
it's a well-defined mathematical operator
 
Not according to the spec.
 
@BartekBanachewicz go ahead, define it mathematically :D
 
@SomeKittensUx2666 what we're on about here is that the spec is basically wrong
 
!!> +'12'
 
12:09 AM
@SomeKittensUx2666 12
 
How do we add two numbers. Please do tell me.
 
you shouldn't exploit the fact you're better at math than me :/
 
I have a number x, that is a real number, let's say the square root of two and the number pi, how do I add them.
 
@BartekBanachewicz How can it be wrong if there's no 'right' to compare it against (aside from your opinion, my liege)
 
@BenjaminGruenbaum in symbolic computations it's x + sqrt(2) + pi
 
12:11 AM
@BartekBanachewicz pi is wrong.
 
but we assume we're not doing symbolic arithmetic
 
@BartekBanachewicz lol, misread my own post. Let's say I just have sqrt(2) and Pi how do I add them?
 
@SomeKittensUx2666 why?
 
@BartekBanachewicz Should be Tau.
 
What even is the square root of two?
 
12:12 AM
@SomeKittensUx2666 lol meh
@BenjaminGruenbaum actually I'll go a bit against my own words now and back off a bit
 
It's the smallest number x such that x*x is less than or equal to two. Are we even sure there exists such number uniquely :D
 
@BartekBanachewicz So you agree that generally-agreed-upon standards trump theoretical 'better answers' that are never used in practice?
 
You can prove it, it's Calculus 1 iirc.
 
@SomeKittensUx2666 there are equations that are longer with tau
 
@BartekBanachewicz Do you agree?
 
The addition of two numbers is defined as the limit of a sequence that is the sum of two sequences that represent those numbers. We have limit arithmetic and shit.
 
@SomeKittensUx2666 tau's not a better answer.
 
@Bartek I have no idea where to ask... :(
 
Which no language does because well.. computers don't have infinite memory.
 
@TimTimmy in javascript room
 
12:14 AM
So "a"+"a" = "aa" is just as mathematical as 0.1 + 0.2 = 0.30000000000004 :D
 
@BartekBanachewicz Why? Because pi is more common?
 
@BenjaminGruenbaum yep. so essentially we have to limit ourselves to some arithmetic we can represent
 
@Bartek I've already done that :(
 
@SomeKittensUx2666 no, because it's not inherently better. (IMHO)
@TimTimmy this is not a webgl room
 
@BartekBanachewicz ok, let me define a function + and some rules.
 
12:15 AM
@BenjaminGruenbaum But it can introduce bugs, can't it?
 
@BenjaminGruenbaum just remember we're making a programming language
 
Sorry
 
danymic-typing? :P
 
Ok... I'll remember that... Bye!
 
@RUJordan that's a joke on the fact that you can mispell object fields.
 
12:16 AM
Ah,lol
 
@copy in all honesty sometimes, rarely (let's say once a month) it might - but those are solved in under 10 second.
@BartekBanachewicz fine, no math then :(
 
@BenjaminGruenbaum not necessarily
 
string + string = "string that's both the strings like this"
string + number = "string NumberHereStringified"
number + number = NumbersAdded
 
@BartekBanachewicz That's a 'tau'tology.
 
@BenjaminGruenbaum Say, you have a large application with 50 developers. One of them adds new functionality, which expects some input to be a number, but it's actually a numeric string. He does some arithmatic, and the result becomes NaN. Isn't that a bad idea compared to a runtime error?
It could even become a valid number, but different than expected
 
12:18 AM
@copy why the heck would anyone ever export a numeric string?
Or pass a numeric string as input?
 
The latter
It doesn't make sense, but it could happen
 
Just like someone doing 999+1 is 1000 , it doesn't make sense.
 
@BenjaminGruenbaum why isn't #2 Number+StringLength?
 
I can see how that'd happen to a novice developer working with the DOM api.
@BartekBanachewicz because that's how I defined it, why? Because it's useful, and because people are used to it from other languages like C# and Java.
 
@BenjaminGruenbaum But the one developer doesn't know how the other developer uses his API
 
12:20 AM
@BenjaminGruenbaum or if someone doesn't jsdoc
 
@BartekBanachewicz Still waiting for a concrete answer.
 
@BenjaminGruenbaum And are not used to it from other languages. It's hypothetical usefullness is moot because of the danger it introduces
 
@copy you mean developers are using an undocumented API without communicating?
@BartekBanachewicz lol, did you seriously just say danger makes usefulness moot?
 
@SomeKittensUx2666 I seriously don't fucking care (sorry). Use whatever feels natural.
 
@BenjaminGruenbaum Yes
 
12:22 AM
@BenjaminGruenbaum not in all cases.
@BenjaminGruenbaum you were the one who said that you only use jsdoc on outside-facing code
there are no other type annotations
you effectively have to guess what the method returns
heck, it might return completely different types if it likes
 
@copy I don't work with those kind of people. Those are the kind of people who need private and protected in Java and don't bother asking, reading or writing unit tests or writing an API :)
 
@BenjaminGruenbaum you're wrong.
you're making totally unbased assumptions and use them pretty much as ad hominems.
 
@BenjaminGruenbaum But wouldn't it make more sense to fail early?
 
@BartekBanachewicz really? getNumberOfClients() what does this method return?
 
@BartekBanachewicz Well, we need to establish if something that's more theoretically correct should replace a less-accurate (but still useful) generally accepted thing.
 
Note that unlike your example from Java, this isn't explicit
 
@BartekBanachewicz so, expecting people to write good documented APIs and communicate is suddenly ad-hominem?
 
@BartekBanachewicz Uh, that's not a fallacy, it's a test case.
 
user406009
@BenjaminGruenbaum So, what would getClients() return?
 
@SomeKittensUx2666 he used singular method name which is not necessarily how all methods look
 
12:25 AM
@copy if there is nothing to do with the data failing early makes sense. Coercion to number might also be acceptable imo.
@Lalaland a list of Client objects or such, depending on the tests and documentation.
 
@BenjaminGruenbaum no, assuming that people who think that access specifiers are useful must be terrible at writing tests etc.
@BenjaminGruenbaum yeah, you don't know
you need to look elsewhere
also, the documentation has to be manually synchronized
 
@BartekBanachewicz no, re-read what I wrote, I said need.
 
@BartekBanachewicz Yes, it's not universal, it's an example.
 
@BenjaminGruenbaum nobody needs anything. People can write code in assembly.
@SomeKittensUx2666 that example doesn't illustrate anything useful. What @Lalaland said illustrates the problem way better
 
@BenjaminGruenbaum Both coercion from number and to number?
So that 3 + "3" - 1 is 32
 
12:27 AM
3 mins ago, by SomeKittens Ux2666
@BartekBanachewicz Well, we need to establish if something that's more theoretically correct should replace a less-accurate (but still useful) generally accepted thing.
 
@copy no, the return value must be at least as strict and the arguments at least as permissive. (method argument contravariance, return type covariance)
 
@SomeKittensUx2666 for one last time; tau is not more theoretically correct.
 
@BartekBanachewicz Do you have a source for that other than your opinion?
 
I'm so glad this room is getting use, and I do look forward to reading the transcript :)
 
@SomeKittensUx2666 is number 2 theoretically correct?
 
12:29 AM
@BenjaminGruenbaum So 3 + "3" - 1 is 5?
 
@BartekBanachewicz In measuring what?
 
@BenjaminGruenbaum what you're saying is that we should write documentation for every method that has ambiguous return type. Why is specifying its return type worse?
@SomeKittensUx2666 who cares, it's a fucking number. Just like pi and tau.
 
@copy why would you do 3 + "3" -1 ?
 
@BenjaminGruenbaum that's just an example, god damn it. Why would you write bugged code in the first place?
 
@BartekBanachewicz most methods really don't have an ambiguous return type :D
@BartekBanachewicz you don't say... -_-
 
12:30 AM
@BenjaminGruenbaum I'm just asking if you theoretical favourite language would behave like that
 
@BartekBanachewicz Just like JavaScript and Haskell?
 
@copy my theoretical favorite language! Ah, now that's a more interesting question.
 
They're just programming languages, and vagaries of the different implementations are moot in the grand scheme of things?
 
@SomeKittensUx2666 no, they're not
@BenjaminGruenbaum the fact is that bugs happen.
 
@BartekBanachewicz So you're saying JavaScript and Haskell are not programming languages?
 
12:31 AM
@SomeKittensUx2666 I'm saying that your analogy isn't applicable.
 
@copy my theoretical favorite programming language would let me coerce when it's useful but still not compile on that statement.
 
@BenjaminGruenbaum wait what
 
@BartekBanachewicz right, just not those bugs. I have plenty of bugs in my JS, but they're really not caused by the type system.
 
you keep doing that
stop doing that.
 
Please, I've never seen that new original site before. Please link me more to that that makes your argument a lot smarter -_-
 
user406009
12:32 AM
I think the var hoisting causes far more bugs than the type coercion.
 
@BartekBanachewicz Of course it is.
 
@BenjaminGruenbaum That's a decent answer, but you're just getting around "JavaScript does this better than Python" or "Python does this better than JavaScript"
 
@BenjaminGruenbaum yourself repeating the fallacy over and over doesn't make your arguments better either
 
Your logical fallacy is believing that claiming X is a fallacy actually works.
 
@SomeKittensUx2666 that's called the fallacy fallacy.
 
12:33 AM
This room is pure gold.
 
@copy what would your theoretical favorite programming language do for "5" * 5 ?
 
inb4 type error
 
@phenomnomnominal You're very welcome
 
@BartekBanachewicz Python does string repetition, which can be very useful.
 
@Lalaland does that mean type coercion is good? no. It still causes bugs.
 
12:34 AM
@BenjaminGruenbaum Hah, yes, that can be a source of bugs
 
@BenjaminGruenbaum it's ambiguous
just fucking write repeat (5, "5")
 
@BartekBanachewicz it's really not, what I was saying there (and somehow everyone else in this room including copy got) is the fact that in my head a really smart language would be smart enough to shout at something like 3+"3" -1 and still allow me something like "Hello "+name. Although Python does a good job with templating.
 
It makes sense to have "5" * 5 because Python is a scripting language that is used for very small and quick scripts
 
saving a few characters for that is not worth it
 
The problem with + in JS is that it has two different behaviors, but again - really, there are much bigger issues in JS you do not address...
The BIG problems with JS are not SyntaxError or TypeError, those are stupid. They're almost never where bugs are at in big software.
 
12:36 AM
let's look at that again
 
@BartekBanachewicz Now, does that repeat the numeral 5?
 
what does + have that ++ doesn't
except being one character shorter obviously
 
try{
    setTimeout(function(){ throw "LOL";},100);
}catch(e){
   alert("Haha I'm never called @BartekBanachewicz ");
}
 
@BenjaminGruenbaum Agreed, but I haven't even started
 
This is a real problem "Lol" is thrown, with no stack trace, you have no idea who threw it or why and you don't have any way to catch it except for a global handler.
 
12:38 AM
@BenjaminGruenbaum it's funny because your answer to the room topic has to be "yes"
@SomeKittensUx2666 look at the type signature. repeat :: a -> Int -> [a]. Now it's obvious.
 
@BartekBanachewicz I've already proved that your answer is 'It really doesn't matter'
 
Any code from external libraries might do this at any point. There is no way to handle exceptions well in the core language.
 
@SomeKittensUx2666 then what are you still doing here?
 
You have to wrap them with promises. That sucks.
 
@BartekBanachewicz Taunting you.
 
12:38 AM
@SomeKittensUx2666 Taunt succeeded. Get out.
 
So stack traces in asynchronous scenarios are one problem - other languages have that problem too but it's one of the bigger issues with JS.
 
$.get('out');
Object {readyState: 1, setRequestHeader: function, getAllResponseHeaders: function, getResponseHeader: function, overrideMimeType: function…}
XHR finished loading: "http://chat.stackoverflow.com/rooms/45756/is-javascript-bad".
 
@copy go ahead then.
 
okey everything clear now
proceed
3 mins ago, by Bartek Banachewicz
what does + have that ++ doesn't
 
@BenjaminGruenbaum Okay, I always mention this and it's not directly related to the language: The standard library
 
12:41 AM
^^ good argument
 
@BartekBanachewicz seriously, you're going to keep arguing against + ?
 
Also the language's docs.
 
@BenjaminGruenbaum of course. I propose another solution. It's better in every aspect.
 
We have talked about productivity, which makes this a topic
 
@copy oh yeah, the standard library is a real problem.
 
user406009
12:42 AM
@SomeKittensUx2666 Mozilla tends to have good docs.
 
No argument there, this is very frustrating. It's a lot less of an issue in the past 2 years and it's a lot less of an issue in Node than in the browser but still.
 
@BartekBanachewicz Oh man, you got me! I've helped a lot of people with a certain language!
@Lalaland They do. I find the examples lacking a bit, but overall good.
 
@SomeKittensUx2666 that's not "certain language". That's PHP.
 
npm really helped, but the fact there is no peer review process on packages is very problematic - there are some really good ones but there is no way to know which is which.
@BartekBanachewicz have you ever done any PHP? I think you might like it, it has . for string concat instead of +.
 
@BenjaminGruenbaum of course
 
12:43 AM
@BenjaminGruenbaum still a chance to register npm-hot-or-not.com
 
@BenjaminGruenbaum yeah, that's one of the brightest spots
you were saying?
 
@BartekBanachewicz now I'm amused, what don't you like about php :D?
 
Heck, it even has monads: github.com/ircmaxell/monad-php
You must be a huge fan.
 
well this is an interesting room
 
So we agree on that. Now, I don't see how people can say that they are productive in JavaScript with that
 
12:45 AM
@copy there are lots of good libraries, they're just not 'standardized'
 
@BenjaminGruenbaum inconsistencies in standard library, naming, still dynamically typed, sort
also everything the amazing blog post about it has
 
@BartekBanachewicz So your way of dealing with arguments you can't handle is to bin them?
 
@SomeKittensUx2666 that's my way of dealing with trash; to bin it indeed. Want to discuss, stop trolling and being annoying and use real arguments. Otherwise just get the fuck out of here.
 
@BartekBanachewicz php has a sort function that acts like you'd expect. It has a huge standard library, it has static typing for complex types (the ones you define yourself) and naming is a syntactic argument so I'll not even dignify it. Next please.
@BartekBanachewicz lol, I find that statement really amusing ^^
 
!!> [1,2,3] + [4,5,6] + [] + ['test']
 
12:46 AM
@DoorknobofSnow "1,2,34,5,6test"
 
@copy what library did you need but not have?
 
@BenjaminGruenbaum the huge standard library is nothing but terrible
I mean, rsort. Seriously.
Anyway proceed w/o me, I'm going to sleep.
still waiting on "++ vs +"
 
@BartekBanachewicz so you mean it has a lot of functions you don't need? So don't use them.
 
@BenjaminGruenbaum no, it has a lot of terrible functions.
 
@BartekBanachewicz hold on, I want to hear your arguments against PHP, this will be fun.
 
12:47 AM
maybe later.
2 mins ago, by Bartek Banachewicz
also everything the amazing blog post about it has
 
So you mean there are APIs you shouldn't even be aware of and don't use :O?
What amazing blog post?
 
just copy what I think from there
 
@BartekBanachewicz Now that's ad hominem
 
I pretty much agree
 
Haha, just copy what I think from there is priceless ^^
 
12:48 AM
@SomeKittensUx2666 it's not, because it's not an argument
@BenjaminGruenbaum I agree with pretty much everything so...
 
@BenjaminGruenbaum I think he's referring to the fractal of bad design
 
yep, that
 
@BartekBanachewicz So you don't have any original arguments.
 
@BenjaminGruenbaum set, str_repeat, range, str_pad, bignum, Integer are some of the more common ones, but there are many more
 
@SomeKittensUx2666 they are nicely phrased and organised there
better than I would have time and effort to do
 
12:49 AM
@BartekBanachewicz So you'd be ok if I just pointed at a blog post and said "Hey, this is what I think" without any original thought on my part.
 
And broken things in JavaScript like how you can't combine map with fromCharCode or charCodeAt
 
good night.
 
user406009
@copy What happens when you combine them?
 
@copy yeah, you have (but need to npm/bower install) libraries for all of those. I'm still waiting for that to be automated much better or standardized.
 
@Lalaland That's quite hard to explain, there is more than one reason
 
user406009
12:51 AM
@copy Oh, are you talking about iterating over each character?
 
Yes, converting from array of ASCII values to String and vice versa
 
That's a code golfing problem :P But yeah. It kind of is strange that strings are not enumerable.
well, this isn't going anywhere (the room, bye bye room)
room topic changed to Community Fan Club: Best Show in the World [blanketsburg] [deantastic] [pillowtown] [rlemon] [winger-guarantee]
 
@BenjaminGruenbaum No, undo please
 
room mode changed to Gallery: anyone may enter, but only approved users can talk
room mode changed to Public: anyone may enter and talk
@copy wait why? This room wasn't getting us anywhere
 
I think it is. I made a good point
 
12:57 AM
What point?
 
The standard library
 
Yeah, we talked about it before, the way JS deals with it is through third party libraries.
Stuff like BigInt.js for ints, moment for dates, underscore etc.
 
We could just leave that standing here and people decide for themselves what they want
 
fair enough, do whatever you want with it :D
 
1:04 AM
room topic changed to Is JavaScript Bad?: [javascript]
 
 
14 hours later…
3:08 PM
@copy I was thinking about little something that would show you examples of code like "5" + 5 and asking the user what the result should be
that could evaluate their choices at the end and point them to right language or something
 
Go ahead
 

« first day    last day (26 days later) »