Readit News logoReadit News
iyc_ commented on Many hard LeetCode problems are easy constraint problems   buttondown.com/hillelwayn... · Posted by u/mpweiher
samiv · 5 months ago
The LC interviews are like testing people how fast they can run 100m after practice, while the real job is a slow arduous never ending jog with multiple detours and stops along the way.

But yeah that's the game you have to play now if you want the top $$$ at one of the SMEGMA companies.

I wrote (for example) my 2D game engine from scratch (3rd party libs excluded)

https://github.com/ensisoft/detonator

but would not be able to pass a LC type interview that requires multiple LC hard solutions and a couple of backflips on top. But that's fine, I've accepted that.

iyc_ · 5 months ago
Mistakenly read this as you wrote that 2D game engine (which looks awesome btw) for a job interview to get the job: "I can't compete with this!!! HOW CAN I COMPETE WITH THESE TYPES OF SUBMISSIONS!?!?! OH GAWD!!!"
iyc_ commented on Building my first mechanical keyboard   not-matthias.github.io/po... · Posted by u/not-matthias
colordrops · 4 years ago
Great intro. One thing I don't understand about the mechanical keyboard community is how the vast majority (like well over 95%) are not split keyboards. You'd think keyboard enthusiasts that sweat the details would also be obsessed with ergonomics. But no, I suspect that they are more concerned with aesthetics, which are arguably worse with a split keyboard.
iyc_ · 4 years ago
That, and the missing meta/hyper key either on the left hand side of the spacebar, or close to the thumbs.
iyc_ commented on Solid.js feels like what I always wanted React to be   typeofnan.dev/solid-js-fe... · Posted by u/jamghee
lpghatguy · 4 years ago
New JS frameworks always make for compelling hello world examples.

Can you branch on state or use loops over data in Solid.js? The reason _why_ React has a virtual DOM is to enable more interesting relationships between your data and your presentation. Anyone can make a framework that makes the source code for an incrementing number look pretty!

As an example of this point, check out the "Simple Todos" example for Solid.js[1].

In React, we render lists by using regular JavaScript idioms like loops, arrays, and array methods like map. However in Solid.js, much like traditional templating languages, we get a construct like <For> that reinvents a concept that's already in the language.

I've been writing React and React-alike code for a long time. I think that fine-grained updates avoiding reconciliation are a good idea, especially for performance. At one point, I built a React-like library for Roblox and Lua whose most novel feature ended up being "Bindings"[2], which look sorta like Solid.js state containers. They create little hot-path data dependencies, but the bulk of your components still use normal React-like rendering.

  [1]: https://www.solidjs.com/examples/todos
  [2]: https://roblox.github.io/roact/advanced/bindings-and-refs/

iyc_ · 4 years ago
> In React, we render lists by using regular JavaScript idioms like loops, arrays, and array methods like map. However in Solid.js, much like traditional templating languages, we get a construct like <For> that reinvents a concept that's already in the language.

I had/have your bias, but from playing with it I found a couple things:

1) Like React, you can swap out the template feature for a function call (or subcomponent). e.g. instead of

  return (
    <button...>
    ... 
    </button>
    <For each={state.todos}>
    ... 
  );
you can use functions and loops:

  function displayTODOs<T>(todos: T[]): any {
    let arr: any[] = [];
    for(let [i, todo] of todos.entries()) {
      const { done, title } = todo;
      let elem = (/\* JSX \*/);
      arr.push(elem);

    }
    return arr;
  }
  ... 
  return (
    <button ...>
    </button>
    {displayTODOs(state.todos)}   
  );
2) Even with my bias, I must admit I found the `<For...` syntax to be surprisingly easy to read and fast to eye-parse; much more so than other 'templating' (using your term) languages/macros/syntax I've used over the years.

u/iyc_

KarmaCake day4September 4, 2021View Original