Hacker News new | past | comments | ask | show | jobs | submit login

Not sure what you mean. Can you provide some sample code so I can undesrstand the issue / use-case?



Not sure why but separation of concers was hammered so hard for a while that I cannot accept any inlined javascript or css at all. For me the reason is clear, I do not need to scan the html to know what a particular piece of code is doing and will just assume these ids are somewhere out there.

The first example of the site would become:

    <div>
      <h2>You clicked {count} times!</h2>
      <button id='decrement'>Decrement</button>
      <button id='increment'>Increment</button>

      <script>
        count = 0
        $('button#increment').on('click', () => { count++ })
        $('button#decrement').on('click', () => { count-- })
      </script>
    </div>


Glad to hear people still care about separation of concerns! It's been so untrendy. Particularly after Tailwind came around.


A bit more magic to need a new framework:

  <div>
    <h2>You clicked {count} times!</h2>
    <button id='decrement'>Decrement</button>
    <button id='increment'>Increment</button>
  </div>
  <script>
    count = 0
    increment.click(() => { count++ })
    decrement.click(() => { count-- })
  </script>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: