Fork me on GitHub
#off-topic
<
2023-01-21
>
Gerome15:01:18

Hello! I’m developing clojure in my free time because my employer uses JS and Java. However, I would like to get a lot more practice and I was wondering how other people find room to develop in their free time, especially with a family. Do you always have your laptop ready to go or do you have some mobile development setup with your phone?

moe15:01:49

I don't think much mobile development is going on

Martynas Maciulevičius15:01:05

I learned clojure when 4clojure app worked. I was playing with it while taking a bus and it worked very well. Currently https://4clojure.oxal.org/ app took its place (because the original was shut down) but it's painful to use that one on mobile. The author baked in paren balancing feature to which I can only refer as "cancer". Basically the new version exists but I find it completely unusable because of this supposed "smartness".

4
Martynas Maciulevičius15:01:23

Try reading this issue: https://github.com/oxalorg/4ever-clojure/issues/65 You may want to add a comment there to support the removal that cancer-inducing paren balancer. I'd really like a simplification of 4clojure original android app which allowed to simply use the problems offline. Solutions aren't needed, just the problems and REPL.

bherrmann15:01:04

I think the general pattern is to give yourself some goals and then hold yourself to getting them completed. I believe most successful people block off time for this kind of approach (ie. getting up an extra hour early - or carving out time at lunch...) the long haulers make it happen by being consistent... You may want to find a space and time where you do the "Clojure" thing, like you might do running or working out... and then dedicate that time to progress. You might consider https://exercism.org/tracks/clojure YMMV.

noob.clj16:01:45

So I am in similar boat as yours. I started learning clojure but was not sure how to get more practice. So I found Exercism was pretty good. I tried their questions for few days. I feel I was getting better but sort of having difficultly in understanding the reasoning behind various approaches. Finally I decided to go more structured route of reading a book, so I started reading “Programming Clojure” by Alex Miller. Seems pretty good so far, once I feel more comfortable I am planning to solve Advent of Code for more practice. Time wise I try to do at least few hours on weekends. Sometimes I get time on weekdays but most of the time I just spend 2-3 hours on Sat and Sun morning. Honestly, I feel that taking couple of days of break when learning something new is more helpful as we have to spend few mins in recalling what we learned and it sort of solidifies it in our mind.

borkdude16:01:26

@U028ART884X Thanks for your feedback. Perhaps you can submit a PR to disable that feature on mobile?

borkdude16:01:37

If @U013MQC5YKD agrees too

2
borkdude16:01:15

and/or an option to enable/disable it maybe

Martynas Maciulevičius16:01:27

> Perhaps you can submit a PR to disable that feature on mobile I would better develop a button to format the code using the in-built clojure.pprint/pprint instead of trying to detect screen resolutions or user agents :thinking_face: Does pprint into a string even work in clojurescript?

borkdude16:01:11

Yes, it does. We could also include a different code formatter, but those keybindings are I think from nextjournal clojure mode to also allow you to slurp etc. Can you confirm that you have the same issues here? https://nextjournal.github.io/clojure-mode/

borkdude16:01:35

If so, perhaps @U5H74UNSF also has some tricks for mobile

Martynas Maciulevičius16:01:28

> Can you confirm that you have the same issues here? When I paste (]) into the prompt it still doesn't delete with backspace (mobile keyboards don't have delete key, it works with delete key on laptop) Didn't Rich Hickey say that we shouldn't do guardrail-driven development? What's going on...?

borkdude16:01:12

Rich Hickey also said this: https://clojure.org/community/etiquette

2
4
borkdude17:01:40

I don't disagree that the inability to delete stuff is annoying and imo it should change. I'm involved with 4ever clojure from the "Clojure evaluation" perspective but haven't really touched the UI. However, if someone wanted to make changes and they provided a PR, those were usually merged

💯 2
Martynas Maciulevičius17:01:16

I mentioned guardrail-driven development because the paren balancer helps in many cases but it doesn't allow to enter invalid input and recover from that without pasting the text into a separate text box which doesn't have that balancing function. For instance (]) can happen when I enter ([]), then select [ by long-pressing with my finger and then type any symbol. Then I can type any letter and replace the [. And if I delete that letter then I end up with (]) which can be deleted with more selecting. If it accidentally happens on the code with many parens then it can become a problem to find out what happened. You can recover from (]) by selecting the ] and typing a letter. But that's not what you'd be thinking about. You'd be trying to use backspace.

