4 ms·
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
by kh_hk 3y ago
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>
- meiraleal 3y agoA 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>
- tipiirai 3y agoGlad to hear people still care about separation of concerns! It's been so untrendy. Particularly after Tailwind came around.