Fork me on GitHub
#beginners
<
2016-05-17
>
bwstearns02:05:27

A friend is looking to learn her first programming language. She has pretty extensive experience building some pretty complex spreadsheets and also has worked with some proprietary languages but she doesn't consider them "real programming" (tried to dissuade her on this point). Is anyone's first language clojure who can share some dos/don'ts as far as material goes for recommending? I'm sending her braveclojure but I'm a little concerned that it might feel like it expects it to be your nth language and I want to make the learning curve as pleasant as possible.

fingertoe03:05:13

How big of a datastructure (map) is too big to hand to the browser for filtering rendering etc?

bwstearns03:05:59

@fingertoe: I guess that depends on how zippy you need pageload to be?

bwstearns03:05:27

and also how much processing you're doing on the data on the front end.

fingertoe03:05:42

It should be on the LAN intranet, so speed shouldn’t be too big of an issue.. I am just kinda new at this and am not too sure about what the best practice would be.. I could make 1000 individual files, but it seems like it would be handy to have the map to cross reference and build links etc..

bwstearns03:05:45

I had a really janky map that loaded tens and tens of MB into a page and built a really inefficient google maps, but it worked for what I needed. It wouldn't be a good idea for a consumer webapp

fingertoe04:05:04

I parsed 40 years worth of old source code and built a map of how each program relates to other programs and the data files.. The idea is to pass that information to webpages for documentation...

fingertoe04:05:53

I think it will be a couple meg...

bwstearns04:05:39

Well, at a couple megs you're probably safe to load it all (again depending on what you're doing with it), but if it ends up being too slow and you need to build an API to select a subset then at that point you might as well try to limit the transmission to only the data you expect to use per request.

bwstearns04:05:15

A medium-ish documentation page from github was 3.3MB, and that seems pretty quick (1.1 seconds from request to full render?)

fingertoe04:05:51

I was thinking it would be okay, but my Non-clojurian web developing friends though it might be too much.. I certainly could serve it all from DB - but It seems like having ClojureScript be able to scan it and index it on the fly might be pretty handy.. I will give it a shot. Is there a benefit in using something like transit? I suspect it would make it smaller on the load - not sure if there is a benfit once it is in RAM..

bwstearns04:05:46

I would say if you're not sure then just build it first using all the data. If it's painfully slow then optimize. If it just works with all the data then all the effort with the DB would be excess and just result in more queries/requests.

bwstearns04:05:32

I'm not familiar with transit but once it gets to the browser it would take up as much space as the data it contains.

fingertoe04:05:00

I will try without first and see how it works.

bwstearns04:05:39

I don't want to make guarantees about it working, but that'd be an easy way to start out. It also has the benefit of cutting down the complexity you need to deal with while you're focusing on the frontend anyways (I'm currently playing with re-frame and the data is mocked in entirely just as a hash-map literal). Good luck!

fingertoe04:05:50

I am just using figwheel -reagent at the moment. Just barely getting started on the front end stuff — the backend parsing and map building is all finished and looks good..

bwstearns04:05:00

Front-end-wise I'm coming from mostly backbone/angular so figwheel/reagent were enough to make me like browser work again lol

bwstearns04:05:45

messing around with re-frame because I enjoyed playing with re-com elements and the re-frame docs readme was such an enjoyable and informative (if really long) read.

bwstearns04:05:21

I'm out for the evening. Good luck with your project.

jeff.engebretsen14:05:13

@bwstearns: Concerning your friend, I’ve been reading a book that is great for people totally new to programming. It’s not Clojure but it is a Lisp so there will be a lot of crossover. I’ve actually thought about re writing the libraries they use in Clojure. That way the book can be used with Clojure without the new programmer having to find compatible tools. http://www.ccs.neu.edu/home/matthias/HtDP2e/