hyperfiddle

Dustin Getz (Hyperfiddle) 2025-02-17T14:39:54.659779Z

FAQ: What is the best way to learn Electric? • the best way to learn Electric is to type in each tutorial example and replicate it on your machine. This is how I learned Clojure, Scala, Haskell, SICP - typing in code from books. • Why this works? Because getting simple examples working is a forcing function for you to pay attention to the details—understand every single line—and develop basic debugging skills in small apps before you try to "swallow the elephant whole" and build your ambitious project. • The ~dozen or major examples in the Electric v3 tutorial covers a LOT of ground in a very tiny amount of lines of code. The current tutorial has 22 pages, but many of them overlap and build up on each other. • I believe an experienced Clojure/Script developer can get all the way up to the first Todos app in a single workday, and can get all the way through TodoMVC in a second day. Our TodoMVC is only 200 LOC! • Ignore this advice at your peril: when you need to debug your ambitious project—debug, because its code is incoherent, because you didn't learn the fundamentals first—you will waste far more than two days painfully debugging, likely ultimately failing and giving up

👍 5
👍🏻 2
❤️ 4
➕ 1
Dustin Getz (Hyperfiddle) 2025-02-18T14:17:08.296789Z

I want to validate this claim: > I believe an experienced Clojure/Script developer can get all the way up to the first Todos app in a single workday, and can get all the way through TodoMVC in a second day. Our TodoMVC is only 200 LOC! If/when y'all attempt this, please report back with your experience

macrobartfast 2025-02-18T23:00:14.210379Z

I will let you know! But I would be a terrible reference case. I'm a below average Clojurist at best, and not an 'experienced Clojure/Script' developer by any means. All I have going for me is some instinct for the right languages and tools. So I won't validate much, either way. 🙂

macrobartfast 2025-02-17T21:43:01.360949Z

You've nailed it. > because you didn't learn the fundamentals first This has gone on for years for me. Advice taken to heart.

jdhollis 2025-02-18T00:12:19.913479Z

And I would suggest that making the demo/starter code your own is a good follow-on step. Getting the starter code working in my Polylith project was quite educational—forces you to understand how and why everything fits together.

jdhollis 2025-02-18T00:14:54.909699Z

Just be ready to do most of the debugging yourself. (Which is exactly why it's a valuable practice.)

Dustin Getz (Hyperfiddle) 2025-02-18T01:36:33.760929Z

yeah we don't want to be supporting (debugging) people's custom entrypoints, so i would encourage y'all to delay integration into a larger project until after tutorial mastery

Dustin Getz (Hyperfiddle) 2025-02-17T15:35:42.137819Z

Datomic entity navigator we are working on this week

👍 1
3
Dustin Getz (Hyperfiddle) 2025-02-17T15:36:17.109909Z

Approximately the same abstraction targeting a Clojure namespace and navigating into a var (it can target any object for navigation)

macrobartfast 2025-02-17T02:01:17.706999Z

Are there any follow-along tutorials that implement something simple in electric? I love the paradigm but will, I'm sure, struggle to implement a todo list/address book level app.

xificurC 2025-02-17T08:09:49.290389Z

https://electric.hyperfiddle.net/tutorial/todomvc implements TodoMVC, both bakcend and frontend, with dirty state and more. If you start from the first tutorial, read the explanations and try to rewrite the demos yourself you should be able to ramp up towards it.

Dustin Getz (Hyperfiddle) 2025-02-17T14:37:13.995839Z

Endorse what @xifi said; the best way to learn Electric is to type in each tutorial example and replicate it on your machine. This is how I learned Clojure, Scala, Haskell, SICP - typing in code from books. The ~dozen or major examples in the Electric v3 tutorial covers a LOT of ground in a very tiny amount of lines of code, you can get all the way up to TodoMVC in a single Saturday

macrobartfast 2025-02-17T02:03:35.206429Z

Another question: I'm interested in leveraging modular UI components for nice interfaces. Reagent lets you npm install UI elements and use them (if I have that right). I know that won't work here. But I'd like to be able to utilize existing UI libraries (i.e. Flowbite) hopefully while being able to separate logic and UI code a bit. Are there any strategies around this?

xificurC 2025-02-18T08:01:44.986839Z

https://gitlab.com/hyperfiddle/electric-fiddle/-/blob/9cfc14242306fff334bae6c49c719037161d5d33/src/electric_tutorial/reagent_interop.cljc is an example of using reagent. It's for v2 but should work the same way if one swaps in the v3 requires

💫 1
❤️ 1
macrobartfast 2025-02-19T00:44:03.477859Z

That example is so fantastic! I'm super excited to get better at all this now. I'm a real-time dashboard and charts fan.

xificurC 2025-02-17T08:12:12.058449Z

One can certainly build reusable components in electric. Actually they are more reusable than reagent libs, because electric can abstract away the client-server communication. Embedding react, reagent etc is straightforward, we have examples of that lying around in scratches and in the channel

macrobartfast 2025-02-17T22:04:54.724029Z

Great! Any pointers to the scratches would be awesome. But I'll search this channel, too.

macrobartfast 2025-02-17T02:06:54.370369Z

I found this: https://github.com/hyperfiddle/electric-v2-tutorial for which I'm totally grateful. But I'd be interested in how one builds up an app and being able to follow that process.

Dustin Getz (Hyperfiddle) 2025-02-17T12:12:24.372489Z

electric v2 is superseded, that repo will not help you, the electric v3 tutorial is here: https://electric.hyperfiddle.net/

Dustin Getz (Hyperfiddle) 2025-02-17T12:14:38.269549Z

electric v3 starter app: https://gitlab.com/hyperfiddle/electric3-starter-app

🚀 1