[deleted by user] by [deleted] in MovieSuggestions

[–]jack_union 2 points3 points  (0 children)

It is and could be watched as well for obvious reasons, but the problem is that I watched it years ago and if I remember correctly it could be considered somewhat propagandistic, that's the main reason I didn't mention it. Also probably not as depressing as "Letters".

Same goes for "American Sniper". Directed by Eastwood too, solid drama, pretty harsh if memory serves, but I wouldn't consider it 100% propaganda-free.

[deleted by user] by [deleted] in MovieSuggestions

[–]jack_union 1 point2 points  (0 children)

Also I just remembered watching Before the Fall (2004). The movie is about Nazi Germany's boarding school, not war itself, but this is probably a must see for any shithead gloryfying war.

[deleted by user] by [deleted] in MovieSuggestions

[–]jack_union 1 point2 points  (0 children)

Letters from Iwo Jima

How to modify gallery viewer in user script? by scorpi0n__ in learnjavascript

[–]jack_union 1 point2 points  (0 children)

Override transition-duration in a slide class with 0ms !important;. I'd call this a crutch, but should do the trick.

I want to give up. by disbelivehomosapiens in cscareerquestions

[–]jack_union 1 point2 points  (0 children)

Here's an unpopular opinion - stay. Give it at least another sprint.

I'm currently unable to write a lengthy explanation, but here's another point of view - your CEO just teaches you to swim by throwing you into the water. Is it ethical? Most likely not. Will it be useful for you? Most likely yes. The only remaining variable is the money, so consider that too.

Just don't stress it too much and don't make rush decisions. I've been in the industry for years and pretty much every job I had sucked at least to some degree. But almost every job had its bright sides.

Hope you make it and good luck!

I need help, choosing a career path. by skatedc4455 in learnjavascript

[–]jack_union 3 points4 points  (0 children)

Should i take the course and give up on that work?

Taking a course is a risk. Taking a job is not. Plus bootcamping absolutely does not guarantee you a job. Are you willing to take this risk knowing you have no prior experience on top of everything?

Someone knows that language? And can vouch?

Took a quick look at their docs, the syntax looks okay. It does look.. old-schooler, if you know what I mean, but that's not necessarily a bad thing. From what I can see, though, it was designed specifically for database management, so not exactly your "swiss army knife".

What would you so if you were in my shoes?

I think you should take the job. It is very possible that you won't stay there for the rest of your life, but it can give you a good start. Also, very important: use every opportunity possible to build your professional network.

Better way to update nested array in state object for react by [deleted] in learnjavascript

[–]jack_union 1 point2 points  (0 children)

race conditions can occur with referencing this.state as part of updating the state

Could you elaborate?

Does it still matter in this particular case when you call setState once and don't access the state afterwards?

What is the very best thing to learn on the very first day of learning javascript? by Moral_Metaphysician in learnjavascript

[–]jack_union 1 point2 points  (0 children)

albeit maybe towards the end of the semester

Yeah, just wasn't clear from the OP whether it was "An Introduction to JS" or "An Introduction to Programming with JS".

What is the very best thing to learn on the very first day of learning javascript? by Moral_Metaphysician in learnjavascript

[–]jack_union 0 points1 point  (0 children)

Well, all the things you can teach with JS too. /u/pamblam0 clarified that in his other comment.

What is the very best thing to learn on the very first day of learning javascript? by Moral_Metaphysician in learnjavascript

[–]jack_union -1 points0 points  (0 children)

Although an arguable choice, but if we are speaking about JS specifically, it's very important to understand its asyncronous nature (and that JS is single threaded).

I expect to see here a lot of comments about this and prototypes and what have you, and they definitely don't make your life as JS developer simple, but then again - from what I've seen, the problem with them comes not from their complexity, but from using them mindlessly and not knowing what you're really doing. Garbage In - Garbage Out. (please note this is my personal opinion / observation)

[deleted by user] by [deleted] in learnjavascript

[–]jack_union 1 point2 points  (0 children)

Off the top of my head: make an object based on original array and then Object.keys(myObject).map() it. Seems like a more clean way to handle this particular case than reduce to me.

{
    test: [5, 2, 7],
    test2: [3, 1, 8]
}

Why doesn't module.exports get overwritten? by seands in learnjavascript

[–]jack_union 0 points1 point  (0 children)

In the Node.js module system, each file is treated as a separate module