Martynas Maciulevičius17:01:36

> I don't disagree that the inability to delete stuff is annoying and imo it should change Yes but do you also disagree that humans should be able to balance their own parens without the plugin? You suggested that we should detect mobile device which adds one more layer of complex decisions on behalf of the user. Do you think it's a good idea to have this decision instead of doing a basic on-off toggle or even disabling the balancing until the plugin works without issues?

seancorfield18:01:37

@UPJP9G4G1 Does you employer have any sort of allowance for self-directed learning time as part of work? Some companies allow some percentage of your work week to be used for tech skills investment. If so, you could maybe use that time to look into Clojure -- and for "problems" to solve for that learning, you could look at rewriting some existing JS or Java into Clojure/Script perhaps? Alternately, you could carve out a fixed time block at home on a regular basis -- say, instead of watching a TV show you could do an hour once a week? You could even sit with family in front of the TV and learn Clojure on your laptop instead of watching TV? I'm fortunate that my family understand I enjoy writing software for fun outside of work so if I decide I'm going to spend an evening on my "play-work" instead of watching TV, that's OK. I WFH 100% (and have done since I quit Adobe in early 2007), so I have a "work-work" machine -- a desktop setup purely for work -- and a "play-work" laptop (a Microsoft Surface Laptop 3, currently) that is just for personal stuff. That acts as a signal for my family: if I'm on the desktop, I'm working; if I'm on the laptop, I'm "playing" (even if I'm writing open source Clojure).

phill18:01:41

Why not turn it into quality time? Read books about Clojure while the family is gathered around the fireplace (and leave a copy of Clojure For the Brave And True lying around if the kids are old enough to read). "Help" with the kids' general homework ("would you help me see if we can solve this in the REPL?"). Start a quixotic quest with the kids to make "Guess The Animal" in every mode you can think of and keep enhancing it in silly ways (Swing app, website, NodeJS command, mobile app, retrieve related facts from Wikipedia?). Let the benefits-to-you be side effects of your unswerving dedication to imbuing the next generation with Correct opinions to counter the Python they will be exposed to in the public schools. Better still, transfer the kids to a boarding school that does its exercises in Clojure (there is probably such a school in Brazil or Switzerland) and learn from them when they visit during their vacations.

noob.clj18:01:36

> Read books about Clojure while the family is gathered around the fireplace (and leave a copy of Clojure For the Brave And True lying around if the kids are old enough to read). Actually I tried this 😞 it didn’t work for me. Even if for some magical reason my wife don’t get mad at me not being present with everyone else, I’ll be yanked out of my focus every time somebody says something. We usually try to avoid all electronic devices (except TV) when spending some family time.

borkdude19:01:31

@U04JZS3AC59 Does your job have something like 20% time? You could maybe dedicate some of that time. Or wake up 30 minutes earlier, go to work and spend that time on Clojure at work ;)

borkdude19:01:58

Sorry, I meant @UPJP9G4G1 - or anyone who wanted to hear that ;)

Mendel20:01:56

Often my work requires small scripts and programs mostly for myself only. I enjoy writing those in clojure because together with the repl I can "hack" things quickly together. Example, I was developing some stuff using Redis and aws lambda's. It's way quicker for me to wire some things up programmatically then keep doing the same stuff manually time and time again. It is a good way to get familiar with the language I guess. So far I've written small tools with for redis (carmine), http calls (http-kit) for testing, using gatling(cli-gatling) for some load testing and puppeteer (together with nbb). Perhaps I would be quicker with python or js, but the repl makes it way more enjoyable to experiment with different libraries. And if it is really useful I just rewrite it to something else, Actually writing code is way easier if I understand the problem and how everything is laid out 🙂

mdiin09:01:47

