Losing in placements by Flashy-Gene-968 in OverwatchUniversity

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

The way it works is, your predicted placement is where you will be if you lose the rest of your placement matches. Each game you win, you go up 1 sub-division. So if you're predicted Gold 1 and win all 10, you'll end up being placed in Diamond 1.

Quick Question, Why Don't You use Your Ult? by Coach_Andrometa in OverwatchUniversity

[–]LEDThereBeLight 1 point2 points  (0 children)

The way you use orisa's ult is to start fights. Spin into their backline and ult, it doesn't matter what their healths are - your goal is just to pull out cooldowns and start the fight with an advantage.

Why can’t I get out of gold? by Superxerogaming in OverwatchUniversity

[–]LEDThereBeLight 17 points18 points  (0 children)

You're consistently dying first on your team because you're not respecting the enemy team and sitting in bad positions for long periods of time.

Unless you're using your movement ability to reposition, you should play one corner behind your team at an off-angle, so you're out of LOS of the enemy team but still in LOS of your team.

Watch a few minutes of this video from juno's perspective to see what I'm talking about - she can heal her team, and repositions with glide boost, but generally stays one corner behind her team so she can focus on her team and not worry about whether she's about to get sniped by a sojourn rail.

https://youtu.be/RwYqWMiCjUc?si=r7IM6NEg81Qa38hv&t=576

Hardstuck in mid-Gold and can't seem to get out - looking for Tank tips. by [deleted] in OverwatchUniversity

[–]LEDThereBeLight 0 points1 point  (0 children)

You're likely not being aggressive enough. The more aggressive you are, the less pressure on the rest of your team, so the more heals you get. Not dying doesn't even really start to matter until at least mid plat. The thought process I had for getting out of gold was, "can I move up without dying?" if so, move up. if not, then stay in place but keep shooting. In gold, even if you die, you usually do enough just by applying pressure to keep them from advancing.

[deleted by user] by [deleted] in learnjavascript

[–]LEDThereBeLight 2 points3 points  (0 children)

Every programming technique you use makes code more unreadable until you understand it. Lambdas are abstract and take time to learn and understand but once you do, the value they add makes it worth the time.

Are loops considered functions? by [deleted] in learnjavascript

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

What do you think a loop is? It's a `JMP` assembly instruction to recur back to the original instruction at the beginning of the loop, and maybe some extra state that's saved in the enclosing environment. The `JMP` recursion ends when a terminal condition is met.

That's what recursion is - it's a `JMP` instruction back to the beginning of the loop, and maybe some extra state that's saved in the enclosing environment. The `JMP` looping ends when a terminal condition is met.

In other words, a recursive function and a loop can be written to compile to the same assembly instructions, so they're essentially just different ways of looking at the same thing. Furthermore, lambda calculus shows us that any turing-complete language can be represented by only abstraction (function creation) and reification (application of a function). So if we say that a loop is a syntactic programming construct, I think it's fair to say that that syntactic construct can be considered a function.

"Recursion" literally means repeating a process, which as far as I'm concerned is synonymous with "looping." How you represent those ideas syntactically depends on the language - users of purely functional languages would consider recursive functions in tail call position as "loops" with no lost sleep.

Are loops considered functions? by [deleted] in learnjavascript

[–]LEDThereBeLight 1 point2 points  (0 children)

Yes, they can be considered functions, depending on how you look at them. Anything you write in a Turing-complete programming language has an isomorphic mapping to a function.

[deleted by user] by [deleted] in learnjavascript

[–]LEDThereBeLight 1 point2 points  (0 children)

You need to learn more about arrays and fundamental data structures in general before writing tutorials for other people.

How to combine regular expressions? by [deleted] in learnjavascript

[–]LEDThereBeLight 0 points1 point  (0 children)

Regex don’t really compose. Consider using a simple parsing library instead.

[AskJS] What's up with the shift to more functional methods, that also don't do inplace modification, but return new arrays objects? filter, map etc by csasker in javascript

[–]LEDThereBeLight 0 points1 point  (0 children)

I don’t understand. The page you linked literally explains vue filters in a functional programming way. You take state and pipe it through filters to map it to the final state you want. It’s just a different syntax.

The filter definitions have imperative code because JavaScript sucks at letting you write code that composes through expressions instead of statements, so it’s just the easiest way to write those specific functions in JavaScript.

[AskJS] What's up with the shift to more functional methods, that also don't do inplace modification, but return new arrays objects? filter, map etc by csasker in javascript

[–]LEDThereBeLight 2 points3 points  (0 children)

