Beginner's advice, Is Clojure the right place to start/Continue the programming journey?

What you get if you use a published book from a good publisher is an educational tool that has been chosen by editors as worth publishing, where the editors, authors, and internal reviewers have worked together to refine the original work of the authors into better educational tool. In addition, a good publisher will take care to produce a work whose formatting is good for its purposes. Finally, the fact that the authors and publishers make a bit of profit provides additional motivation to them to produce a product that readers will find helpful. (And if they do a good job, they deserve to get paid if the pricing is reasonable.) That doesn’t mean the result of the publishing process is ever perfect, and there are of course some completely free works that don’t come from a publishing house that are also good. However, I feel that the process that produces a published book is more reliable, on average. (This isn’t true for all publishers. I don’t consider Packt a reliable publisher, for example, although I think that some of their books are useful. They have a very low-budget editorial process, afaics.)

The process of curating and refining takes time, so there will always be a time lag given that languages and libraries are changing. Even a book that was just published will be a little bit out of date if there have been recent releases of the language or libraries discussed in the book.

So there’s a tradeoff. The more up-to-date you want your learning resource to be, the fewer options you have. The more you want to be able to trust that you are getting an effective learning resource, the more you may have to put up with out of date bits here and there.

When I’m starting out learning something, I usually like to find a good learning resource–a good published book, usually–and then I supplement it with whatever stuff I can find on the web that will update what’s in the book. On the other hand, if what I want to learn is something that is close to what I already know well, I might just go for whatever I can find on the web. This all comes down to personal choice, though, and cost can play a role.

I’m not sure I understand the question here. You mean you only found examples for complicated things, like using graphQL, ClojureScript, Angular, Vue, etc. ? And you want simpler examples?

Hi,
What I meant that is easier to follow along a video tutorial and other languages have more tutorials, even using newer technologies like Graphql, Next.js, SSR with Clojure with angular or react, etc…

I’m making no promise, since I’m pretty busy. But if you send me an example free video for another programming language, if I ever have some free time, maybe I could see if I can reproduce a similar one for Clojure.

1 Like

That would be amazing, and I would like to help, edit, master the audio and publish on youtube, so we can demonstrate the benefits of using Clojure.

The websites are Pluralsight, Lynda, Udemy.

If you go on youtube, there are several examples on Java, Spring, C# .Net Core, Node.js, Go, etc…

My main goal would be creating a simple web site with some features like blog, adm part, contact form, gallery, shopping cart, security, SEO, Server side rendering.

Using React, Postgresql or Mysql, Graphql, Next.js.

I know it’s a lot of work…

1 Like

Hi everybody,

I read something today here on the forum that made me happy and I would like to understand more about it. I already send a message to the person who posted.

I would like to understand more about this and I read something like that about Clojure as well.
Like so, for some reason you don’t to spend as much time learning Clojure as other languages because it is small, simple and as powerful??

Specially this part:

[quote]
I found myself constantly struggling to compose functionality around those, stuff that struck me as very trivial with a plain request map from Ring. From that point on, I discovered that there wasn’t actually much to learn to get from Clojure beginner to intermediate – there were years and years to unlearn . After getting basically all of the PHP world stuff “out of my system” I could start to learn new/higher concepts that weren’t even on my radar before (SCIP etc.).[/quote]

In another words, Clojure with Ring, Composure offered the same features as Laravel, I meant all the features, am I right to conclude that?

Thanks.

