Fork me on GitHub
#programming-beginners
<
2018-03-15
>
joelsanchez07:03:06

I bought SICP a long time ago when I didn't even know any lisp, tried to read it, and left it unfinished. After 1y+ working with Clojure I'm reading SICP again and I think it's being much easier to read and more informative now...maybe not a beginner book but definitely one to read

Amelia08:03:01

I know Clojure for the Brave and True is the most recommended book for beginners (and I like what I’ve read a lot), but what are the others? And what are the most accessible (by which I mean easy to understand from zero background) books on programming in general? I may have an Amazon voucher or two to use up...

sundarj10:03:31

Joy of Clojure is quite high-level, not really a beginner's book

sundarj10:03:46

i've heard Living Clojure is good

sundarj10:03:56

and i can heartily recommend Programming Clojure

lispyclouds08:03:04

@amelia Try The Joy of Clojure. One of the most profound books I’ve read. Its more into “Why Clojure”. Very nice and quite philosophical read 🙂

Amelia08:03:40

I like the look of it, thank you!

Amelia10:03:46

This showed up in my inbox today - I’m still working through it, but it’d be good to know if everything in here is true of Clojure too

Amelia10:03:14

Thinking things like this: “The most common data structure mistake is probably the use of lists instead of maps to manage a list of records.”

daveliepmann10:03:52

It seems like fine general advice. I think "always" use a map is too strong, but I agree with the recommendation to consider data structures carefully. Kernigan & Pike, in their excellent book Practical Programming, point out that the choice of data structure will dominate the shape of your program. Deciding between maps and lists/vectors is a key decision point.

Rachel Westmacott11:03:15

YES. This is really important.

sundarj11:03:13

i agree that most of it is good advice; however i think this is not: >Duplicating code. If you copy/paste a code section to only change a line after that, you are simply duplicating code and making a bigger mess. In the context of the messy room example above, this would be like introducing another chair with a lower base instead of investing in a new chair that is height-adjustable. Always keep the concept of abstraction in your mind and use it when you can. premature abstraction is a much bigger issue than duplication. abstraction should only ever be about separating out the essence from a number of concrete examples. see: https://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction https://twitter.com/nathanmarz/status/900735315144564736

Amelia11:03:53

What does abstraction mean?

Rachel Westmacott11:03:41

Different things depending on context! Often some code that draws out a common pattern from a bunch of very specific bits of code will be called an abstraction.

Rachel Westmacott11:03:50

eg. if you have (defn add-1 [x] (+ 1 x)) and (defn add-2 [x] (+ 2 x)) then someone might create (defn add-n [x n] (+ n x)) and say that it “abstracts over” the first two bits of code.

Amelia11:03:55

Thank you!

felipebarros20:03:03

@amelia just yesterday I read a nice explanation of Abstraction in the coding context. From the preface of How to Design Programs (http://www.htdp.org): >Abstraction acknowledges that many [...] functions [...] look alike. No programming language should force programmers to create pieces of code that are so similar to each other. Conversely, every good programming language comes with ways to eliminate such similarities. Computer scientists call both the step of eliminating similarities and its result abstraction, and they know that abstractions greatly increase a programmer’s productivity.

sveri11:03:31

@sundarj Deduplication is a good starting point for beginners to learn about refactoring and the essences of code reuse. And only when you do that you can learn the disadvantages of deduplication of code yourself. So I would say its better to deduoplicate early as a beginner to gain more experiences in general and keep the code base at least a bit sane. It needs a lot of experience to extract the essence of something and also do that in a useful way.

sundarj11:03:24

fair enough i suppose 🙂

sundarj11:03:32

@amelia good question! it means taking concrete details and hiding them away behind some higher-level concept. so for example, you could test for evenness like so: ((fn [x] (zero? (mod x 2))) x); but reading that means you're reading the details of checking whether a number modulus 2 is equal to 0. so you can abstract those mathematical details out into a function, and express only what you're trying to do, not how it happens: (even? x).

Amelia16:03:42

Just got my first friend into Clojure 😁

Amelia16:03:50

She’s been trying to learn Python, we got to talking about programming last night and I spoke highly (of course!) of Clojure. Today she’s said she’s still really interested and wants to look into it. ✌️:skin-tone-4: