Names in programming #1878
NikosAlexandris
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reading #1868 made me flashback to the https://online.rice.edu/courses/computer-fundamentals courses I completed years ago. While working on numerous small programs and tests, during the courses, appropriate naming of program functions was a must-do, explained and supported with real-world examples of bad naming practices that ultimately lead to programs that were not understandable/consistent.
I was curious to see what Donald E. Knuth writes about names in his ever ongoing book The Art of Computer Programming [1]. Two relevant references in The MMIX supplement : supplement to The art of computer programming [2]:
I think these words are more than relevant in practising good naming conventions in programming and thus, by doing so, be open, friendly, inviting and educative for everyone.
This second reference is clear and unambiguous. I guess there is nothing wrong with short names for functions and parameters. Yet they should be names, full names. Half-spelled words are not full names. How does one ensure that a composition of 2 or 3 half spelled words, that indeed may make sense to a single programmer, are serving the public? Considering that the biggest time in programming is spent in actually reading code, programmers should indeed take appropriate, meaningful, easy-to-read names in programming seriously and be more respectful to the public reader (the student, the scripter, the curious, the new coming core developer). Even more so in an open source project, part of whose development model is exactly public access to its source.
References
[1] Contributors to Wikimedia projects. "The Art of Computer Programming - Wikipedia." 15 Sept. 2021, en.wikipedia.org/w/index.php?title=The_Art_of_Computer_Programming&oldid=1044441966.
[2] Ruckert, Martin, and Donald E. Knuth. The MMIX supplement : supplement to The art of computer programming volumes 1, 2, 3 by Donald E. Knuth. Upper Saddle River, NJ: Addison-Wesley, 2015.
Beta Was this translation helpful? Give feedback.
All reactions