I think the key to making this work within a family is communication. Make sure they understand that you are doing this to recharge your batteries, to do something for yourself, not to get away from them; and encourage the rest of the family to do things to recharge their batteries as well. This has worked well for my family, and I feel it has made family time more enjoyable because our minds are not elsewhere. If you are interrupted while recharging by coding, make it a habit to say “give me 5 / 10 / 15 minutes to wrap this up and I will be there”, and then actually spend those minutes wrapping up instead of continuing. My wrapping up often consists of making VCS commits with good commit messages, putting comments in the code to help remind me of the direction I was heading when I pick up again, etc. As this way of communicating has become more and more a habit, I find it has made it easier to get 15-30 minutes of coding in during the day as well.

2
👍 2
2
Martynas Maciulevičius15:01:24

Thanks to borkdude's recent addition that allows to deploy on github pages I hosted my own 4clojure version where I fixed some UX bugs that were bothering me: https://invertisment.github.io/4ever-clojure/

🎉 2
jorgebarrios16:01:37

I enjoy working on https://adventofcode.com/ problems to practice Clojure. Each year the problems to solve ramp up in complexity and often lend themselves to making progress in small burst of dedicated time.

4
Tuomas-Matti Soikkeli07:01:09

Find and join a consultancy who are willing to pay you for learning Clojure. Don’t use free time for work, spend it with your family 🙂

Gerome09:01:52

Wow, this blew up! Thanks to all those great replies. To answer to some of the comments: I do spend a lot of time with my family but I need my own interests as well. In addition to that I'm not very happy with my career right now and I'm looking for a way out in the long term but I need more experience for what I'm aiming for. I work in an environment with lots of hierarchy and benefits for people with more or less pointy elbows that have already gathered decades of experience writing code and can spit out stuff in days that takes me much longer. Of course, profit orientation does not help as these people are asked to do the good stuff and at the same time are rewarded more for doing so. My desire to work with others instead of by myself and the fact that I've been burned in the past by eating more that I can handle does not help either. So, me, the 40 year old career changer with six years experience, I'm doomed to basic component development and being financially dependent unless I spend some of my time reinvigorating that love and curiosity for coding that brought me into this industry in the first place. On the suggested solutions: I need to sleep more regularly anyway, so I'm going to cut off TV time and make sure I go to bed early and get up in the morning to reach my goals. In addition to that I'll just make sure I have a computer that I can just open and hack away. @UA6HAQ77B I will also look to use clojure whenever I can at work, in fact, I now remember already doing so in some cases. And I'm going to start contributing to open source projects. Let's see how that goes 😄 And yes, @U04V70XH6 and @U04V15CAJ, my employer does allow me time for self-learning but you know, feature pressure, meetings, feature pressure and meetings. I'll also check out exercism. I definitely need a mentor because I'm not being mentored a lot at work.

Martynas Maciulevičius09:01:44

> Gerome I fixed the 4clojure parentheses in my own deployment of 4clj: https://invertisment.github.io/4ever-clojure/ (I also reworked some things. Also problem solution archive doesn't work in this version because of how it looks them up but I didn't want to change this) if/when they'll merge the PR then it will be available in the "official" page: https://github.com/oxalorg/4ever-clojure/pull/62

mkvlr09:01:42

fixed means disabling paredit? Not sure that’s an improvement. If you don’t want paredit can also do without clojure-mode and just use a stock codemirror with https://github.com/nextjournal/lang-clojure which will only give you syntax highlighting

mkvlr09:01:05

or alternatively do a PR against clojure-mode to support deletion of unbalanced parens if I understand the original problem

Martynas Maciulevičius10:01:48

> fixed means disabling paredit I think you want to answer the question of "what is a standard Clojure developer" and "does everyone need to type least keystrokes if you have a preference for it" if you want to force a tool onto everybody. You may want to see this thread: https://clojureverse.org/t/parinfer-and-paredit-embrace-or-avoid/697 Also as the casual viewer of the webpage would not be you but somebody who sees Clojure for the first time I think that they should also read this: https://raw.githubusercontent.com/georgek/paredit-cheatsheet/master/paredit-cheatsheet-refcard.pdf But I think that they shouldn't read this cheatsheet and instead move on to actual code. > fixed means disabling paredit I didn't disable paredit, I only disabled "balanced parens" and their implementation of backspace handling which was interfering with deletion.

mkvlr10:01:36

slurping and barfing didn’t work for me in the demo you posted

