|
|
|
|
|
by derekp7
454 days ago
|
|
Using myself as an example -- I'm a long time C programmer (occasionally in a professional setting, mostly personal or as a side-item on my primary professional duties). I've picked up other languages through the years, had to deliver a web based application a few years ago so I did a deep-dive into html5, css3, and javascript. Now javascript has evolved since then, and I lost a bit of what I learned. So now I want to do a new web application -- If I fall back on my C roots, my Javascript looks a lot like C. Example: adding an item to an array. The C style in Javascript would be to track the length of the array in another variable "len", and do something like myarray[len++] = new_value; I can feed this into an LLM, or even say "Give me the syntax to add a value to an array", and it gives me "myArray.push(newValue)", which reminds me that "Oh yeah, I'm dealing with a functional/object oriented language, I can do stuff like this". And it reminds me that camelCase is preferred in Javascript. (of course, this isn't the real situation I've run into, just a simplified example -- but I really don't have all the method names memorized for each data type. So in that manner it is useful to get more concise (and proper) code. |
|
I've worked professionally in many languages like Perl, Python, Kotlin, C# and dabbled in Common Lisp, Prolog, Clojure, and other exotics one. Whenever I forgot the exact syntax (like the loop DSL in CL), I know that there is a specific page in the docs that details all of these information. So just a quick keyword in a search engine and I will find it.
So when I come back in a language I haven't used in a while, I've got a few browser tabs opened. But that only lasts for a few days until I get back in the grove.
So for your specific example, my primary choice would have been the IDE autocompletion, then the MDN documentation for the array type. Barring that, I would have some books on the language opened (if it were some language that I'm learning).