News for hackers. Stuff that matters.
Re:The Svelte Compiler Handbook by smnplk on Monday April 06, 2020 @12:03AM (#22790818)
That's why god invented comment blocks. But some people view them as code smell, which i find very strange. And no, good naming is not always enough.
Re:The Svelte Compiler Handbook by IshKebab on Wednesday April 08, 2020 @04:07AM (#22810961)
So you're saying it's a good idea to write what your types are in your code, but rather than writing them in a form that can be automatically checked by a computer and used for code completion and refactoring, you prefer to write them in a comment?
Re:The Svelte Compiler Handbook by smnplk on Monday April 13, 2020 @01:00PM (#22857578)
No, I said no such thing. If you happen to be in a dynamic environment, then yes, I see no foul in describing inputs to a function inside a comment above function declaration. Use comments to describe your intents on non trivial parts of your code. There is no amount of code readability that will help your colleague, if she doesn't understand your thought process at the time of writing the code.
Re:The Svelte Compiler Handbook by michaelcampbell on Friday April 10, 2020 @09:23AM (#22832725)
"not always enough" is still better than "none". This feels like a classic "good being the enemy of the perfect" issue.