« first day (3084 days earlier)      last day (1874 days later) » 

7:00 PM
I'm like 80% sure I already knew that
 
@ndugger Why?
 
personal preference
 
DI just means "pass the shit you need in the constructor instead of relying on factories or globals"
 
wait, is an abstract class in Java the same as it is in C++?
 
What's your alternative to DI?
 
7:01 PM
the alternative to DI tends to get really ugly really fast IME
 
@DavidKamer I think C++ calls them virtual classes, but yes, the concept is the same.
 
either a factory, or literally just a map of dependencies that you manually retrieve from. I don't like that DI automagically injects things from a registry. It tends to cast shadow over how exactly dependencies are constructed, and where they come from.
We have a bug right now in a java app that it fails to start and no error is thrown because the DI fails to construct one of the dependencies and just sits there in silence
 
@ndugger You're thinking DI container
DI just means that you ask for whatever you need in the constructor, no more, no less.
 
fair enough
 
@KevinB why do you do it that way?
 
7:04 PM
class Printer {
  constructor(pages) {
    this.pages = pages;
  }
}

// instead of

class Printer {
  constructor() {
    this.pages = Array.from({length: 100}, () => new Page());
  }
}

// or worse:

class Printer {
  constructor(pageFactory) {
    this.pages = pageFactory.get(100);
  }
}

// or even worse

class Printer {
  constructor() {
    this.pages = getPages();
  }
}
Some will argue that 2 is worse than 3 because testability, but at least it's somewhat readable.
 
class Printer extends OneHundredPages {}
clearly we have a solution
 
@rlemon I should kick you for that.
 
listen, I'm just trying to put the Java back in JavaScript
 
Honestly, something like that would be reasonable in Rust, where you have a trait system
 
don't hate
 
7:06 PM
I fucking love rust's traits
impl OneHundredPages for Printer
 
@ndugger Does that get compiler support?
 
hm?
 
@ndugger Will compilation fail if I attach a trait and call it wrong? Will I get "Jump to Definition" support in my editor when I see a method that doesn't exist on the original class?
 
I believe so to the first part of that question
Not sure about the editor support
 
See C#'s extension methods
 
7:09 PM
I can't read
 
so, you don't C#?
hon hon hon
 
I Cnearsighted
-4
Q: salesman trackinh

kalyani kancharlaHi I want a solution for the below algorithm any one have idea how to solve this?

 
> Rudi Visser
There's a name I haven't seen in a while
 
is that a person of significance?
 
7:13 PM
"Howw do i do codess?"
 
it's ziGi's alt account
 
