<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged getting-started</title>
<link>https://ask.clojure.org/index.php/tag/getting-started</link>
<description></description>
<item>
<title>Can we add metaphors/analogies for functional closures in Clojure to the docs please?</title>
<link>https://ask.clojure.org/index.php/14472/metaphors-analogies-functional-closures-clojure-docs-please</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
Having been a longtime happy and satisfied user of Clojure I realized that there is very little to introduce someone new to Clojure to &lt;strong&gt;closures&lt;/strong&gt;  where functions [like vehicles] are passed in with opaqueness to their variables [like passengers] to another function.  I think this is probably a stumbling block for many beginners and might even, unfortunately, discourage people from adopting the language without further explanation of this caveat.  I think many programmers will also disagree with my assessment because they have &quot;closure eyes&quot; and can transparently understand passing functions around as first-class-citizens so-to-speak.  &lt;/p&gt;
&lt;p&gt;I propose that we amend the documentation to explicitly mention that closures are basically like vehicles or cars with passengers.  &lt;/p&gt;
&lt;p&gt;&lt;code&gt;the fact that not everything is transparent to the top level function call is something non-obvious &lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre&gt;&lt;code&gt;(defn make-adder [x]
 (fn [y] (+ x y)))

(def add5 (make-adder 5))
 (add5 10) ;; Returns 15
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example:&lt;/p&gt;
&lt;p&gt;make-adder is like a vehicle factory. When you call it with 5, it creates a new vehicle.&lt;br&gt;
This new vehicle (the returned function) has a permanent passenger: the value 5 is sitting in the x seat.&lt;/p&gt;
&lt;p&gt;There's one empty seat (y) that you can fill when you drive the vehicle (call the function).&lt;/p&gt;
&lt;p&gt;When you call (add5 10), you're putting 10 in the y seat and driving the vehicle.&lt;/p&gt;
&lt;p&gt;Inside, the passengers interact: x (which is 5) and y (which is 10) are added together.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;How REPLs and Closures Intertwine&lt;br&gt;
The REPL (Read-Eval-Print-Loop) and closures interact in interesting ways:&lt;/p&gt;
&lt;p&gt;Creation and Persistence:&lt;br&gt;
When you define (def add5 (make-adder 5)) in the REPL, you're parking a vehicle (with 5 already inside) in your garage with the name &quot;add5&quot;. This vehicle persists between REPL evaluations.&lt;br&gt;
Inspection Limitations:&lt;br&gt;
In the REPL, you can see that add5 is a function, but you can't directly inspect who's sitting inside it. If you evaluate add5, you'll just see something like &lt;code&gt;#function[user/make-adder/fn--123].&lt;/code&gt;&lt;br&gt;
Usage in REPL:&lt;br&gt;
You can use the closure by calling it: (add5 10). The REPL will evaluate this by driving the vehicle with 10 in the y seat, and print the result (15).&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14472/metaphors-analogies-functional-closures-clojure-docs-please</guid>
<pubDate>Thu, 20 Mar 2025 14:13:58 +0000</pubDate>
</item>
<item>
<title>Feature Request for Clojure CLI: Treat empty deps.edn the same way as a non-existing one</title>
<link>https://ask.clojure.org/index.php/12572/feature-request-clojure-treat-empty-deps-same-non-existing</link>
<description>&lt;p&gt;When &lt;code&gt;clojure&lt;/code&gt; is called from a directory with an empty &lt;code&gt;deps.edn&lt;/code&gt; it exits with a non-zero value. I wonder if it could be considered to treat that situation the same as when there is no deps.edn file at all?&lt;/p&gt;
&lt;p&gt;This would be improve the Calva Ux a great deal. Calva defaults to start clojure-lsp at activation. One  activation trigger is that a Clojure file is opened. Creating a deps.edn file in VS Code will create it as an empty file which the user then can edit. When clojure-lsp starts because of the file creation, clojure is called by clojure-lsp to figure out the classpath. If the file is still empty by then, the command fails, and no clojure-lsp for the user in that session.&lt;/p&gt;
&lt;p&gt;It gets extra important for beginners with Clojure, who we want to instruct how to create a minimal deps.edn project and use a Clojure editor to connect to the REPL. As it is now the instructions get complicated.&lt;/p&gt;
</description>
<category>Clojure CLI</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12572/feature-request-clojure-treat-empty-deps-same-non-existing</guid>
<pubDate>Thu, 19 Jan 2023 21:48:27 +0000</pubDate>
</item>
<item>
<title>How hard is it to learn Clojure?</title>
<link>https://ask.clojure.org/index.php/12340/how-hard-is-it-to-learn-clojure</link>
<description>&lt;p&gt;It had been a couple of weeks since I've started learning Clojure.&lt;/p&gt;
&lt;p&gt;I am a newbie at programming and I passed some basic courses &lt;a rel=&quot;nofollow&quot; href=&quot;https://skillcombo.com/topic/java/&quot;&gt;here&lt;/a&gt; about Java. I just wanted to know how long it will take for me to learn Clojure and if is it difficult for beginners. Also, you can recommend your favourite resources and roadmaps.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
</description>
<category>Spec</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12340/how-hard-is-it-to-learn-clojure</guid>
<pubDate>Fri, 28 Oct 2022 23:28:38 +0000</pubDate>
</item>
<item>
<title>How can we make it easier for beginners to install Clojure?</title>
<link>https://ask.clojure.org/index.php/11767/how-can-we-make-it-easier-for-beginners-to-install-clojure</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/guides/getting_started&quot;&gt;The official Getting Started guide&lt;/a&gt; shows how to install Clojure and its dependencies for macOS, Linux, and Windows, using command-line tools.&lt;/p&gt;
&lt;p&gt;Those procedures work well for experienced programmers who are comfortable figuring things out. However, when it comes to lowering the barrier to entry for beginners, this is less than ideal and leads to a poor first impression.&lt;/p&gt;
&lt;p&gt;I use the guide mentioned above in my &quot;Getting Started with Clojure&quot; workshops, geared towards beginners with little to no prior experience with Clojure or programming in general. And I see first-hand how people struggle to get Clojure installed and working correctly on their system, especially Windows users.&lt;/p&gt;
&lt;p&gt;Allowing users to install Clojure and all dependencies in a single step would make it easier for people to install Clojure and dramatically improve the user experience for newbies, which is essential for increased exposure and adoption.&lt;/p&gt;
&lt;p&gt;To that end, I want to propose official &quot;download and double-click installers&quot; for all operating systems. For inspiration, check out the installers offered by other languages like &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.python.org/downloads/&quot;&gt;Python&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; href=&quot;https://go.dev/doc/install&quot;&gt;Go&lt;/a&gt;. &quot;Just download this installer and run it. That's it.&quot;&lt;/p&gt;
&lt;p&gt;Also, Scala has &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.scala-lang.org/download/&quot;&gt;an excellent landing page&lt;/a&gt; with two options to guide beginners and advanced users to different installation guides. Beginners are encouraged to try Scala in the browser without installing anything on their computer. For Clojure, we could guide beginners to something like &lt;a rel=&quot;nofollow&quot; href=&quot;https://calva.io/get-started-with-clojure/&quot;&gt;Calva&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.maria.cloud&quot;&gt;Maria&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In summary: We could draw inspiration from other programming language ecosystems to create a smoother installation experience for beginners. After discovery, the newbie experience begins with the installation process.&lt;/p&gt;
&lt;p&gt;Note that there is &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C0353589RFC/p1649837679043339&quot;&gt;a relevant discussion ongoing in the Clojurians Slack&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11767/how-can-we-make-it-easier-for-beginners-to-install-clojure</guid>
<pubDate>Wed, 13 Apr 2022 08:09:09 +0000</pubDate>
</item>
</channel>
</rss>