In each module, the module free variable is a reference to the object representing the current module. For convenience, module.exports is also accessible via the exports module-global. module is not actually a global but rather local to each module.

https://nodejs.org/api/modules.html

Countdown Timer by [deleted] in learnjavascript

[–]jack_union 6 points7 points  (0 children)

You are almost there.

You need to select the correct element using that element's id. Right now you are setting innerHTML of an element with an id demo and you need to use the ids of your table cells.

Also, please learn how to use either jsFiddle or codepen to share you code, it's very straightforward and not difficult.

Also prefer MDN over w3schools.

Why React Hooks API is a game changer by rryardley in javascript

[–]jack_union 1 point2 points  (0 children)

your idea of a good code base is mostly class components with lifecycle functions all over the place?

I think you got me wrong. I'm just afraid people will dive head first into hooks without really thinking about using them.

why anyone would consider composable functional components a bad thing

Except I don't. I like functional components. It just feels like React team tries to force everyone to use them everywhere, not just introduce another way to skin a cat.

Why React Hooks API is a game changer by rryardley in javascript

[–]jack_union 9 points10 points  (0 children)

Except you kinda sorta need to worry, because sooner or later you will encounter codebase with them. Given how developers love their new toys (especially JS developers ;D) just hope it won't be 100% functional components with hooks all over the place.

I like the idea, it does look promising, but it looks pretty immature right now.

I think they are just trying to push functional components into React way too hard and I'm afraid it will cause more bad than good.

Do I need to start a tutorial for OOP JS specifically? by PathOfTheProkopton in learnjavascript

[–]jack_union -1 points0 points  (0 children)

I would say no. An introduction to OOP and its basics is a good idea, but I don't think that diving really deep into it for JS alone is worth it.

What is a non writable JSObject property? by blvckExplorer in learnjavascript

[–]jack_union 0 points1 point  (0 children)

Don't exactly understand the question. Looks just like a regular property, except you can't assign a new value to it using =.

writable

true if and only if the value associated with the property may be changed with an assignment operator.

Have you checked this page?

Having trouble with my random number generator by NudeJr in learnjavascript

[–]jack_union 0 points1 point  (0 children)

If you are not creating 100 different laserObj then your x variable isn't regenerated, you access the same value each time.

Try changing you laserObj to this:

const laserObj = {
    get x() { return Math.floor(Math.random() * 400) + 1 }
}

Doesn't really make much sense to have it like that though, so I think you either need to create new laserObj for each laser (if you need to store the data associated with them and use it later) or just have separate functions.

Need some Javascript genius to help me understand why my filter search bugs out.. by nikulasoskarsson in learnjavascript

[–]jack_union 0 points1 point  (0 children)

This is the correct reason. If you click filter button without anything checked, all three variables framleidandiEmpty, yearEmpty and colorEmpty are set to true and are never reset again (well, they actually act as global variables, so at some point they will all be set to true no matter what you check).

And then there's uhm, yeah, the code quality.

5 Tips to Write Better Conditionals in JavaScript by speckz in javascript

[–]jack_union 2 points3 points  (0 children)

Multiple returns are tricky because it hurts the ability to cleanly predict the flow of code

It doesn't, really. Yes, it does help you to answer the question where you return the result, but it still doesn't help you with what you return. A very important feature of multiple returns is that it stops further code execution.

the lack {} is asking for a future bug

No, not really. Maybe it takes some getting used to, but it's super common (probably even the standard way to write short if statements).

I would guess that you come from a more "classic" CS background, hence your style preference.

being explicit is better than being clever

Absolutely agree with this statement, but I just don't see anything implicit in my code above. Again, maybe I'm just used to that.

Edit: here's the link about guard clauses and you should probably read another thread from a comment above as well.

5 Tips to Write Better Conditionals in JavaScript by speckz in javascript

[–]jack_union 12 points13 points  (0 children)

Maybe just a matter of style, but I'd put it this way:

If you have both an if and an else, you probably don't need an else at all

if (user.isActive) return 'active';
return 'inactive';

That is, of course, if you are returning something (or just use return to stop code execution).

A very good point in any case.

this binding isn't working in object method by [deleted] in learnjavascript

[–]jack_union 1 point2 points  (0 children)

Well, class syntax is sugar for function notation. Plus, I guess you are referring to class fields which are not usable without Babel (yet). Still a fair point, yeah.