12/13/2023 0 Comments Lighttable clojurescript node.jsUsually, I would end up on some StackOverflow thread that I had already visited numerous times and copying and pasting the example into yet another “utils” file in yet another project. ![]() I cannot count the times that I have had a simple task that I wanted to accomplish with JavaScript - say, performing a deep clone of an object - but had to do a Google search to remember how to do it either using vanilla JavaScript or the libraries that I had available. The terseness of a high-level language like ClojureScript means that there are fewer places for bugs to hide, and in turn, we can spend more time making forward progress. The developer who would rather spend her time fixing bugs than writing new features is either a rarity or nonexistent. Second, fewer lines of code means fewer bugs. Even though more time is usually spent designing and planning code than actually writing it, we do not want to be hampered by how many keystrokes it takes to turn our ideas into code. First, it almost goes without saying that it is quicker to write a little code than it is a lot of code. ![]() ![]() When we write less code to accomplish a given task, there are a couple of benefits. All of these factors can enable huge productivity boosts, both in the initial development and maintenance phases of an application. Third, it frees us to think more about the problems of the domain rather than technical implementation issues. Second, it causes the structure of the code more closely resemble the problem domain, making it clearer for us to understand when we come back to it. First, it takes less code to accomplish a given task, which helps with both initial development and debugging/maintenance. When we work at a higher level, a couple of interesting things happen. The journey from lower-level concepts to higher-level ones is the way that we gain productivity.įeatures defining each level of abstraction In ClojureScript, we work with expressions, collections, sequences, and transformations. In JavaScript, we work largely with variables, loops, conditional branching structures, objects and arrays. Higher Level LanguageĬlojureScript operates with higher-level constructs than JavaScript. I will follow the general pattern of the Clojure community of using the two terms interchangeably when talking about the language itself and using “ClojureScript” when discussing the ecosystem or language features that are specific to ClojureScript. Some of the potential confusion comes from the fact that “Clojure” refers to both the language and its Java implementation. Clojure as a language has implementations that compile to both Java bytecode and to JavaScript. You may have noticed several times where I have used the terms “Clojure” and “ClojureScript” interchangeably. Still, can we get a similar advantage from JavaScript itself without having to learn a new language? Also, does ClojureScript really give us that much additional leverage in our daily development tasks? ClojureScript may not be the best tool for trivial tasks, but for anything more complex, JavaScript does in fact need a language like Clojure to enable more productive and enjoyable development. Having seen ClojureScript’s sweet spots, it should be apparent that there are some gains that it promises.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |