« first day (2750 days earlier)      last day (2412 days later) » 

14:00
it's handy in a few places, but usually grows into a class very quickly
@ssube More often than not, I find that you only need the one object
Wonder how they consider what's safe enough to run
@SomeGuy For a second I thought you were pointing at your own beautiful, sexy blog
@SomeGuy probs if execution time is less than 1ms or something, it keeps going, otherwise reverts?
or do you mean xss-safe?
14:01
@Zirak Hahaha, it does feel nice to finally have one!
@ssube I got confused because I've three things to do the same: 1) function myClass() { ... } var instance = new myClass(); 2) var instance = new Object({ ... }) 3) class MyClass() { ... } var instance = new MyClass()
@Neoares MUSHROOM MUSHROOM
SNEK
@AngelLuis 3 is just a nicer way of writing 1, you shouldn't need 2
also, if you're using class, use const
I don't think there's a platform that supports classes but not consts
thanks for the tip
and between 1 or 3, which I should use?
or in which cases
14:04
@SomeGuy Not much, just checking length: cs.chromium.org/chromium/src/third_party/blink/renderer/…
unless you want to manually type the myClass.prototype.method = function() nonsense every single time, probably 3
In 3, the () after the class declaration are invalid
Beyond that, 3 is the most sexy one
3 is the one that conveys the intent of a class with most clarity
If you're thinking classes, you should most often use the class keyword
it's semantic, your code looks like what you intend it to do
there's no such thing as self-documenting but that sure helps
why there are 3 ways? an evolution process?
14:07
@AngelLuis the class sugar is recent, yes
I dunno.. is a quine considered self-documenting?
#showerthoughts
@Neil Only if it's unopinionated
@Zirak Noice
@Zirak loop.break
14:07
only if it's 100% comment and 0% code, I'd say
class were defined in 2015, I suppose that function constructors and object constructors were defined in ECMAScript before 2015, it's true?
well before
The whole class keyword on a prototype based language is kinda confusing
It's just syntactic sugar. Sugar goes great with cereal, man
yeah, I'm pretty confused with that (well, less confused thanks to the guys of that chat)
14:09
is an empty javascript program a quine?
prototypes were a mistake that class papers over :)
@towc a quine by definition can't be empty
@ssube are you trying to start a flame war ?
@Neil I've never had sugar on my cereal
@towc shut up towc
@DenysSéguret be who smellt it dealt it
14:10
@Cereal Never had corn flakes or bran flakes and sugar?
@ssube Disagree to disagree
growing up it was the only way I could have cereal that wasn't sugar cereal
@Cereal no
lol
@DenysSéguret I was, yes
where are the flames? What a loser
14:11
I do think that basing inheritance on user-mutable objects like that is generally not great
I grew up on rice krispies and cheerios
I never grew up
we know
I never buy sugar cereal now either
Lua makes it look good, but in very small chunks
@towc give it time
14:12
Every once and awhile I'll buy cinnamon toast crunch when I was to have a bowl of pure sugar in the morning
@ssube but that wouldn't be JS without it.. It's what makes JS JS
@Luggage that's fine with me :D
@Luggage Like Bartek, @ssube is only here ironically
@Luggage are you fine with callback hell ?
No. I'm all for fixing JS with things like async/await.
I don't feel that changes JS, just makes the syntax work better with how you have to use JS
we'll have wasm to give people choice in languages. JS doesn't to make python lovers and Java lovers and go lover all happy.
14:15
I ate too much
I love JS, python and Go, no problem
I noticed a lack of Java in that list.
I noticed a lack of list in that Java.
Java lovers. That's a strange idea that there might be java lovers.
@Cereal you convinced me to go pour a bowl of banana nut crunch
14:17
Is camel case notation(firstName) preferred over underscore(first_name) for naming symbols in JS or TypeScript?
@DenysSéguret keep drinking coffee and, just before you die, there will be a flash of light and you'll love Java
came case xD
medical professionals call it delirium
yea, camelCase is traditional.
what is a JS symbol?
14:17
If anyone's interested, I'm posting SciGEN papers in C# to counterpoint J. Doe and he's actually attempting to refute them. It's quite entertaining.
if you mean variables, I use snek case
symbol mean function name, variable name, object name,... In compiled languages, generally they sit in symbol table
@overexchange just do like everybody. If you're writing JS, use camelCase. And try to follow one of the common norms (like the Google's one, or the "standard"), at least until you can define your own
@overexchange Write it however you wish, but if you don't want me to hunt you down, camelCase is best
@MikeTheLiar thanks, job done
14:19
const camelCase = 42;