@rlemon would you opine that this is a better way to write it
for (dataPostion in data.resorts) {
    console.log('data.resorts ', data.resorts)

    dataList = data.resorts[dataPostion];
 
opine?
 
yes have the opinion of
 
for..in is a bad loop
 
7:13 PM
opine
 
so I'd tell you no based on that
๐Ÿ˜€
 
looked like a typo. Not familiar with that word
TIL
 
lol i mean if it gets the job done.
 
@rlemon Someone who used to troll the C# room
 
@ChristianMatthew a rock will put a screw into a wall.
"gets the job done"
 
7:14 PM
lol
 
@KendallFrey ahh
 
o·pine
/ลหˆpฤซn/Submit
verbFORMAL
hold and state as one's opinion.
"โ€œThe man is a genius,โ€ he opined"
synonyms:	suggest, submit, advance, propose, venture, volunteer, put forward, moot, propound, posit, air, hazard, say, declare, observe, comment, remark; More
 
for (const position of Object.keys(data.resorts))
 
for( const [ key, value ] of Object.entries( data ) ) {

}
or if you don't care for the key
Object.values( data )
 
yea definately need the key
 
7:16 PM
I forgot how much your whitespace in parens triggers my ocd
big oof
 
oof triggers me
 
oof you
 
@rlemon triggers trigger me
It's a recursive trigger.
 
oof uwu * waves * hello room
2
 
so here is my next question... in node using interperolation what if one of the dataList.keys is an [object object] how can i extract out what is in that object
 
7:17 PM
the object is getting toString called
 
@ChristianMatthew The general rule is don't use for..in
 
stringify it ahead of time
 
Object.keys and a map is the only god tier way to do it
 
And the even more general rule is always run in strict-mode
@rlemon Konnichiwa room-chan*
 
sorry I'm not actually a weeb, I just play one on TV
 
what is this dark theme bypassing media type?
ohh an ugly mp4
I should handle those too I guess
 
I just am bad at imgur and don't really understand how to make that a gifv or whatever
 
@rlemon You do handle them
 
Am I the only one who hasn't purposely watched a single marvel movie?
 
@DavidKamer you've accidentally watched them?
 
7:20 PM
@DavidKamer So you're saying you've accidentally watched several?
 
I almost said no but remembered I've seen Deadpool
 
@forresthopkinsa yeah, actually Dr. Strange. The only one, because it was on netflix, someone had it on, and I was like "wow this is pretty good"
I would have avoided it if I knew it was marvel tbh lol
 
what a weird mindset
 
I'm still on atom, because I'm stubborn and I still have ptsd flashbacks from when vs code first launched and was super terrible
 
I'm still on Atom because I don't see any reason to switch
 
7:24 PM
that's why I'm on ST
 
@forresthopkinsa it's how loopback's builder set it up at the time
 
@KevinB if you were to do it again, would you do it differently?
@rlemon that's fair
 
@forresthopkinsa I had issues with the vim plugin in atom so I switched to vscode
 
if i were to do it again, i'm not sure i'd have different package.json files for the two
 
plus microsoft owns both now, so it's practically a non-choice
 
7:25 PM
@KevinB hmm weird
@DavidKamer that doesn't make any sense. You have just as much choice as you did before
 
think about it... clientside code doesn't need any non-dev dependencies
 
I mean if I had to sit down today and try a new editor for reasons I can't fathom, I would probably try vscode. but I see no need to jump over. ST works well for me. Integrations I need are available by plugins, and I've already paid for it
 
and server-side code doesn't need dev dependencies other than the same ones client-side code would need
like typescript/webpack
 
sublime is probably the only one I'd consider switching to. I've always been curious about it
 
@KevinB I guess that makes sense
 
7:26 PM
are any of you good with node
 
that's basically rlemon's configuration
@ChristianMatthew no we only do javascript here
 
here what i am trying to figure out... how can i get the last value to extract the object
 
@ChristianMatthew Node ??
 
@ChristianMatthew Never heard of it
 
let someQuery = `insert into \`queryRoot\`.\`query\`(\id\,\`name\`,\`alias\`,\`state\`,\`thing\`,\`thing2\`,\`thing3\`,\`Thing4\`)
    values (${dataList.id},'${dataList.name}','${dataList.code}','${dataList.state}','${dataList.thing}','${dataList.thing2}','${dataList.thing3}','${dataList.Thing4}');\n`;
 
7:28 PM
Oh my god
 
thing4 is another json object
 
Bobby Tables just called.
He wants his query back.
 
lol
well technicall this is wrtten in a node file
 
..............
 
node file?
 
7:29 PM
assuming you've not filtered the inputs on the server you're still open to SQL injection attacks
 
because node can create files... writeFile.write(someQuery);
 
this is amazing
 
yes a file that runs by node i.e. node runfile.js
 
so a js file?
 
it just used the node framework to do things
 
7:30 PM
so this is not a webserver?
 
yes of course
no
 
9
A: Relative friendliness of developers by language on SO?

OscarRyzCompletely off topic, but hey, it's friday :-) http://www.rubyinside.com/holiday-fun-how-programming-language-fanboys-see-each-others-languages-2911.html'> (source: rubyinside.com)

 
okay, less WTF then
 
im taking a node script and buillidng out a sql statement
lol
 
lol, I just never heard someone say "node file" I was wondering if it was something I've never heard of lmao
 
7:31 PM
No, I'm sorry, this is still a WTF
Use a parameterized query.
 
well sorry lol i didnt' know what to call it
 
@DavidKamer well, node don't care bout your extensions.
$ node app.node
 
i am taking an existing json file and extracting the data from it so it will create a list of all array objects to a sql statement
it works i just can't get the raw data from the last part
 
@rlemon I mean after he said that, it was my guess, just never though about making my code less self documenting before tbh
I'm going to start naming my node files with .py just to confuse people now
 
can node run a .py file?
 
7:33 PM
if you have no documentation, you can claim everything is a feature
 
1. Use prepared statements/parameterized query.
2. The code you provided isn't enough to determine what's wrong.
3. Use prepared statements/parameterized query.
4. Use prepared statements/parameterized query.
 
are redux and redux saga the same thing?
 
@Shafizadeh No.
 
ah ok
 
7:34 PM
One is trash, and the other is a trash bag. It's a tool to work with the trash.
 
redux saga sounds like a video game
 
@MadaraUchiha I don't know what you mean by your statement
 
@rlemon A shitty one, with microtransactions.
 
unless Square Enix made it
then it's a killer JRPG
 
EA made it?
 
7:35 PM
5
A: Relative friendliness of developers by language on SO?

wafflesAs someone active in the C# and Ruby tags, the Ruby crowd are a lot friendlier. But then again that is what you would expect from a bunch of hippies that do not care about the indisputable fact that Rails does not scale and instead of coding are busy making video clips.

 
redux saga 76 by Bethesda
 
!!> "redux" === "redux saga"
 
@KevinB false
 
@forresthopkinsa I ctrl+f'd for javascript and found nothing lmao
 
!!> 'redux saga'.includes('redux')
 
7:36 PM
@ChristianMatthew I don't know how to make it any clearer for you.
 
@ndugger true
 
@DavidKamer in 2010 no one wrote JS
 
redux makes me sad
so we use mobx
 
@rlemon fair enough
 
!!redux or mobx
 
7:37 PM
@KevinB redux mobx
2
 
nice
 
my network is being stupid slow today. I think
might be my PC
 
and caps pc
 
windows, just blame windows
 
7:37 PM
abuse appropriate use of power
 
โค๏ธ
 
@CapricaSix show us on the doll where the mod touched you
 
๐Ÿšฝ
 
@rlemon Idea for the dark theme: :uXXXXX: replaces with unicode character 0xXXXXX
 
make an issue
I might pop some off soonish
 
7:40 PM
tmi
 
I tend to work on dark theme once a year.
 
heh
 
for like 3 hours.
 
Question: Is there a way to use an inline SVG without having all the data from it in your HTML?
 
wouldn't be inline then would it
 
7:44 PM
I guess if you bent the laws of physics, you could have the svg in two places at once, so it could be inline but not
 
no, but thats the thing
I want my cake and..
 
import the svg, and document.write it out
๐Ÿ˜€
problem solved.
 
@rlemon That's a second time I should be kicking you right now
Third time might just happen :D
 
ok any idea is Redux-Thunk better or Redux-Saga ?
 
ask stupid questions, get stupid answers. what else do you want?
 
7:46 PM
@Shafizadeh You are asking whether horse dung is better to use than goat dung
 
yes
 
ah ok, I guess I have to read this
 
Neither are great, they both solve a problem borne of your tooling, rather than any real complexity or issue with the problem at hand
 
yup that'll work. was think along those lines.
 
@MadaraUchiha ah
 
7:47 PM
I personally think that Redux is a poor choice of default technology
It may be a good calculated choice of technology under certain cases, but MobX is a much better default.
 
I could do without the decorators, but mobx is definitely my go-to
 
@MadaraUchiha Is MobX compatible with react?
 
@ndugger Hooks are supposedly mobx without the decorators
But with a whole 'nother load of baggage.
@Shafizadeh Yes.
 
I haven't tried out hooks yet, but at first glance they look bad
spaghetti
 
@ndugger They're explictly mixing your model in your view.
 
7:49 PM
horribad
 
It's nice under some circumstances, but the API choices made are just plain poor imho
And it shows in that it has to happen at the top level, in the same order every time, effects are dismissed and reregistered on each rerender by default
You need to pass this ridiculous array of parameters to make sure it doesn't have stale data
 
as long as they don't remove the old way
idc
 
Some of the recent decisions on EcmaScript and now React make me want to completely ditch the whole JS ecosystem alltogether
 
@KevinB But that's clearly their intention.
 
wasm save us
 
7:52 PM
then i just won't upgrade
 
this.#wtf = globalThis.kys
makes me want to jump out of a window
 
-1
Q: Dynamically Change part of variable name?

Adam WeilerIn React, is it possible to dynamically change part of a variable name based on state? For example, I'm feeding several components information from a JSON file. Depending on the chosen gender (male or female), I want to send the 'atlas' from either the "male_clothes.js" or the "female_clothes.js...

 
In a Vue object, when you have a computed value that updates, is it possible to determine what caused the update?
I'm assuming that one of the values it's dependent on changed, but is it possible to tell which one?
It's triggering when an event comes in that's being listened for. The weird thing is that computed function is called BEFORE the event handler starts its process.
 
@ndugger Do you know why this is?
 
yes, but that doesn't make me hate the decision less
 
I'm very well aware of the rationale behind the private garbage fields and the idiot globalThis
 
Honestly if there's one syntax feature I truly hate in the language it's tagged template literals.
ducking`ridiculous`
 
i hate tagged template literals, destructuring, spread, and whatever # is
 
tagged meaning foo'asdf' (replace ' with `)
didn't want to fight using the right char in chat, lol
 
@ndugger backslash escapes
@KevinB What's wrong with destructuring and spread?
 
7:59 PM
foo`asdf`
not sure why I thought that wouldn't work
 
they exist
 

« first day (3084 days earlier)      last day (1874 days later) »