HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Bottom Up vs Top Down Design in Clojure - Mark Bastian

ClojureTV5 HN recommenders · recommended in 7 months, 2016-2021
YouTube
29K views · 10 years ago · talk · evergreen

Mark Bastian contrasts top-down object-oriented design with bottom-up, data-oriented design in Clojure. He models a board game as plain data plus small composable functions and compares it with a roughly 22-class OOP version.

HN repeatedly recommends it as the talk that made data-oriented, REPL-driven bottom-up design click.

Functional programmingSoftware architecture & design#clojure#data-orienteddesign#oopvsfunctional#repl#boardgames

7 comments from Hacker News

@robto2021 · in “Making a Lego Domino Machine [video]”

This strikes me as a perfect visual example of repl-driven development. I like how he starts very simple and slowly makes it more sophisticated, testing every step of the way. If you've never tried it before, I highly recommend giving it a shot - it's extremely satisfying. I use Clojure, but other lisps also have fantastic repl environments that facilitate this style of development. "Bottom Up vs Top Down Design in Clojure"[0] is the talk that really made it clear to me how to design programs this way. [0] ▶ this video

Strongly recommendsView on HN
@beders2019 · in “Show HN: Tetris Implemented in ClojureScript”

I picked on needless complexity due to top-down design not on static typing per se. Here's a good video highlighting the difference of approach. Well worth watching. Applies to how many Java architects would design a solution. I see the same kind of top-down approach happening in the Typescript area as well. ▶ this video

Strongly recommendsView on HN
@lewisl90292018 · in “How I Learned to Stop Worrying and Love the State Machine”

This is exactly my impression after taking a quick glance through these articles as well. If anyone is curious and would like to see a practical demonstration of this data-oriented approach of modelling problems, I highly recommend this talk from Mark Bastian in Clojure/conj 2015: ▶ this video In it, he contrasts the data-oriented modelling approach with a traditional OOP approach for implementing a board game, and was able to come up with a complete implementation of the game with the former approach that was shorter than even the structural boilerplate for the OOP version. Another related talk that I loved was Chris Granger's 2013 talk on Light Table: link Where he walks through his process of building a game in ClojureScript using an Entity-Component-System architecture, which is very well suited to this data oriented modeling approach.

Strongly recommendsView on HN
@abc_lisper2017 · in “Making the move from Scala to Go”

I see what you are trying to say. You are saying Clojure is not the right tool to do top-down design. I agree with it. It is however a very good tool to do bottom up design. See ▶ this video

RecommendsView on HN
@cygned2016 · in “Modern Software Over-Engineering Mistakes”

I think, a "Data Driven Development" approach would make a lot of implementations easier. Something as described in this talk: ▶ this video

RecommendsView on HN
@lewisl90292016 · in “A Database Model for Simple Board Games”

I personally prefer a more data-oriented approach to modeling, as opposed to modeling in terms of objects and relations. One of my favorite videos from Clojure Conj last year talks about the approach in more detail and contrasts it with traditional OO modeling in the context of a board game: ▶ this video In summary, modeling the board game with data (state) and pure functions (state transitions) had significant benefits over the alternative OO style model in terms of the overall simplicity of the model. The OO modeling approach resulted in a model that consisted of 22 classes, 11 interfaces, 1 enum, and 271 lines of boilerplate code just to implement the classes and relationships alone, with no game logic whatsoever. On the other hand, the data-oriented approach produced an entire working implementation of the game logic in 144 lines using 31 functions (small and highly composable functions, longest of which was 7 lines). My takeaway was that modeling in the traditional OO style can be a helpful process in getting a good feel for your problem domain at a high level, but trying to immediately translate the resulting relationship model into code is not necessarily a good idea, because the classical OO relationship model is inherently highly complected, and will bring that complexity straight into your codebase if you try to translate it word-for-word. Taking the insights from your relational model and using it as a guide to help model your problem domain as data and functions usuall

Strongly recommendsView on HN
@lewisl90292016 · in “Ask HN: Why don't more web projects start with a JVM stack?”

