Тёмный
No video :(

Create a form using ClojureScript and Re-Frame 

Daniel Amber
Подписаться 3,9 тыс.
Просмотров 7 тыс.
50% 1

In this video, I cover the basics of creating a form and using form validation in re-frame.
Github link: github.com/dan...

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@KelvinMai
@KelvinMai 3 года назад
Definitely an underrated channel, good stuff here
@onthecodeagain
@onthecodeagain 3 года назад
Thanks for the kind words! :D
@gabrieldavid5944
@gabrieldavid5944 3 года назад
yeah, i think the same
@eugenej.5584
@eugenej.5584 3 года назад
In the animal form all fields are equal but some are more equal than others.
@eugenej.5584
@eugenej.5584 3 года назад
9:54 those were mainly pigs and the rest.
@onthecodeagain
@onthecodeagain 3 года назад
@@eugenej.5584 Glad someone got it :p
@eugenej.5584
@eugenej.5584 3 года назад
@@onthecodeagain No wonder, in soviet Ukraine reference gets you. Btw. Russian word "ссылка" both means "reference" like in "got the reference" and "exile" like in Gulag.
@isaacomy274
@isaacomy274 3 года назад
thanks a lot dudes, thats great video
@SebastianAnklamm
@SebastianAnklamm 3 года назад
Ah-mazing! Thanks for this. Also, you are making great use of the in-editor evaluation of expressions to demonstrate fns from the standard library (as with assoc-in). Makes what you are doing very clear. Question about the animal-list at the end. Does it make a difference if you deref the subscription directly in the let binding vs when using the animals var in the mapping?
@onthecodeagain
@onthecodeagain 3 года назад
Thanks a lot for watching! Im glad you enjoyed it :) I'm not 100% sure on this but I don't think it matters where you deref the subscription.
@javqui1102
@javqui1102 3 года назад
Cool video !!!
@onthecodeagain
@onthecodeagain 3 года назад
Thank you!
@diegonayalazo
@diegonayalazo 2 года назад
Thanks
@hayathbasha4519
@hayathbasha4519 3 года назад
Hi , There exist NodeJs,Python,Ruby available in market. May i know why we go with clojure and what advantage it brings us for application Im happy if you reply and even happy if you make video on it
@onthecodeagain
@onthecodeagain 3 года назад
It's possible I will make a video on this but as a quick answer, some key reasons you may prefer to use Clojure is that it's a purely functional language that gives you immutable data types, it has the repl so you can evaluate code on the fly and write applications quickly. It runs on the JVM and is quick, it has multi-threading and it uses simple data structures. It's also dynamically typed which I like. My personal feeling is that you should use a language that you feel makes you most productive and which suits your application :) It's best to choose what you want but it's good to know what choices you have.
@eugenej.5584
@eugenej.5584 3 года назад
Here's a Google translate of what I wrote to Ukrainian dude not so long ago :D *pros* 1 The main idea of ​​Clojure is "Simple made easy" - the supremacy of simple abstractions with high synergy over the familiar, familiar, abundance of syntactic sugar at the language level - "easy". Topics: Complexity as the main enemy of "Out of the Tar Pit", the difference between "accidental complexity" and "domain complexity", "why it is better to have many functions working with a small number of types" and the state as the main source of complexity. 2 Good two-way interop. protocols, records, expansion of Java types. These abstractions can also be used to create interesting features such as funcool / cats and smeared with monads. 3 Clojure is attended by (mostly) old people who love the craft. Few shit coders. Most of the ecosystem is written by experienced coders who know what they're doing and don't abuse macros. 4 Infinite Lisp extensibility. The EmacsLisp example is a major factor in why Emacs is still relevant. 5 At the same time, Clojure is not really a LISP. It adds [] for form binding and {} for metadata - this is an example of a rational approach to syntax. "decomplecting" brackets with different semantic categories. 6 Accretion policy is not to break legacy code. The fact that Clojure doesn't use the traditional Wooop with inheritance helps a lot with this. 7 "Multimethods and Hierarchies" as an alternative to Ooooooo. 8 Clojure has "immutability by default" (versus "mutability by default" as in Scala "Scala Collections: Why Not?") 9 Global immutability and "persistent data structures" are trivial to parallel (map ..) just add p (pmap ...) 10 Pure functions are easy to test, memoized and viewed as a black box. The JVM is very fond of simplicity and simple functions. 11 EDN is an alternative to JSON with extensibility, time format and Clojure code subtype EDN that allows you to manipulate code as data using a standard set of functions. Makes serialization trivial. 12 Clojure is uniquely suited to "REPL Driven Development" due to the homoiconicity and purity of functions, which allows you to change parts of the program while keeping the state. Demo "Interactive programming Flappy Bird in ClojureScript" 13 Spec is a killer feature. It allows you to describe the shape of data much more expressively and more accurately than a strong type system using the same language, the same set of functions instead of the lasso meta type language as in other functional languages. These descriptions can be bound to functions like "Design by Contract" using jeaye / orchestra, this can be done in the usual way - like types. For example, try using the type system to describe in your favorite language that a function that takes an array as an argument should return an array of the same length. This is trivial in Clojure. Spec also allows you to generate data that satisfies it. For example, for "generative testing". It even has a QuickCheck port with haskell, and it's easier to use in the dynamic language "generative testing" since you don't need to write generators for a bunch of types. The fact that tests (specs) are executed at runtime does not affect production as they can be disabled at the compiler level. 14 Unique blend of functionality with an emphasis on immutability and dynamic typing. The main feature of functional programming is immutability (no assignment). Typing in most languages ​​allows you to catch typos and simple errors at the cost of a boilerplate and fragility of the code. Since strongly typed code cannot have a partially valid state (for example, transitional during refactoring) and code that is expensive to change quickly decays. Tests with good coverage solve the type problem, serve as a specification, and allow granularity of code correctness. 15 Almost everything in klozhure is lazy - if no one came for the result of calculations, then it will not happen. 16 JVM is very important to Clojure. First, the JVM is designed with a focus on dynamism and lazy loading. She can inline code, rewrite polymorphic calls into monomorphic ones, deduce types, re-optimize code based on the current load. Secondly, it is a huge ecosystem of ready-made solutions. And since Clojure is just a library, it can be pulled into the JVM project. 17. Clojure's design takes into account the 80/20 rule (20% of the effort yields 80% of the result) - naive Clojure code by default balances versatility, performance, and security. But for the critical 20% (and usually 3%) there is an opportunity to go down to a level lower. You can use math functions without overflow check, you can add type hints to get rid of reflexes. It is possible to create local mutability using volatil or transient, use a transducer instead of macro threading. Finally, you can rewrite the function in Java and call it from Clojure. It is extremely rare to prescribe since the optimized code in Clojure is compiled into approximately the same bytecode as in Java, it even without a tambourine is compiled into native code through GraalVM (unlike other dynamic languages) *Cons* 1 Bus factor - If someone hardens Rich then you can start learning Kotlin. 2 Entry threshold - Unusual syntax requiring an editor with the need to learn basic key combinations so as not to edit the brackets by hand. Immunity by default also requires a shift in consciousness. An attempt to simultaneously learn a new paradigm, syntax and Emax will most likely end up badly. Despite the fact that the language itself is quite simple and has a minimal syntax, its standard library is bottomless. The core namespace is a real trash heap into which everything that is possible is crammed. There are 5 ways to make something mutable with different constraints. A whole bunch of ways to combine functions: comp, miscellaneous threading macros -> - >> ... transducers, nesting (foo (bar x)) ... The laziness of the language sometimes throws unexpected surprises too.Especially when you work with side effects (for example, you want to printline debug something), the worst is when it is combined with macros ... Despite the fact that macros are very cool, there is always a temptation to smear them over your ears and write in your cozy language that you know only you. And also chtuk 17 primitives for working with streams and asynchronous code. Fortunately, no one uses most of them. The problem with all this abundance is that the threshold for entering into reading someone else's code becomes much higher.that the threshold of entering into reading someone else's code becomes much higher.that the threshold of entering into reading someone else's code becomes much higher. 3 Performance, although good, is extremely unpredictable. The Clojure compiler does its magic, then the JVM hotspot wraps around ... 4 There is no standard approach to organizing code at the system level. 5 Hell's stacktrace. 6 In other languages, types often play the role of documentation that editors know how to work with. 7 In other languages, types often play the role of documentation that editors know how to work with. In Clojure, you often need to encode additional information in names. For example, let's say we have a function that converts a shopping cart from JSON to EDN. In Clojure, its name could be something like customer-order-json-> customer-order-edn Now let's imagine that JSON comes to us in a lazy form (we need to dereference it before using it) and someone decided that our function is a convenience for the sake, it should take the reference as input. Then its name would look something like this customer-order- * json-> customer-order-edn The "*" sign is considered to be a symbol of the fact that the value is a reference (by analogy with pointers in the link), now imagine that it is also a dynamic variable * customer -order- * json->customer-order-edn * and control in the head - there is another function like this but not with everyone and its name is * customer-order- * json-> customer-order-edn ** how do you like this Elon Musk? Integration of Spec with the editor will partially help solve this problem. 8 With the help of types (with sweat and blood), you can prove the validity of a program at compile time. Spec has a lot of advantages, but nevertheless it only allows you to catch disabled people at runtime. 9 Editors love types for linting, autocomplete, refactoring. Compilers love them too, especially for removing dead code (which would greatly help reduce the minimum size of ClojureScript projects) 10 After Clojure, it hurts to code in other languages, but sometimes you have to.
@onthecodeagain
@onthecodeagain 3 года назад
@@eugenej.5584 Awesome response. I really need to make a video on Spec. con 10 haha
@Nathankthanks
@Nathankthanks 2 года назад
Is it just me or is there a performance issue when typing into the input field? It seems like the event loop is chasing its own tail.
@onthecodeagain
@onthecodeagain 2 года назад
I also noticed that... I think I should actually move the state around a bit to maybe get rerenders down.
@carlos9195
@carlos9195 3 года назад
Hi, What theme do you use for VSCode? Thanks
@onthecodeagain
@onthecodeagain 2 года назад
marketplace.visualstudio.com/items?itemName=BeardedBear.beardedtheme :)
@garloin
@garloin 2 года назад
Too fast without any good explanation of what happening, no context no nothing,what you can do is copy and paste what is happening in the screen...in my opinion unless you are and advance programmer.
@onthecodeagain
@onthecodeagain 2 года назад
Sounds like you'd be better off reading a book
@garloin
@garloin 2 года назад
@@onthecodeagain could be...
Далее
Deploy a ClojureScript Re-Frame app to  Firebase
4:11
Просмотров 1,1 тыс.
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Просмотров 2,9 млн
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Просмотров 10 млн
ClojureScript re-frame routing tutorial
28:30
Просмотров 3,5 тыс.
Banking on Clojure by James Trunk
36:28
Просмотров 8 тыс.
ClojureScript: React with a Hiccup by David Vujic
33:58
Use Clojure to build an API
33:24
Просмотров 10 тыс.
Clojure maps! Everything you need to know!
12:55
Просмотров 3,7 тыс.
50 clojure.core functions in 50 minutes
45:47
Просмотров 3,2 тыс.
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Просмотров 2,9 млн