Hey @ecsmix, a few points:

  • First off, there’s no true equivalent for Laravel, Rails, Spring, … (you can use Spring via Java from Clojure, of course, but I’d recommend staying away from it). There are many reasons for this, and lots of discussions have been had about (web) frameworks in Clojure. I suppose a simple summary would be that a server/server application in Clojure is much more akin to a JavaScript Express app than any other traditional MVC framework, you pick your own stack of libraries and retain flexibility (but you have to deal with added complexity)
  • I used Ring as an example for the kind of “unlearning” one can expect to do when going the route I went . It is in no way anywhere close to the feature set of a full web framework, since it’s just a layer of indirection over HTTP, but there is overlap. Modern PHP frameworks bring in a lot of code and classes for managing and interacting with HTTP requests/responses, their parameters and all the parsing and coercing that’s particular to HTTP requests. Back when I was doing PHP, there was a lot of churn in this area, and I had to learn all those pesky “fluent APIs” to build up or query objects (see https://www.php-fig.org/psr/psr-7, and compare with Ring’s way of simply giving you a hash map because you already have Clojure)
  • Time-wise, it’s a little more nuanced, and very much depends on where you’re coming from, and where you’re going to. I probably didn’t express this properly in the comment you quoted, too. Personally, I took a long, long time getting productive in Clojure (I could only learn it in my free time, I had a strong OO/imperative background and opinions, learning resources weren’t as good as they’re now, I chose to learn Clojure, the JVM, ClojureScript, and Emacs all at once, which was idiotic), but that isn’t representative of anything. I’ve been reading and hearing a lot lately about new Clojure developers getting ready for production in timespans of three months or so, which should be perfectly possible with some guidance and the material and tools available today
  • As to “framework features”, or what you’ll be able to achieve, the story is different from traditional frameworks as well. After having written backends in both PHP and Clojure, it’s my professional opinion that you’ll have to be an intermediate to advanced Clojure developer to be able to fully replicate e.g. Laravel’s functionality/features with your own choice of libraries. That being said, even as a beginner in Clojure the work is much more “sane”, with extremely transparent feedback loops due to the REPL workflow, and the better you get, the more you can leverage the power and flexibility of the ecosystem.
  • There are, however, close matches for “framework” in the Clojure ecosystem. Luminus, Coast and Duct, I think have been mentioned all over the place, and are amazing projects to get started with. Those take a lot of boilerplate out of your hand (which is a big part of any framework, anyway) and make it easy/easier to accomplish common web application related tasks, but they come at the price of making a lot of choices for you without you necessarily knowing why, or how they really work. Managing glue/boilerplate code, alas, is mostly on you, although modular approaches to application architecture help (see Duct’s way of going about it).

In the end, the choice is yours. There’s no forbidden route (pun intended), and depending on where you want to be next year, or in 5 years, a lot to consider.

For example, if you want to get started writing backends in Clojure, with the possibility of “full stack” with ClojureScript later, picking a leiningen template like Luminus and working to understand it is probably your best bet.

Or, if you’re only really interested in frontend development, have some experience with other languages/frameworks, and would like to develop a single page application with ClojureScript, just spin up a Laravel/Express/whatever-you’re-familiar-with backend and use shadow-cljs in a standalone project to develop the client.

I hope this clears up my comment a bit. All of this very much pertains to the web, for any other kind of development using Clojure/Script (or even the .NET version), like ML/AI, graphics, games, desktop/mobile, and so on (all of which are possible with Clojure, but not really with PHP or something), I’m not the person to ask. I’m sure if you elaborate on where you are now, and where you want to be eventually, the community here and on Slack can make more concrete suggestions :slight_smile:

5 Likes

And this may not be the answer that you want to hear, but I think it is an important one: It really doesn’t matter what language or frameworks you use, not in any meaningful or long-lasting way. The real key is to stop watching videos and reading books, and start actually building things. You need to have something you want to do, that will motivate you to get past all the frustration and confusion of actually building it. Creating working systems, just like writing good books, is really hard work, and there are many roadblocks along the way. The only way anyone has ever gotten any good at it is to write a lot of things, and not be ashamed of the fact that the first ones turned out not very good.

6 Likes

Amazing…that’s why is so hard to leave Clojure with a community like you guys.

Thank you so much!!!

Where I am. well, I am a enthusiast, love to see video tutorials on different languages, saw a ton of them, since the beginning of rails…I know some Java, C#, OOP, JS.

All I can say is that I love to be able to built things, to fully understand how everything works and connects…

Thanks!!

You’re right…need to decide which road(tech) to choose.

I think if you’re not sure which road to start with. And your goal is to learn. I would start with only ring and compojure.

When you run lein new compojure, you’ll get a very basic setup, using ring-server as your web server, ring to manage http requests/responses, and compojure to route URLs to your desired back-end logic. It’ll also set you up with ring-defaults which will deal with setting up your middleware handling chain in the beginning to sane defaults that just work and are better then what you could come up with yourself for a while.

This is both the easiest road to get started, as well as the best approach in my opinion for you to learn the “Clojure way” of web development.

I would also add Hiccup right away.

Just with Ring, Compojure, and Hiccup you should be able to build a complete web app. You could build a whole blog with only that!

Honestly, stop “looking”. Just install Leiningen and run lein new compojure <my-learning-project-name> Edit the project.clj file to add [hiccup "1.0.5"] as a dependency. And GET GOING!

As you go along from there, working on your blog, ask questions when you get stuck. It is better for you to discover the “missing pieces” as well. I’m not joking by the way when I say you don’t need anything else but those three libraries to implement a full blog. That said, for some parts of it, you could lean on additional libraries to make your life easier, but it is best for you to discover these as you go. See what is painful, and only then, see if a library can help you make it less painful, don’t anticipate these.

Most of those “tech” from those other languages, I’m not going to lie, they’re snake oil. It’s all mostly buzz word. Over engineered, showcased like it revolutionizes web development, yet its just a big mix of old ideas often made more complicated then they actually are. My point with this, don’t get distracted by them. That’s what they’re good for, distracting you from actually learning and building real things :stuck_out_tongue:.

Even in the Clojure world, a lot of the “fancy” stuff is just distraction. Go with Ring, Compojure and Hiccup. Let’s call it the “Simple Stack”. Its not that the other things are worthless, but they’re not necessary. Starting with some of the other things is like buying the most expensive pro-level bike at the 10k range, when you don’t even know how to ride one, and barely have the leg power to walk up a hill :smile: .

P.S.: Why am I changing my recommendation from my other post? Because at first I assumed you had good prior knowledge of a web framework in another language, and web development fundamentals. Without that, Ring, Compojure + Hiccup is the way to go 100%.

It would really help if you could link me one of your fav video from YouTube, for anyone of these. Which isn’t too long (I wouldn’t have the time to ever put something longer then one hour or two). So 1h or 2h long. That way I could see to reproduce an identical one, with similar content and format, but for Clojure specifically.

Regards!

3 Likes

I agree that OP should focus on the basics first with Ring etc.
Just a side note, as OP mentioned Graphql, I would love to mention that we have a Clojure-native alternative called EQL that is rich in data structure, highly composable and productive to implement. Pathom is an implementation of EQL and you can set up a “downgrade” endpoint for Graphql with this (meaning: you’ll have both EQL and Graphql with little extra effort).
Anyway, don’t be distracted by the above. Just remember: once you’ve consumed the basics, Clojure community will offer lots of exciting technologies.

I wholeheartedly agree with @didibus recommendations. To any newcomer, I will add that a few years after starting your career as a developer, you will most likely (most hopefully, too) have learned and used more than one mindset/approach/language/framework, anyway. It really doesn’t matter that much where you enter the playing field, what matters is the game :v:

2 Likes

I recently stumbled upon the Functional Design in Clojure Podcast, which I’ve been enjoying a lot. They discuss beginner hurdles like the ones we’ve been touching here in a hands-on way, and they’re really good at asking and answering all the stupid questions.

Some tutorials of newer languages:

building an airbnb type of app

Golang:

Hey, thanks, but these are paid. Is there any free example?

For paid content for Clojure, you can try https://purelyfunctional.tv/courses/web-dev-in-clojure/ or I also found https://www.udemy.com/learning-clojure/ and https://www.udemy.com/building-web-applications-with-clojure/

Yes Didibus, but is not using integrating newer technologies, building a webapp with several functionalities.

There are some free ones on youtube in 5 minutes I found those below, the majority of those guys started on udemy but nowadays release a lot of free material on their youtube channel.

For people who doesn’t know Clojure and it’s exclusive features, if it exists examples building a full web apps like those examples makes it easy to compare with other tech and see why Clojure is awesome and help newbies like me to get on board.
The reason Node.js grew so much is because of those learning tuts.

elixir

full stack js

django full stack

C#

Teach a Junior…lol

Hum. Okay. I do not mean to sound insisting, but I don’t really want to go through a bunch of beginner video tutorials.

I was hopping you had one specific good one in mind, which you have watched, and liked the particular project demonstrated and taught. Where the video goes over building one thing quickly in 1 or 2 hours. And I would only see if I can replicate that in Clojure.

What do you mean. I haven’t watched the videos I’ve linked for learning Clojure, but from their description, it goes over all the basics.

What new technology are you talking about? Clojure is the new technology :yum:

I couldn’t find a entry level tutorial, building a web app, using a pure functional language.

Phoenix is a framework for Elixir, but is not the same as using libs only.

Seems like FP is for “PROS” only, newbies not allowed…lol, so there isn’t tutorials like the ones from javascript maybe that’s the reason node is growing so much…becoming the new PHP?

Even from the Junior video, he said is easier the train juniors in FP and they can achieve professional level fast, in OOP, senior level takes a least 10 years…

Needs tutorials showing why is so cool, hand on, building a web app, to show/demonstrate this and grew the FP way of things and Clojure!!!

Clojure needs this to grow, and growing everybody wins!!!

1 Like