programming-beginners

joelsanchez 2018-03-15T07:56:06.000362Z

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

1
2018-03-15T08:19:01.000012Z

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...

lispyclouds 2018-03-15T08:23:04.000141Z

@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 🙂

2018-03-15T08:33:40.000481Z

I like the look of it, thank you!

2018-03-15T10:10:46.000452Z

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

2018-03-15T10:11:14.000182Z

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.”

sundarj 2018-03-15T10:14:31.000138Z

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

sundarj 2018-03-15T10:14:46.000047Z

i've heard Living Clojure is good

sundarj 2018-03-15T10:14:56.000054Z

and i can heartily recommend Programming Clojure

2
daveliepmann 2018-03-15T10:34:52.000051Z

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.

💯 3
1
sundarj 2018-03-15T11:00:13.000121Z

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

2018-03-15T11:00:53.000473Z

What does abstraction mean?

👍 2
2018-03-15T11:21:15.000089Z

YES. This is really important.

sveri 2018-03-15T11:22:31.000459Z

@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.

sundarj 2018-03-15T11:25:24.000393Z

fair enough i suppose 🙂

2018-03-15T11:27:41.000243Z

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.

sundarj 2018-03-15T11:28:32.000321Z

@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).

1
2018-03-15T11:28:50.000100Z

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.

2018-03-15T11:30:55.000429Z

Thank you!

2018-03-15T16:55:42.000521Z

Just got my first friend into Clojure 😁

2018-03-15T16:56:50.000201Z

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:

5
🎉 10
felipebarros 2018-03-15T20:44:03.000574Z

@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.