Welcome! Please see the About page for a little more info on how this works.

0 votes
in Meta by

I am new to programming. I have started to learn C++ and even some python
My background is Economics. I have strong quantitative background (Math and Econ) and I know STATA.

In general, I would like to use programming
(1) for ML/AI in economics topics+other utilities such as webcraping, and other data driven analyses
(2) for it, fintech matchmaking platforms

In particular, I just recently discovered I love programming. I am old (35) as a beginner but I have set a goal to become a fully capable programmer by 40...Hopefully I can learn 2 languages well enough by then.

If jobs opportunities are present then, I can switch careers although I still like my career path. I could always use my programming skills for either my job, a start up, or become a full fledge prgrammer.

Online research has led me to think that Clojure might be an excellent language to focus on because they say it is an excellent for rapid development (If I want to use it for a start up, lone developer), data-driven (econ and ML), and provide a path to be a great programmer.

My Apprehension is that Clojure doesn't seem widely used so might issues with doing ML projects with few libraries (compare to Python for ex), and future job prospects, etc...

Anyway, I welcome any insights/advice, tips.

Thanks in advance,
Baye

4 Answers

+1 vote
by

If you're missing python then you can use

https://github.com/clj-python/libpython-clj

https://github.com/gigasquid/libpython-clj-examples

To use python libraries from Clojure

Clojure demands a lot from you in terms of learning
But I think it's got the most to teach in terms of pragmatism

For a lot of people it returns the joy of programming

I'd recommend installing clj-kondo early on and get really comfortable
With your editor and sending forms to your REPL using rich comments

There's not much out there that can top a fast well oiled REPL editor
Workflow it's like having a conversation with your program

Other languages encourage you to edit compile and ship your programs like dead fish

If you can try and get experienced Clojurians their workflow on slack

by
Thanks for the tips!
+1 vote
by

I think Clojure is wonderful as a first language. That's an easy thing to say and hard to back up though — Clojure wasn't my first language, and I knew Java before I started learning Clojure.

I think programming in general has a pretty steep learning curve because there is a very comlpex mapping from code in the text file to the behavior of the program when it's executed. As a software developer, you need to have a virtual machine in your head that can execute the code while you write it. The longer the feedback loop from writing code to seeing its execution results, the bigger the load on your mental virtual machine, the harder it is to progress. Other mainstream programming languages try to solve this problem with type systems and IDEs, and I think they are not good enough at that, because:

  • type systems introduce complexity and require you to always write code that is about types and not about your problem;
  • type systems are rudimentary, they only check what can be expressed in types, so they can only help with how things shouldn't be combined (e.g. they prevent you from summing string with number), but not with how your code behaves when executed (e.g. they can't prevent you from adding value to the end of a list when you wanted to add to the beginning).

Type systems get more and more complex to help you with writing correct code. You can have a look how Idris promotes type-driven development that helps with writing matrix transposition: https://youtu.be/mOtKD7ml0NU?t=1607
Here is a type signature for matrix transposition in Idris, without any implementation:

transpose : Vect n (Vect m a) -> Vect m (Vect n a)

I think it's nice that the language can help you fill in the blanks when you want to transpose a matrix, but what if you had a language that allows to have the actual implementation shorter then this signature?

(defn transpose [xs] (apply mapv vector xs))

What if you could immediately try this particular piece of code and see how it behaves?

(transpose [[1 2] [3 4]])
=> [[1 3] [2 4]]

In the end, we want to write code that makes computer behave the way we want it to behave. I think seeing the result of code execution immediately as you wrote it is a better way to validate the behavior than writing code in 2 languages in the same file, where one rudimentary language is for a compiler to have a dialog with you (type signatures), and another is for a computer to execute (function calls). Less noise, less cognitive load, more focus on a problem, faster and more useful feedback = wonderful first language, I think :)

P.S. I could go on about data processing with maps and generic functions vs classes and methods, but I don't have time right now. Much more simple and concise in Clojure!

by
Thanks for the insight!
+1 vote
by
by
Thanks for the link!
+1 vote
by

If you already have an idea of some basic programming ideas from python then you're in good shape to learn Clojure.

I think when learning anything in the beginning it's important to get a lot back for a little effort, with this in mind I would always try to limit the amount of unknowns at first.

Clojure requires a host language to run, this is actually a fantastic feature as it benefits from a massive reach and the richest library ecosystems. For a beginner though this means at some point you'll find yourself having to learn either Java or JavaScript to some degree when writing your programs. This can cause extra friction in the beginning so my advice is based around avoiding this until you've gotten some confidence in the core language.

Clojure also benefits from fantastic tooling, but it can be a little difficult to set up for a total beginner when you just want to get on and learn.

To learn the language I think a good way to start would be to use an online REPL and the book: Clojure for the brave and true. I would copy and paste example code and play around with it, testing your understanding of what you are reading.

Once you feel like you understand it enough to test yourself a bit more you can try a little challenge: Clojurescript Koans

Hopefully by now you would have some understanding and you want to write some programs.

The prescribed way would be to install Java and follow the getting started guide:

https://clojure.org/guides/getting_started

You can start looking into "REPL Driven Development" and getting a text editor set up for fast feedback whilst you are developing (one of the great joys of Clojure).

Another way might be to get a copy of the Babashka binary, this is a batteries included (large) subset of Clojure, the reason I bring it up is because it's a very simple thing to install and it allows you to write real programs without having to do as much set up. This being said if you want to use some libraries you would need to be using the JVM Clojure to do that.

There are a lot of resources out there for learning Clojure, start off with the core language and the repl and work your way out to the domains that interest you :)

by
Thanks for your time and great suggestions!
...