class PascalCase {
    camelCase = 3;

    constructor() {
        this.camelCase = 4;
    }
    camelCaseFunction() {
    }
}

new instanceIsCamelCase = new PascalCase();
meh
I use snek case for variables
cameCase isn't "best". It's just what makes your code readable in the middle of the rest of the JS ecosystem (including browser and node libraries) which is 99.99% camelcase
how do you all prefer to name private/protected members that have a single getter/setter?
best can mean "what everyone else uses" when it comes to style conventions
like, when in the US, it's "best" to drive on the right side of the road.. JUST because everyone else is.
PRTG looks real nice, but spending money is real hard here at CorpyCorp :(
it's funny you're looking at that
much of this week has been spent spreadsheeting our existing monitors and tools, trying to find a single replacement
14:24
we have several half implemented or shitty ones
activeXperts, vcenter's monitoring, etc
same, plus datadog for all the prod stuff
@ssube Depends on its purpose
DD is pretty well set up but struggles with clusters
dd if=/all/the/data?
ohh data dog :)
@OliverSalzburg I would use a public readonly property, but I need to write to it occasionally
14:25
I just make sure to put all private members under a multi-line comment that reads "Warning: Bare private parts below". For the lulz
no cloud services :(
@KendallFrey @rlemon @FlorianMargaine happy Friday my dudes REBECCA BLACK FRIDAY
the current front-runner for replacing datadog is sysdig (which has an on-prem, I think)
1. we have a data center and are moving into the corporate one. they won't approve it. 2. There is no guarantee that a serveri will continue to be paid for, so we prefer one-time payments when possible
or free, of course.
cc @FlorianMargaine @KendallFrey
14:28
isn't J. Doe like @towc but less smart?
are the blocky artifacts intentional or performance-related?
looks intentional
intentional
whyday
I only update part of the screen each pass
@rlemon um... nothing?
14:29
@ssube I don't even know what that is
unless you got errors, I have no clue
no errors
just loads then goes blank
works in chrome.
What do I term [id:string] in below declaration & initialisation?
interface IPerson{
    firstName: string;
    lastName?: string;
}

let persons: {[id: string]:IPerson;}[] = [
    {
        "p1": {firstName: "F1", lastName: "L1"},
        "p2": {firstName: "F2"}
    },
    {
        "p3": {firstName: "F1", lastName: "L1"},
        "p4": {firstName: "F2"}
    }
];
the index? indexer?
14:34
Is id the TypeScript keyword, when used?
@rlemon LOL
In [id: string] type can be string or some user defined type, but id
@overexchange afaik, id is the least important part of that. You could change it to name or key and things would keep working. The [x: type] notation is the important part.
@Neoares no
@Loktar the effect wasn't what I wanted, but looks like laggy video. The fetchWithProgress function I'm super happy with tho
14:36
J doe is a conspirationist
It means that the object can be indexed with a string, i.e. foo['x'] will work
@ssube you explained me classes with a Cart in a shopping web. So I've made an example: jsfiddle.net/q5ks01dL It's good? It's the worst thing ever?
How does removeEventListener act on ES6 class' static methods?
I would assume the same
14:36
it's called an "indexer" or "string index signature" and it's talked about here: typescriptlang.org/docs/handbook/interfaces.html
mousemove is not removed...
when mouseup occurs
Don't use this.
It's static
@AngelLuis that looks like a good start. Now that you have a card, you can make the HTML update when a new item is added.
posted on April 27, 2018 by CommitStrip

@AngelLuis your code works, so that's definitely good :D
14:38
@rlemon what then, if I want to keep the handler as a class method?
My code priorities: 1. Looks good, 2. Works
Mine is usually just Works
@ssube oh I thought you will write "never use global variables" or something like that
!!s/code/boyfriend/
@MikeTheLiar My boyfriend priorities: 1. Looks good, 2. Works (source)
14:40
because it's the only way to check if the object have an instance
!!tell Feeds giphy developers developers developers
@ssube this inspired me very much
@KamilSolecki how much drugs are you on? :P
14:42
im high on Procrastination
best drug ever
injected 3 youtube videos this morning
Perfect, thanks @rlemon
and how I can design a destroyCart method? I know that I can destroy the instance modifying the instance variable. But, how I can destroy the instance inside the class?
it's friday, how much can you legally accomplish anyway?
or it's impossible
14:44
I'm not saying you can illegally accomplish more, rather that the law limits accomplishments today
I think there's a law prohibiting you from being too productive on fridays, yeah
"Send everyone who is productive on a Friday to the Gulag" - Joseph Stalin and Gandhi
@AngelLuis you can't destroy things like that in JS, at all, no matter what syntax you use
it's a garbage collected language
but it only picks up 4 objects every 2 cycles
the engine is trying to reduce garbage
it's called "The 'We Are Too Lazy To Figure Out Actual Acts Because It Is A Friday, So Here Is Something To Keep The Populus From Thinking We Are Too Lazy' Act of 2018"
14:46
considering the memory is reused, it should really be the recycling engine
@ssube but what if the user clicks on empty cart? I can instance = null and then create a new instance for a new cart, but maybe it's a way to make a destroyCart method
@ssube nahh, that implies the objects are reused
memory is like your bins. objects are the contents.
recycling would reuse the contents, garbage is tossed
@AngelLuis some languages have those, but not JS. You can clean up the things the Cart owns, the items in it, but the Cart cannot participate in deleting itself.
nor can you tell the script exactly when to delete it and release the memory
@rlemon fair enough
the analogy makes more sense the further you take it
@ssube thanks at least I wanted to make sure that I couldn't do that hehe
yup
so in Angels case, he's tossing trash into the bin, but has no way to empty the bin himself. he has to wait for the garbage men to come empty it for him
14:49
@AngelLuis side note: The cleaner is literally called "Garbage Collector" or GC for short
I'm bored
@towc write some code
I'm mentoring some people, as a volunteer, in maybe 10 mins
not enough time to get into a project
Array of key-value pairs.. does not work..
const persons: [[x: string]:IPerson] = [
    "p1": {firstName: "F1", lastName: "L1"},
    "p2": {firstName: "F2"},
    "p3": {firstName: "F3"}
];
14:52
no, it wouldn't
Is this tuple type? [[x: string]:IPerson]
not even slightly
it's like a map/dict
@overexchange that's not even a JS thing
[string, IPerson] would be a JS tuple
@towc typescript is on topic.
14:55
if you have a url of /something/:id/bar
and :id = "1/2"
That's not possible to send in that format, is it
percent encoding
encoded, you can
@rlemon point was, the issue isn't with TS, it's with JS
const arr = ['a': 1, 'b': 2] isn't a thing in JS, and he might have thought it was
Even this syntax does not work..
const persons = [
    {"p1", {firstName: "F1", lastName: "L1"}},
    {"p2", {firstName: "F2"}},
    {"p3", {firstName: "F3"}}
];
no, it wouldn't
14:58
array of persons
@ssube I'm grabbing a mixed reality set today
{a: 1} is a dict, [a, 1] is a tuple
HP one is $249 at bestbuy and my sons paying half
oh nice
the Odyssey is on sale too, $400
is your hand tracking decent?
that's my only "concern" I guess
14:59
from Microcenter, I think?
but for 249 I can't complain
yeah, it is pretty good
yeah 400 is a bit eh, he only has like $125 to spend
and I said I'd pay half for now until he pays me back lol
occasionally the headset will jump slightly, the hands lose tracking if you keep them behind you for more than a second or two

« first day (2750 days earlier)      last day (2412 days later) »