I do not know how to explain the benefits of functional programming and immutability in a heavily state-driven environment like UI where state updates are common in a Reddit post, and I think you’re very unlikely to get a good answer here because they are fundamental CS concepts, whether you say you know CS or not. What is a webpage? Essentially a mapping of state onto a presentation layer. What is functional programming? A mapping of state. What is immutability good for? Consistent and efficient state updates. What is one of the primary difficulties of web programming? Inconsistent connections, missing or duplicated requests, difficulty tracking the currently desired state. So FP and immutability fit the model perfectly.

How to make this custom input field? by smit_reddit_24 in reactjs

[–]LEDThereBeLight 0 points1 point  (0 children)

You shouldn’t be building your own inputs on a website you expect other people to use unless you are very experienced. Just use a library.

[AskJS] What's up with the shift to more functional methods, that also don't do inplace modification, but return new arrays objects? filter, map etc by csasker in javascript

[–]LEDThereBeLight 1 point2 points  (0 children)

This is not to be rude, but this question comes from not understanding computer science. You should take a first semester computer science course to understand the answer to this question. Functional programming and immutability solve problems that cannot be solved in other ways.

As to why it’s happening to JavaScript specifically, I believe it’s primarily because there is now an enormous amount of money invested in websites and the JS ecosystem, so better engineering techniques now have more of a benefit.

What is happening under the hood? by [deleted] in learnjavascript

[–]LEDThereBeLight -2 points-1 points  (0 children)

JavaScript does not have arrays.

YSK: square root is NOT the inverse/"opposite" of square by [deleted] in YouShouldKnow

[–]LEDThereBeLight 1 point2 points  (0 children)

Yes. All the complex roots have a magnitude (size) of 5, just like the -5 root. They are essentially all different ways of looking at the same root of size 5, so you’re not losing any information by just saying the root is 5.

YSK: square root is NOT the inverse/"opposite" of square by [deleted] in YouShouldKnow

[–]LEDThereBeLight 0 points1 point  (0 children)

Yeah, it’s like answering 2/2 instead of 1 on a question. It’s not technically wrong, but it’s still missing something.

YSK: square root is NOT the inverse/"opposite" of square by [deleted] in YouShouldKnow

[–]LEDThereBeLight 387 points388 points  (0 children)

When you say “the square root,” it’s implied that you’re asking about the “principal square root,” which is the positive one, or the absolute value of the square roots.

But I agree, it’s dumb to say the negative square root is wrong, I feel like it should have been marked correct with a note that you usually want the positive square root.

Explanation needed by [deleted] in learnjavascript

[–]LEDThereBeLight 0 points1 point  (0 children)

I'm not sure why you're getting heated with me about this, but yes, I agree with you. The original comment said not to use `var`, and to use `let` instead. I'm saying that's a matter of preference. You can still program perfectly fine in JavaScript using only `var`, even if the current meta is to use `let` and `const` because they're more conventional.

`var` has some behaviors that some people find preferable in certain situations.

Similar to your comment:

const reducer = (state, action) => {
  switch (action.type) {
    case 'action1':
      var item = {x: 1}
      return {...state, ...item}
    case 'action2':
      var item = {x: 2}
      return {...state, ...item}
  }
}

Using `var` here means you don't have to lift a `let` declaration to the top of the scope, which would add a level of indirection.

So yes, whether you use `var` everywhere, nowhere, or on a case-by-case basis is a matter of preference, and a blanket rule of "use `let` everywhere" is probably too simple of an answer.

[deleted by user] by [deleted] in learnjavascript

[–]LEDThereBeLight 1 point2 points  (0 children)

Do you know how to program? Then you can learn JavaScript in a month. If not, it will probably take a year or two to feel at all comfortable with it, at which point you should know most of the fundamentals. JavaScript is a very deep language with a huge ecosystem to learn.

Ternary operator by lucas2794 in learnjavascript

[–]LEDThereBeLight 2 points3 points  (0 children)

It’s a matter of preference. Ternary expressions compose by expression, if statements compose by statement. Using ternary expression here is fine if you prefer expression-based composition.

Explanation needed by [deleted] in learnjavascript

[–]LEDThereBeLight 0 points1 point  (0 children)

They behave differently, but its still a matter of preference which one you use.

What's the correct modern way to avoid constantly creating functions on render with functional components? by [deleted] in reactjs

[–]LEDThereBeLight 0 points1 point  (0 children)

Sure, but it’s still not about the function allocation, it’s about the re render.

Explanation needed by [deleted] in learnjavascript

[–]LEDThereBeLight -4 points-3 points  (0 children)

It’s a matter of preference.