Preferences

iyc_
Joined 4 karma

  1. 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!!!"
  2. That, and the missing meta/hyper key either on the left hand side of the spacebar, or close to the thumbs.
  3. > 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.

This user hasn’t submitted anything.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal