by Betsy Haibel
ideas from 📕 Pedagogy of the Oppressed by Paulo Freire
Motivations for learning in tech and engineering:
- Emergency Learning (in response to a need)
- learners are in reactive mode, learning is goal-directed
Example from a Code Retreat
quadrants: 2 dimensions: early-career devs vs. peer devs, teaching new things vs. encouraging best practices
- avoid “teacher mode”, b/c it’s all about you
- their learning, their problem solving, their code is about them
Seniors: lead by example. Be a role model for the kind of senior developer you would like to see your more junior coworkers become
by Joy Heron
Experience: building the same kind of view over and over for different projects: a sortable, filterable data table displaying data from some kind of backend endpoint
Abstraction: Web Components
What’s in a Web Component?
-
definitely HTML to make it accessible and portable
- tip for testing whether component is accessible: actually use a screenreader!
-
probably CSS to make it beautiful
-
possibly JavaScript to make it interactive
Tabelle project (Rails example) (on Heroku)
before_validation
callbacks are a smell
- they make tests slow because they run always (opt-out exceptions such as
if email_changed?
is a symptom of that) - they violate SRP: validation or even view specific code in the model (persistence layer)
What to do instead?
- Form Objects (that can, for instance, inherit from ActiveModel in order to have validations)
- Inheritance: e.g. use the ActiveType library to make subclasses of your models that are specific to certain use cases (e.g. SignupUser that handles the validations relevant to the signup process)
- Elixir: Changesets
- Model Operations (the approach taken by Trailblazer and Hanami) – involves a lot of boilerplate code.
- Models are persistence-only, NO business code, NO validations in there
- you can stream in any Rack app by assigning an
Enumerator
toresponse.body
- it’s also possible to stream data to a file from Postgres, redirect that pipe into a Ruby process, transform it into CSV on the fly, and pass the stream on to the HTTP request ✨ https://github.com/bitcrowd/sql_to_csv_stream
Diagnosing Postgres Read Performance: EXPLAIN( ANALYZE, BUFFERS )
query
…are complex, but the complexity is often abstracted away from us by client libraries that make it appear simple.
- Communication between the nodes of a distributed system is invisible
- Internal organization is hidden
- Components are independent, which adds scalability and fault tolerance