News for hackers. Stuff that matters.
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav... by kissgyorgy on Monday July 19, 2021 @02:48PM (#27886010)
The aesthetics of a programming language or framework are pretty important IMO, that's one of the reasons Python is my favorit language. This has a lot more punctuation, weird characters (underscore, seriously?), parenthesis and brackets than I ever willing to write or look at. In other words; it's very ugly.
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav... by wwweston on Monday July 19, 2021 @03:17PM (#27886279)
I also don't like underscores much, but this is JS, so shouldn't `window.identifierOfYourChoice = _` alias it without much ado?
Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav... by dumindaxsb on Tuesday July 20, 2021 @03:50AM (#27891022)
I understand.

I picked it mainly for 3 reasons. In my opinion,

1. _ kind of hide itself & give more prominence to the rest of the code (logic) 2. If we pick a long name like CalDOM, it becomes a PITA when it repeats so many times. 3. Not to be conflicted with jQuery by using $

To avoid conflicts, CalDOM provides an official workaround to define the alias before loading: https://caldom.org/docs/#_cal_dom_alias

Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav... by dumindaxsb on Tuesday July 20, 2021 @03:42AM (#27890989)
I understand. Thank you for the feedback.

If you don't like the underscore, there's an official way to alias it: https://caldom.org/docs/#_cal_dom_alias

I actually forgot to mention this in the documentation, your feedback prompted me to do so.

Rest is just the nature of JavaScript my friend. I hear you on Python.

Re:Show HN: CalDOM: An agnostic, reactive and minimalist Jav... by tsujp on Tuesday July 20, 2021 @01:22AM (#27890345)
Is your aversion to an underscore more about a variable identified by that or its presence at all?

For the latter Python encourages slug_case_naming_schemes and _ is a valid identifier in Python too. So there's nothing going on here beyond normal Javascript syntax which can be closure heavy -- a main feature of Javascript.