Thanks for the link. That made my day. =) Here's a more realistic comparison between classic Java OOP design vs the more data-oriented approach to design encouraged in functional languages like Clojure for a simple board game: ▶ this video TL;DW: The classic OOP design of the board game ended up with 22 classes, 11 interfaces, 1 enum in total, with 271 lines of pure skeleton code with no implementation of any game logic whatsoever. The class diagram can be seen here for a better sense of the complexity involved: ▶ this video The data-oriented design had 31 functions, longest of which is 7 lines, with a grand total of 144 lines of code that implements the entirety of the game logic.

RecommendsView on HN
Effective Programs - 10 Years of Clojure - Rich Hickey1:14:52

Effective Programs - 10 Years of Clojure - Rich Hickey

ClojureTV
176K views • 9 years ago
Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure53:56

Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure

jasonofthel33t
119K views • 13 years ago
"Simple Made Easy" - Rich Hickey (2011)1:01:39

"Simple Made Easy" - Rich Hickey (2011)

ClojureTV
434K views • 5 years ago
Clojure for Lisp Programmers Part 1 - Rich Hickey1:28:59

Clojure for Lisp Programmers Part 1 - Rich Hickey

ClojureTV
25K views • 13 years ago
Solving Problems the Clojure Way - Rafal Dittwald1:02:26

Solving Problems the Clojure Way - Rafal Dittwald

Clojure/north
87K views • 7 years ago
Zach Oakes - Making Games at Runtime with Clojure37:34

Zach Oakes - Making Games at Runtime with Clojure

ClojureTV
31K views • 11 years ago
Simplicity Ain't Easy - Stuart Halloway50:01

Simplicity Ain't Easy - Stuart Halloway

ClojureTV
24K views • 13 years ago
Barliman: trying the halting problem backwards, blindfolded - William Byrd, Greg Rosenblatt36:14

Barliman: trying the halting problem backwards, blindfolded - William Byrd, Greg Rosenblatt

ClojureTV
8K views • 9 years ago
"Simple Made Easy" - Rich Hickey (2011)1:01:39

"Simple Made Easy" - Rich Hickey (2011)

Strange Loop Conference
219K views • 5 years ago
Maybe Not - Rich Hickey1:03:29

Maybe Not - Rich Hickey

ClojureTV
181K views • 7 years ago
Brian Goetz - Stewardship: the Sobering Parts1:03:31

Brian Goetz - Stewardship: the Sobering Parts

ClojureTV
39K views • 11 years ago
Object-Oriented Programming is Bad44:35

Object-Oriented Programming is Bad

Brian Will
2.6M views • 10 years ago
"Clojure in Unity 3D: Functional Video Game Development" by Ramsey Nasser and Tims Gardner46:22

"Clojure in Unity 3D: Functional Video Game Development" by Ramsey Nasser and Tims Gardner

Strange Loop Conference
24K views • 12 years ago
Are We There Yet - Rich Hickey1:10:05

Are We There Yet - Rich Hickey

Zhang Jian
24K views • 7 years ago
Anthony Marcar - Clojure At Scale @WalmartLabs39:41

Anthony Marcar - Clojure At Scale @WalmartLabs

ClojureTV
24K views • 11 years ago
The Language of the System - Rich Hickey1:02:50

The Language of the System - Rich Hickey

ClojureTV
174K views • 13 years ago
Clojure Concurrency - Rich Hickey2:32:39

Clojure Concurrency - Rich Hickey

ClojureTV
73K views • 13 years ago
Om Next - David Nolen46:18

Om Next - David Nolen

ClojureTV
44K views • 11 years ago
Stuart Sierra - Components Just Enough Structure41:19

Stuart Sierra - Components Just Enough Structure

ClojureTV
36K views • 12 years ago
Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple4:57

Rich Hickey rants about HttpServletRequest in 1080p: Death By Specificity from Clojure Made Simple

Fred Overflow
43K views • 6 years ago