« first day (1189 days earlier)      last day (3763 days later) » 

12:00 PM
Oh, jesus
Some of those are bad
 
also what the hell are "trademarks"
 
"In trust we God"
wow
 
Apostrophes, people, apostrophes
 
ugh the whole ES7 stuff is basically one huge fuckup
 
12:10 PM
@BartekBanachewicz wat?
 
@JanDvorak this
if you can point me to anything that's actually readable I'd be really happy
 
promises should be useful
 
right now I'm reading about let in ES6
 
@AbhishekHingnikar There is one in my city that says "We give the best handjob in the world". Its for a carwash.
 
that looks like a light in the tunnel
function varTest() {
  var x = 31;
  if (true) {
    var x = 71;  // same variable!
    alert(x);  // 71
  }
  alert(x);  // 71
}

function letTest() {
  let x = 31;
  if (true) {
    let x = 71;  // different variable // YES FUCKING YES
    alert(x);  // 71
  }
  alert(x);  // 31
}
 
12:14 PM
while( human === alive ) {
     let me = rich;
}
I like let
 
I can basically s/var/let/ my whole code
I want it in Chrome.
 
@BartekBanachewicz you might slow it down by this
 
@JanDvorak wait WHAT
If anything, I'd expect it to speed up
because of locality of reference and whatnot
 
I guess let would be like an extension of var, in the code?
 
@BartekBanachewicz anytime you enter a block that has some variables that might be closed over, you need to create a new scope object
 
12:17 PM
134
Q: Javascript - "let" keyword vs "var" keyword

TM.In javascript 1.7, the let keyword was added. I've heard it described as a "local" variable, but I'm still not quite sure how it behaves differently than the var keyword. What are the differences between the two? When should let be used over var?

that was 4 years ago ^ -.-
@JanDvorak uh "scope object". I thought V8 can optimize code.
 
@BartekBanachewicz it can't if you're a dick with scopes
 
first you tell me (us) "oh no don't use asm.js normal JS will be fast enough"
and then "no don't use scoped variables because that will be too slow"
@JanDvorak restricting variable scope to a scope where it's used is "being a dick"?
 
Uh, no, it's still faster than creating an extra function just to get a scope
 
what extra function
do you write in any language other than JS?
 
(function(i){...})(i)
 
12:19 PM
oh you write in Java
now, you should know how block scope works in Java
 
and, if you close over a variable declared inside a loop body, then the variable needs to be allocated multiple times.
 
@JanDvorak other languages can cope with that.
 
@BartekBanachewicz by reusing the space
 
@JanDvorak yeah, for example.
 
you can't reuse the space if the variable will be used again
 
12:21 PM
I mean, there's no fundamental problem in making block scope work
 
(but then again, you'd create an IIFE in that case anyways)
@BartekBanachewicz the fundamental problem is IE
 
@JanDvorak IE as Internet Explorer? :O
 
@JanDvorak Would that mean if you would use a single let statement in a block, that any variable referenced within this block, would first look if it's existent within the scope, created by let, thus "slowing it down"
 
@C5H8NNaO4 the "looking if it's used inside" is done at compilation time
 
I can imagine creating a scope object is more costly than advancing the stack
then again, if let expressions are going to slow the code down, it's just....
 
12:24 PM
@BartekBanachewicz only if you search&replace
and cause unneccessary loss of reuse
 
@JanDvorak but that's implementation problem not mine right?
 
@BartekBanachewicz it's not the compiler's fault if it's asked to do something that changes the behavior in such a way that can't actually be detected
 
I feel like hitting the wall here.
And I'm trying really hard not to insult the language itself again.
Also forEach
 
yeah... that's slower than for with let
 
@JanDvorak is there some other way to avoid writing regular terrible for loop that's not 20x slower?
 
12:28 PM
just to be sure - the slowdown will be negligible
@BartekBanachewicz it's not 20x slower...
 
@JanDvorak actually it kinda is
 
depends on what you're doing inside
 
Is there a hash-like algo that creates a unique hash for a & b? Like, I'd rather go for hash(a+b) but a+b might be b+a and it wouldn't reproduce the same hash.
 
@JanDvorak replacing one forEach to for in my code resulted in huge speedup
 
have a nice weekend guys!
:)
 
12:29 PM
@BartekBanachewicz what was the body?
 
@laggingreflex since when is addition not commutative?
@JanDvorak searching for a pixel in color palette, but that's really irrelevant imho.
 
@BartekBanachewicz when they're a string
 
@BartekBanachewicz addition of strings isn't commutative
@BartekBanachewicz use a for..i
 
eh. amazing operators
@JanDvorak what?
 
oldschool for
 
