« first day (3315 days earlier)      last day (1857 days later) » 

15:41
i have an urge to write a game
@BartekBanachewicz reverse flappy bird, somehow
you control the pipes
lol
nah, i already have an idea
i want to write a strategy game
well, thanks for wasting my time
no stay
i need to decide what to write it in
I'm paid hourly
do it in elm
15:45
Hola
Whats up?
What did I miss?
Elm doesn't have typeclasses
oh, never thought about it
every time i try to use Elm I'm like "this is the worst of both worlds"
@BartekBanachewicz why didn't you tell me this when I said I had elm jobs lined up
you complain all the time, but not when I need it
well I assumed you've coded in Elm before
15:47
Would you find a react-cli renderer useful? gist.github.com/ndugger/b9c6b687207287af22499c2a2daf8dfb -- making it for my job, so the company owns it, but I could make a case to open source it if we end up moving forward with it.
I've also never used elm/haskell/clojure(/script)/scala/lisp in production
or feel confident in any of them
the thing is Haskell is absurdly powerful
and so is JS
elm doesn't have enough features to make you feel like a wizard?
both are like cars with a lot of horsepower but only one has ABS and traction control
std is still too small?
15:48
and elm is like toyota prius
it's effectively too limited for you to harm yourself in
I don't do cars, I don't know what you're talking about
but also too slow to be exciting
oh right
He's 12
well that explains things
aaanyway
@BartekBanachewicz would you write those haskell one-liners in production?
15:49
sure
I'd trust my life to them
I assumed your haskell production code would look a lot more like elm. Slow to develop and overly layed out
certainly more than C++ or Java hundred-liners
Don't talk shit about C++, you haskeller
realistically I'm considering JS/TS, Rust or Haskell
@BartekBanachewicz well, that puts another spin on the situation
15:50
all other languages are bad
Never write plain JS these days; TS or gtfo
Rust is a lot of fun
use brainfuck
I write plain JS and I don't care tbh
C++ is great, and I hate that it gets so much hate
It's not safe code, but it's fun
If you write sane, immutable JS with React you can get shit done
sure it's worse than in TS but it's also faster for smaller projects of little to no complexity
15:51
I've recently watched someone go through a tic tac toe brainfuck program, it actually looks fun
You're gonna have a much better dev experience with TS
@ndugger remember that I code in a text editor, not an IDE
I don't use code completion
wait, what do you use?
are you a fellow vimer?
oh
15:52
and a terminal
Sure, but static typing will still catch bugs for you during compile time
it won't catch bugs because I don't make them
pft, ok god
alright, I gotta go be social, catch up later :)
no I mean it, if I'm writing a click handler for a button there's really only so much that can go wrong
that's why I wrote "of little to no complexity"
if I was doing actual complex logic then of course I'd use TS
15:53
dugger also means it
I think you diminishing front end development to writing click handlers speaks a lot to who you are
I never said that
Sure
I just said that when I'm writing click handlers, they might as well be in JS and the world will keep spinning
honestly immutable and sane design means much more than static analysis in such a small project
especially when I'm the only person working on it
If I have a choice in any project, JS or TS, I'll go with TS every single time, regardless of the size or complexity.
15:55
I'd agree with you a year or two ago
but recently I've been thinking about stuff in a more business-like fashion
as in, what am I shipping, not what am I coding
Ah, yeah, I'm ramping up my business acumen
and god forbid, shipping shitty software can have merits
I would refute any point you'd try to make about how typescript adds development time, though
I've seen it shorten dev time, and speed up new engineer ramp-up time
@ndugger it certainly will have such effect in most codebases with multiple contributors
but we're talking about a weird hobbyist geeky corner case here
That's fair. At that point, I'd still choose TS, but because of a personal preference
15:57
thing is
and this is gonna be controversial slightly
JS can express very, very complex things that would be very, very hard to type statically
it can backfire spontaneously if you don't know what you're doing
Yes, but it's those very, very complex, untyped things that are a breeding ground for bugs
well, yes and no
I totally get where you're coming from; it wasn't until this year that I really caved in and gave TS a solid chance. I hated it before.
I felt like I could be just as productive and correct without static typing
I just like to think
I can be very disciplined strictly because I write so much statically typed code
I think it's just good habits
so if you apply those good habits to a dynamic codebase, you'll end up with something that could be typed if you wanted to
and in fact that's what I'd do with any such project after sufficeint time and/or complexity
but when we're talking the prototyping stage that has to determine whether I'll just throw this one out after the weekend...
the "gradual typing" idea is actually what helped to sell TS to a lot of people
of course, it was mostly in context of previously untyped codebases, but I think it might still apply to turning prototypes into good solutions without full rewrites
very often a prototype is thrown away for the new solution to be written from scratch
but as someone currently involving in such a rewrite professionally, I'm witnessing the problems this causes first-hand
but hey, let's assume I trust you here and do it in TS from day 0
My problem, with JS as my first language (and my strongest language until recently), I was so used to the dynamism provided by JS, where I could throw anything into everything, and it would still run. I had absolutely no discipline. Typescript forced me to become more disciplined, and the quality of my code increased a ton.
16:06
@ndugger do you think this would change the way you would write in JS now?
For sure
that was my point all along
Well fair enough, then. I'd still opt for the guard rails, personally, but I could see your point
and honestly a few years back when I (and a few others in the lounge) were just starting learning Haskell, we saw the same applied to our C++ code
Interesting
16:09
yeah, even though both are statically typed, the mindshift for immutability was a huge thing
I can't see myself ever learning haskell, but it is really cool to see how learning other languages helps strengthen your code quality in other languages
when I go back to learning Haskell for the first time, I remember that I felt a lot of my unspoken concerns sorta solved themselves. As in, it had answers to the questions I was subconsciously asking
It's certainly a very different experience when you already know how to program computers in a few languages, and it just offers a different PoV
ironically, though, if I could have one feature of Haskell in all the languages I need to use, it wouldn't be monads or the fancy functional bits, but the where bindings
16:40
meh
 
