Fork me on GitHub

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.


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


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


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


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


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


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


I think it will be a couple meg...


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.


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


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


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.


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.


I will try without first and see how it works.


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!


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


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


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.


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


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