12:31 PM
@JanDvorak I don't want to use it. It's terrible.
it was cool in the 80's
 
@BartekBanachewicz so is the function kewyord
 
but since then every fucking language on the planet adopted better solutions
every one except JS, as it seems
so there's really no way to pack numeric for somehow (so it won't be absurdly slow)?
 
for..of?
you could ask for a spec update saying that numeric keys in arrays shall be sorted by their values
 
@JanDvorak okey. So I can assume that when it gets into Chrome it will work fast enough?
@JanDvorak ah, but the order is still not guaranteed?
amazing.
 
then drop IE8 support and make your shims non-enumerable
then for..in will work
 
12:34 PM
I don't support IE8
 
but it still isn't in the spec
 
@JanDvorak see the console.log output and let me know what's the error of this data case
 
I just
I don't know what to say to that really.
 
@samitha what is the expected behavior?
 
 dDate.setDate(dDate.getDate() + getinsDays);
30 days should be add to the date
using that loop
 
12:38 PM
@laggingreflex xor!
 
So,All outputs should be in year .right ?
@JanDvorak
but instead show me 2015,2024,2032
 
@samitha the data attribute is a string
date + string = string
 
so what i want to do to fix?
parseInt()
?
 
!!tell samitha google string to number javascript
 
12:42 PM
@samitha Yup, basically dDate.setDate(dDate.getDate() + parseInt (getinsDays,10));
 
are hashes add commutative?
 
depends on what type a and b are
 
string
 
and the type of the hash, an int?
 
even if they're numbers, hashes are strill strings, right?
I didn't know hashes could be whatever I want them to be
 
12:46 PM
numbers aren't strings
 
If you're concatenating something instead of calculating a sum, it's not commutative
 
Yay, weekend...
 
("a" + "b" !== "b" + "a") && ( "b".charCodeAt() + "a".charCodeAt () === "a".charCodeAt() + "b".charCodeAt () )
 
Yay, Zirak!
 
DIE
 
12:48 PM
If you're into that sort of thing
 
@laggingreflex basically mathematical addition, represented as a plus sign (+) is commutative. The fact that it's abused in JS to represent string concatenation is fucking sad and it's a source of problems and misunderstandings like that.
 
so he meant that for ints, is that so English isn't my first lang, but "Any symmetric operation on the individual hash codes will produce what [you[op]](stackoverflow.com/questions/13019307/…) want" does make his answer wrong doesn't it?
 
@BartekBanachewicz PHP uses the period for concatenation
I hate that
 
@JanDvorak what would you want instead? a single period looks bad, but it's still better than a +
Lua uses .., and Haskell ++ which are both okay in my opinion.
 
VB had it right, man.
 
12:51 PM
@BartekBanachewicz Excel uses &
 
@JanDvorak that collides with bitwise and
 
Excel doesn't have a bitwise and operator
 
...but we're not talking about Excel
 
operator overloading FTW
 
but of course
 
12:52 PM
How does "Any symmetric operation on the individual hash codes will produce what you want" be the right answer? stackoverflow.com/a/13020722/1266650
 
... but then again, JS doesn't have op overloading yet
 
@BartekBanachewicz Welcome to arguing with Jan Dvorak.
 
@Zirak Yeah. It's the most intuitive language IMHO
 
@Zirak wat?
 
Nothing, nothing.
 
12:53 PM
JS <> Intuitive
 
@BartekBanachewicz The ambiguaty of the + operator is nothing, compared to the / operators
 
inb4 lemon comes in and gets angry on me for saying JS is fucking terrible again
 
I don't know what LOLCODE does, but it's obviously the best.
 
@BartekBanachewicz I'm not exactly happy at you either ;-)
 
12:55 PM
@JanDvorak nothing I complained about today is baseless.
It all came out from a normal discussion about perfectly fine code.
And the conclusion was always that something is inherently broken.
 
every language has its weak spots
 
but why does it have to have so many of them in so obvious to fix places?
inb4 "corporate lobbying"
 
Javascript has one insanely powerful spot: closures
also, first class functions
 
@JanDvorak Lisp had FCFs in the 70s 50s
 
posted on January 17, 2014

It’s time for some browser stats, as always courtesy of StatCounter. StatCounter has rolled out a major upgrade to its statistics. For the first time, tablets are now clearly separated from desktop. If you haven’t taken a look for a while, do so now. This allows us to see that right now, of 20 website visits, 15 come from desktop, 4 from mobile, and 1 from tablet. Remember that

 
12:59 PM
Closures are easy if you don't know c/c++, or are too stupid to overthink IMO.
 
@BartekBanachewicz lisp lacks any decent built-ins
 

« first day (1189 days earlier)      last day (3763 days later) »