borkdude10:01:33

I've had problems with the behavior of nextjournal clojure-mode too where you get into a situation that you can't recover from

borkdude10:01:39

don't have a repro at hand

Martynas Maciulevičius10:01:33

I don't want to cause problems for you but IMO the default should be mobile device support. We can have full paredit as some kind of a setting or something. It's not out for good 😉 .

mkvlr10:01:41

I always use cut & paste to recover 🙃

mkvlr10:01:05

codemirror 6 was built to have good mobile support

mkvlr10:01:22

though I guess good lisp editing on mobile might be an open research question

2
Martynas Maciulevičius10:01:46

I didn't remove any dependencies, we can add this as an option. But I think we can't expect new users to think about cut-paste like you do. It has to not cause stress where it doesn't need to.

mkvlr10:01:51

at least I’m not aware of a good solution

Martynas Maciulevičius10:01:03

Does the expected functionality (barf+slurp) work on the original? I'm trying to figure out whether it worked correctly before.

mkvlr10:01:46

and I’d expect commenting out the bindings to break it

mkvlr10:01:08

also interested in a issue & repro against clojure-mode for what exactly breaks on mobile

Martynas Maciulevičius11:01:07

When I tried mobile firefox, mobile chromium and PC firefox a moment ago it actually produces different results. If I have this on mobile as my input: inc 1) and type the missing ( then I get this: ()inc 1) and when I delete the other paren I don't get the deletion. But when I press backspace again I end up with inc 1) again 😢 http://4clojure.oxal.org actually correctly recovers from inc 1) when typing ( but then doesn't allow to remove the paren. I'll try to debug more and see what I can do. Maybe simply make a button to disable the fancyness and that's it.

👍 2
Martynas Maciulevičius12:01:55

Try this one: https://invertisment.github.io/4ever-clojure/#/problem/4 I added a settings button. Enough for today on this app 😄

borkdude13:01:39

Seem reasonable ;)

Martynas Maciulevičius13:01:36

I couldn't make it not reevaluate the form when I change the setting value. But maybe that's solveable in a different way.

jjttjj18:01:57

Sometimes it's frustrating to think how programming might have turned out if the masses could've somehow seen that it's worth getting used to a few parenthesis and mainstream adoption of lisp took off. Have there been any actual meaningful advances in language syntax after 50+ years of programming languages? Perhaps increasing use of data literals comes to mind (but we get my favorite version of that in clojure anyway). Is there any case where (op & args) is significantly worse than an alternative? Surely the edge cases can't make up for the universality of it and the advanced features (homoiconicity, macros, structural code editing) that are made natural. There's never a case where I wouldn't prefer lispyness for writing code! Preaching to the choir here I know, and I know it's fair that people have their preferences. But imagine how many years in the future we'd be if lisp had captured and maintained a 20% mindshare since the 80s. And it seems deserving of at least that based on its merits

parens 12
4
Martynas Maciulevičius22:01:08

Teacher: Don't use static methods in Java because it's bad. Student: Why? Teacher: I don't know, but it's bad.

☝️ 2
phill00:01:13

@U064UGEUQ I wouldn't even mention infix Racket here

respatialized01:01:59

The fact that so many systems are defining executable program/system behavior using YAML (DVC, Kubernetes, GitHub Actions) shows me how many people yearn for "code as data" and are reinventing it in a horrible way.

dvingo03:01:41

it's all absurd. programming, like all human endeavors is based on fads and fashions. even the products produced by companies will billions of dollars of resources miss syntax bugs https://github.com/tc39/ecma262/issues/2197 (and then of course people start arguing over whether the syntax should be allowed...) sigh... imagine if all this effort went into something useful. imagine all that lexing and parsing code... that doesn't need to exist.

Frank Henard02:01:27

These are my same feelings lately. Companies think they're smart because they're choosing to write their web APIs in C#, ugh.

Zed00:01:32

I wish the inventors of HTML and its predecessor markup languages had realized they could have just used parentheses instead of <tag></tag>

eggsyntax14:01:22

@U04ESH6949M you might like this essay that uses XML as a way to help people fully grok S-expressions: https://www.defmacro.org/ramblings/lisp.html