-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shortening code? "Minification for humans" code Inventory ~ little code Study / Audit / "Obsessive compulsive reduction of unnecessary chars read by developers" #1634
Comments
just a SideNote / "FAQ"
"Why isn't the '
|
its unreadable, write once code. Two levels deep is already super annoying to read, 3 levels is waste of time figuring out what the last guy did here. |
About human perception, saving developer's time. @raszpl
Still good to mention (first in this Repo!)
Yes, just compulsively applying the title "minification for humans", since the majority of our "IF"'s is short with no grandparent, What about this though ? : Code-Scroll-Height-Reduction:
|
|
Sorry, in case you try to draw a conclusion based on these search terms, to figure out how popular they are: First, underScore is literally the first time I heard or read anyone calling that. Its snake case, generally. And secondly, and most importantly, is nobody googling its favorite case style. People use what is the convention of the language 90% of the time. I prefer snake case and kebab case, cause its easier to read. Peter Seibel, in his book "Coders at Work," interviewed several renowned programmers who emphasized the importance of reading code. Douglas Crockford, for example, stated, "Reading code is much harder than writing it." This sentiment is shared by many experienced developers. An article published by Jeff Atwood, co-founder of Stack Overflow, titled "Code: Readability Counts," discusses the significance of code readability. Atwood argues that code is read by many people throughout its lifecycle, including the original author, colleagues, maintainers, and future developers. Therefore, writing readable code is crucial for effective collaboration and long-term maintainability. The concept of "code reviews" is widely practiced in software development. Code reviews involve developers reading and reviewing each other's code to identify bugs, improve quality, and share knowledge. This process highlights the importance of reading code as a significant part of the development workflow. https://www.goodreads.com/quotes/835238-indeed-the-ratio-of-time-spent-reading-versus-writing-is |
yes! @ShalokShalom a method needs not to be flawless when mentioned 4th in 4 quick associations. to update the first point: prevItem language:JavaScript sais 27.3k results now! Supports the fact that JS is set on camelCase, while all other languages combined prefer snake case.
yes, adding it:
(so snake case became searched as a word later in history, yet might grows a bit faster than camelCase. Yet, to be fair we need to include "camel case" so combining the spellings it is double. While kebab case started even later, so it could also catch up.) And it might be relevant linguistically for us to acknowledge the overall weight of a word, like "underscore". Since most people & developers learn English first. Since part of this project doesn't require much specialization and developers often are learning by doing or as autodidacts. https://trends.google.com/trends/explore?date=today%205-y&q=camelCase%20variables,underscore%20variables,snake%20case%20variables,underscore%20name,pascal%20case And most people didn't chose JS for it's apparent naming convention either but since their was no alternative 🤔 Also camelCase has a problem as URLs and usernames generally ignore case. - Something most people might know and apply since before they start programming, even if subconsciously |
yes! agree for variables names
|
( #1787 (comment) ) |
on css performance:
(from #2073) |
how many lines in the repo match ____ .... ?
94 x addEventListener vs. 45 x removeEventListener (=maybe should be more than 45) 19x stopPropagation 17x preventDefault
584 x function vs. 8 x
=>
200 x return 141 x target 75 x newcounted through:
echo addEventListener | { read this; grep -riIPo "$this" | wc -l | { read count; echo $count x $this;}; }
(grep with--include='*.js'
maybe .. )"efficient" :
VS. "many characters / waste of unintentional perception"
variable declaration can be like a table of contents. Could/Should use a "JS alphabet" of abbreviations like d=document, w=window, (unless Youtube uses any differenly) ....32 x mutation 13 x observe
38 x toggle 38 x change 8 x sync
77 x match 88 x
|
51 x test 24 x regex539 x
:
486x[
61 x array 25 x query[^s]135 x message 73 x input 67 x string
135 x
||
241 x&&
153 x for 99 x?
5 xwhile
21 x console.log
( there could be more console logging, despite it is slow, without removing it when building
log = (x) => true;
//uncomment for more logging:
//log = (x) => console.log(x); )
6406 x
.
3577 x(
3377 x=
2730 x;
1764 x{
1474 x,
971 x play (+ 2889x in .json) ( 707 x player )
613 x improvedtube
948 x satus
417 x component 697 x element
679 x window 303 x document
445 x event
380 x storage
294 x video 288 x animation
267 x skeleton 176 x option
238 x http 200 x href
225 x browser 101 x chrome 94 x web
274 x parent 250 x child 221 x node 309 x value 170 x text 167 x type
196 x title 174 x style 157 x color 120 x date
CSS: 1142 x
,
966 x=
735 xit-
628 x[
3763 x
:
3420 x;
...and 114 x
querySelector(
42 xremove(|removeAttribue(
(can/should these be reduced?)JSON language files: 1263656
characters
, 41230 x:
41187 x"
20594 x{
20877 x,
the most covenient text-format for translators will be? :
#
englishMessagetranslation
#
englishMessagetranslation
#
englishMessage(sorted by 1. untranslated 2. recent. So that it will be fastest to translation & translation tools will stay unnecessary.)
~149
IF
's stand alone,~373
IF
's have a parent & no child~226
IF
's have a grandparent & no child,~105
IF
's have a greatgrandparent & no child~57
IF
's have a greatgreatgrandparent & no child( the nested code was counted quickly as:
761 x 2nd level
if (
inside anotherif (
before any}
388 x
if (
inside anotherif (
before any}
inside anotherif (
still before any}
162 x "
if (
inside anotherif (
before any}
"³57 x "
if (
inside anotherif (
before any}
"⁴)
The text was updated successfully, but these errors were encountered: