HN user

sometimesweenie

22 karma
Posts0
Comments12
View on HN
No posts found.

If you want a solid structure to start with, I’d suggest https://luminusweb.com/ as that’s what I initially learned from. For a todo app I believe the reagent repo has an example of that without the server bits. I could give you some more direction depending on what you’re trying to accomplish

When I was learning Clojure, I just sorta dealt with it. Usually you are presented with a trace that contains a line number for the error which was enough. I’m not entirely sure what could be done about the error messages but with experience and more idiomatic usage it’s infrequent for me to get stuck on these (and when I do I just step through it in the debugger).

I've been across this bridge probably a hundred or so times since childhood... scary stuff. Our geography is pretty prohibitive to population increase for a larger tax base to support the infrastructure. Lots of plateaus and rivers are the reason for the large number of bridges and tunnels. Even as a local, Pittsburgh is really difficult to get around. The T doesn't go to many places around the city. Buses have the same problems as cars. The inclines stopped being useful. Have fun getting hit by a car while cycling (you'll have the strongest calves to make up for it). The roads are hard to navigate and there isn't enough space for the innovative roundabout. There are some benefits from the geography like culturally distinct neighborhoods but the infrastructure issue really needs addressed. Fortunately, we have our best civil engineers working on the problem [0]

[0] https://www.theonion.com/urban-planner-stuck-in-traffic-of-o...

I’m a bit biased, but from my personal experience I would definitely say that it does. I’ve worked on two projects that had different backends (PHP and elixir) where the choice to use clojurescript IMO was the correct one. Both projects relied heavily on highly interactive frontends that would’ve been a nightmare to write if I had to use vanilla js. If your backend can spit out json, and your frontend isn’t static, then I’d say cljs should be good to use regardless if the backend is clojure or not. However, the biggest pain point for me was the disappointment of not being able to use clojure everywhere in the stack... so prepare for that if it’s the route you choose.

The -> macro is a clever hack which allows you to "thread" values through expressions. It implicitly adds the value as the first argument to the first forms, the result of that form as the first argument for the next, etc. Because the core library is quite well-designed, this works 90% of the time. Then the other 10% you need ->> which does the same but adds the implicit argument at the end of the forms. And that's not always enough either, so they decided to add a generic version called as-> which binds the value to a name so you can put it at any place in the forms. These macros also don't compose well.

This is the biggest criticism of clojure I agree with the author on. Trying to compose threading macros is extremely annoying even though it’s not that difficult to refactor. Somewhere in the thread, you’ll want to put the return value of the previous function in a different argument place. I am not sure the reasoning behind designing the macros this way. With how well the language is designed, this annoyance has always seemed out of place and somewhat of an after thought. I made my own macro [0] as an experiment to circumvent this annoyance... which was an interesting experience (both writing and using the macro). Still, I don’t think it’s a good enough solution so I’m still trying to think of better ways to implement thread macros in clojure because I love the idea.

[0] https://github.com/cj-price/pipe.dream