1 hour later…
user7437719
17:40
And the great penguin.. TOM MINOR ARRIVES!
user7437719
hey there @bugs
user7437719
wait, WHAT?? bugs has not talked in chat for 572 days!
user7437719
but he is an active user
stop being creepy
user7437719
anyways, what just foregoingly occurred is just so discretionarily avid it is INSANE!

I am just not sure what the credentials are!
user7437719
17:52
Ah, Kevin B.. You never know what Kevin B is going to do next
user7437719
hi copy!
user7437719
has not chatted in 106 days
user7437719
anyways, FAREWELL!
user7437719
I have actually noticed that @KevinB is USUALLY the one that moves my messages to trash
@TomMinor He's a room owner, that's his job. Post fewer off-topic messages, and fewer messages will be moved to trash.
18:38
May 15 at 20:51, by ndugger
can we move a user to trash?
how do i typescript a method that receives an array of types that implement a certain interface?
foo(a: (typeof ISomething)[]) was my first instinct and it doesn't work
Interfaces aren't objects, so typeof won't work there
it should just be ISomething[]
but thats an instance, not a type
new Something() would be the instance
Something would be the Type
18:43
Your confusion has confused me, start over
hmm how do I word this in js
a class in js is a function, right?
I'm competent in TS, you can use TS lingo
so I just want to pass an array of said functions to a method
I do more C# so thats why I probably confused you
Where does your interface come into play?
well its just the uniting type that I can write in the signature
18:45
(ALso as a side note, prefixing your interfaces with an I isn't a super common convention in TS unlike in C#)
I know
force of habbit, I dont do it
It's valid either way, just a tip. I still don't understand your question
so lets say I have class Something{} and I have a function foo(a: ?)
and I want to call it like this: foo(Something)
what would be the ?
foo(a: typeof Something)
yea I tried that, it errors me out
18:46
It might if Something is an interface
but if Something is a class, it would work
ah I see
any constraint I could write?
You could try foo(a: new() => Something), I think, but then you'd have to type out the paramaters of the constructor in there too
There are probably other ways as well, but I have a meeting I gotta run to in a few
alright, thanks for the help
would foo<T extends Something>(a: T) work?
no, nevermind, same problem
19:15
well never mind I was giving parameter decorators another go and gave up again
a yearly ordeal
👎
I don't think it should be retroactive.
i don't think posts with 1 upvote for every 5 downvotes should be net 0
@DenysSéguret miaou doesn't work on firefox, does it :/
@KevinB fair
19:32
wut
where'd my edit go
@DenysSéguret i.sstatic.net/ASEpF.png
tried disabling all extensions too
I think I'll need to drop the tournament if I can't use ff 😒 (very recently switched and don't want to go back)
Are you on a weird network cheating with certificates ?
don't think so, this is my home network and I've never had problems (but I wasn't using firefox)
Another terrible decision by SE. Surprise, surprise.
@Richard read the rules
we should put "don't ask if you can ask, just ask" back in the description
19:41
I'm not sure I'll answer any other question
great
I have a variable named ``var a = 0;`` and then right after a function which changes the value of this variable a.

Now I want to render the value of this variable on the HTML but for some reason only 0 is rendered but on the console the value of the variable is updated
I render the variable in the return function like that <p>{a}</p>
you need to re-update the html
don't just use a variable, use react's state
that's the only thing that "gets checked" for updates
@KevinB why was "don't ask to ask, just ask" removed?
|| welcome
19:44
Missing arg person
|| welcome towc
@towc Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
very mature
there's a variant of it in the welcome message
yes thanks
I don't use class which extends the React.Component.
Just directly export default function Home() { ... code return ( <div> ... </div> ); ... }
19:45
@Richard are you using Hooks?
@forresthopkinsa i'm gonna fix this. Seems to happen a lot
@Richard then it should come from props (arguments to that function)
oh I was out of the loop on your conversation lol
either way, you need to structure your code so it interacts well with react
you can't have a random var there
19:46
@JBis wise
I guess I could try to do it with hooks
|| welcome non-existent-user-hopefully
@non-existent-user-hopefully Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
can diamond mods see self-deleted messages
room owners can see them too, iirc
19:47
|| welcome ‮
@‮ Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
5
disappointing
@JamesBot spectacular
thanks jamesbot
the star board falls for it too ha
Did we lose cap when bob left? Seems like all of SE is falling to shit
I didn't realize line breaks would act like that, neat
19:49
the @ doesn't move with the rest of the text
> But don't worry guys, we're giving more points to people who spam jquery questions
@towc what unicode character did you use?
@forresthopkinsa I'm assuming you understand how that happened. It would make sense for it not to move
202e
@ndugger So?
I feel like we're living in the twilight zone. Every bad decision that SE can make, they make with pride, and then write a blog post about how great it is
19:50
@ndugger We already give more points to people who spam jquery answers
Yes, some undeserving people will get rep
@forresthopkinsa Using hooks helped to solve my problem! Thanks a lot!
@JBis I wouldn't strip it, it can make for some fun stuff
So will deserving people
@towc I'm not, i just want it for future reference XD
@Richard very cool
19:51
Nah, take your explanation, wrap it in a tortilla, and eat it
That is in my top 10 unicode characters
@ndugger since when do you care about rep?
@towc Right, the @ is the only character that's LTR. But it's funny to see that the message in the starboard is different from the one in chat.
I don't, I just like to point and laugh at how terrible SE is being run
I barely pop in here anymore
such.. venom
19:52
I don't think the mods are at fault
I'm a slithery little snake
I never said the mods were at fault
the 3 mods that are left, that is
I think the mods are at fault
I blame Madara
@MadaraUchiha we've decided that SE's decline is all your fault. What do you have to say for yourself?
@ndugger then I can't explain why you're being rude
I wonder what else we could do with that character....
19:53
You have committed crimes against Skyrim and her people, what say you in your defense
@towc it's not rude to point and laugh at people self-sabotaging an entire company. It's justice.
3 mins ago, by ndugger
Nah, take your explanation, wrap it in a tortilla, and eat it
I'm referring to this
He clearly wasn't talking to meagar
Ok, I'm not debating the merrits of jokes with a child, thanks
he was talking to himself
19:55
@meagar can you change your name with character to put the diamond in front?
macOS Catalina broke my crontab
no wonder my stuff hasn't been working
@JBis Are you asking if I can? Or are you asking me to do so?
just an idea
Catalina broke a bunch of shit
But then he'd have two diamonds on main
0/10 idea
No, I can't
19:57
double the diamonds, double the power
oh wait it wouldn't work, they strip things
> Oops! There was a problem updating your profile:
>
> Display Name can only contain letters, digits, spaces, apostrophes or hyphens and must start with a letter or digit
yep throw back to me trying to add a diamond in my name cause i didn't want to have to earn mod
Well, I bet you they have tons of openings now ;)
> Ignore all warnings, sprint head first into oblivion. - SE's operating model
why are you even here dugger?
20:00
Well, my mother and father were probably pretty bored one night
But sure, ignore my lengthy technical discussion with Bartek earlier, and my attempt to help people when I pop in here. Sure.
What are you doing here?
@ndugger that's what brought you into this world and that's what's going to take you out
20:18
For the DNC? Dude doesn't stand a chance
guys
is Parceljs any good
what, just use webpack
@RachelDockter you live in London,40 K GBP is a bit low for LOndon but ... I am biased lol
@forresthopkinsa I wanted to but a tutorial suggested Parcel
and it says it's zero configuration
webpack 4+ has a 0-config mode
20:25
dunno I'm gonna try this thing and see if it's any good
let us know how it goes
@RachelDockter I mean do you live in London Central? (Do you have a degree, do you work from home? How much is travel?)
@forresthopkinsa so far after starting the dev server it seems to be running dev install
which I forgot so fair enough
×  Cannot read property 'type' of undefined
    at Bundler.createBundleTree (C:\Projects\planet\node_modules\parcel-bundler\src\Bundler.js:654:54)
it displays the build error in the browser which is kinda nice
at the same time it displays the build error in a black font on a black background
k, built after restarting
altough for some reason it left zombie node processes
but that might be due to the fact that I'm running an MSYS shell in mintty
so yeah, it works, builds, is fast and requires no config
for simple things I give it an okay out of 10
so .tsx is like .jsx for js
meaning ts + whatever that x stands for
20:39
@JBis i have no info on that
also I'd like to make an observation
that the example TS code lacks any type annotations whatsoever
tsx is a thing outside of parcel
21:09
holy fuck it works
I'm even starting to finally grasp the new modules and I have to say they're more intuitive than Rust modules by far
altough I'm not seeing TS really working at all
export class Player {
    money: number = 99;
    constructor(money: number) {
        this.money = money;
    }
}

// later
    constructor() {
        this.players.push(new Player("woot"));
    }
it builds just fine
wtf
> Parcel performs no type checking. You can use tsc --noEmit to have typescript check your files.
what on the fucking earth
×  C:\Projects\planet\src\GameState.tsx:5:7: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (5:8):
  3 | import {observer} from "mobx-react";
  4 |
> 5 | export type Direction = number;
    |       ^
um how is this experimental again
yeah, I think it's time to ditch this thing and go back to webpack
21:27
parcel is bad
no configuration = no do what you want
@ndugger yeah
I guess it would work for very simple projects
for like newbs
I tried it once, and the configuration it has built in didn't work for what I wanted, even for a simple project. I'd much rather take 10 minutes to whip up a webpack config
uh why is sublime eating an entire CPU core
also ugh webpack cli fails
time to remove entire node_modules and start anew
21:47
hey, it's working
yay
my webz have typez
so exciting
Hi all,
@JunlongWang Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
altough webpack-cli serve is broken for me
@JamesBot what the fuck happened to @CapricaSix
11 hours ago, by towc
lemon took cap with him
seriously
where did they go
rlemon disappeared and cap died from lack of maintenance shortly after
disappeared where
fuck me SO is really turning to shit
21:53
well that's kind of the point of "disappeared" isn't it
have you seen the newest post from that idiot Sara or whatever she's called
no need to be rude
the 10-rep-per-Q-upvote
@forresthopkinsa honestly I've never seen a more tone deaf person in my entire life
and I'm watching Trump presidency quite closely mind you
"We reward people who give answers at a higher rate than people that ask questions." -- By design. But the people in charge now have no idea how the communities work, because they've never participated in them. — Robert Harvey 1 hour ago
but Robert says it better than me
1
A: New Reputation Calculation - was the community asked?

JC007BWe informed site moderators of the change a few weeks ago, collected their input, and responded to it. We trust our moderators as representatives of their communities. We didn't solicit feedback from the wider community on this change. We have a robust roadmap and we are selective in asking the...

this is vile beyond reason
it would be such a freaking shame to have to leave SO
but it seems it's getting closer and closer
Hi all, I have a question about UI update and timeout function using angularJS, but I think the concept can be common in native JS too.

I have a callback function for setTimeout(()=>renderReport()) which requires a visible DOM element by its id.

The DOM element might be hidden by ```<div id="div1" ng-if="!isHidden"></div>```, so I will update it to be visible before executes the setTimeout, like
```
//...
isHidden = false;
$timeout(()=>renderReport()); // or setTimeout(()=>renderReport()) in native JS
well there's a group working on an open-source SO clone
22:00
@forresthopkinsa linky?
the discord server is pretty active
@forresthopkinsa great
can we all move there already
might have to wait a couple days
can you create a new invite for me for the discord
22:07
@forresthopkinsa thanks
looks like it was created like 3 days ago
and github is empty pretty much
@misha130 if we got like 0.01% of top SO contributors the prototype would be up till the end of the year
is there a simple method to prefix all my keys in an object?
@JoeSaad map over the keys?
22:21
yeah and prefix them all at once?
@JoeSaad hmm now that I think about it it's rather risky
what if you want to add prefix_ and you have keys x and prefix_x
!!magic
Object.entries(obj)
	.map(({key, val}) => ({`prefix_${key}`, val}))
	.reduce((acc, {k, v}) => {
		acc[k] = v;
		return acc;
	}, {});
or thereabouts
@forresthopkinsa looks good, but i don't think it is working..
22:29
figure it out
@forresthopkinsa yeah that's safe AFAIR
he got the syntax slightly wrong, possibly on purpose to make you think about it
I'd like to say it was intentional but I wrote that pretty absent-mindedly, it's almost pseudocode
oh duh, you need to tweak that map function, I was being too lazy with the predicate of the arrow function
here's a syntactically correct function:
function prefix(obj) {
	return Object.entries(obj)
		.map(([key, val]) => [`prefix_${key}`, val])
		.reduce((acc, [k, v]) => {
			acc[k] = v;
			return acc;
		}, {});
}
notice that the destructuring was object destructuring and is now array destructuring
now I've officially done the work for you lol
i've seen that reduce written in so many different ways
yeah I'm sure that can be done better
22:38
very much looking forward to fromEntries making it go away
no kidding
I think my current favourite is (o, [k, v]) => ({...o, [k]: v})
this works great, thanks @forresthopkinsa
@david very clever
@JoeSaad sure

« first day (3315 days earlier)      last day (1857 days later) »