Our #devs
channel is a cross-project, shared space where the entire dev team of SINAPTIA can ask questions, share opinions, and discuss interesting articles or tech they come across. The idea is to post a curated extract of what happens there every week.
Rails scaffold generator and admin interfaces
Patricio asked the team:
What do you do immediately after running
rails g scaffold ...
?
His idea was to challenge the team to think about what a basic scaffold needs to be completely functional without many modifications. Although the scaffold generator is a very powerful tool for admin pages (although a lot of work is needed), most devs tend to use Rails admin generators to do the job.
Patricio said that most admin interfaces are fundamental and most applications require at least some degree of modifications, either adding actions or showing information differently. With most of the solutions, doing so is difficult or time-consuming. Also, all of the admin interface solutions own the code, meaning that if you want to change something (views, controller actions, etc.), you have to rely on monkey patching, or copying templates into the project. Most of the time, the code is not very maintainable and feels unnatural to work with.
Fernando and Patricio concluded that it would be much nicer if there was a scaffold generator that could generate a completely customizable admin interface. By generating a model, controller, and views with pagination, search, etc. it would be much easier to modify the code as needed.
Fernando shared madmin, a solution in this line of thought, but with an extra layer on top. Not exactly what Patricio wanted, but it was a good starting point.
Backend/Frontend architecture
Fernando shared the architecture A. Howard uses for his Rails apps nowadays after years of iterating. The proposed architecture is interesting and somewhat polemic for our monolith-based mindset, the kind of mind challenges we usually like to bring into #devs. Summing it up extremely briefly:
- a pure js (next) app in the frontend
- a pure rails app in the backend
- supabase in the middle
The frontend posts jobs into supabase which the backend runs and sends the results back to the frontend via pub/sub. He makes very interesting points about it:
- no CORS or cookies issues between apps
- as there is no API, there’s no need to authenticate requests in the backend
- no JS or CSS handling in the backend (Rails deals purely with business logic)
- no Ruby or Rails intro for frontend devs (as both apps a completely independent)
- his teammates love it
We concluded that this architecture feels foreign to the way we do things and we wouldn’t use it for our next app, but the points sound super interesting and the tech combo it’s based on it’s worth trying out at least in a prototype. What do you think?
tailwindcss-rails
After talking with the team about “what’s missing in Rails’ scaffold generator?”, Patricio decided to contribute to the tailwindcss-rails project. His first contribution improved the scaffold generator by making a consistent width across all views, improving the buttons state, adding titles to all pages, using semantic colors, etc. (you’re encouraged to read the PR to see the full list of improvements), and was included in the 3.2.0 release.
We expect more contributions to come!
iMan
Fernando is playing with a collection of quickly-hacked scripts where he combines Ruby and AI. This time he shared iman (intelligent man page summarizer) that feeds man pages to an LLM to give you a friendly LLM-generated summary of the manpage. Similar to tl;dr and cheat.sh.
We expect more fun stuff to come from this collection!
Developers are gonna be replaced by AI
This is a hot topic lately. Fernando shared a quote from Andrew Ng:
Writing software, especially prototypes, is becoming cheaper. This will lead to increased demand for people who can decide what to build. AI Product Management has a bright future! Software is often written by teams that comprise Product Managers (PMs), who decide what to build (such as what features to implement for what users), and Software Developers, who write the code to build the product. Economics shows that when two goods are complements - such as cars (with internal combustion engines) and gasoline — falling prices in one leads to higher demand for the other. For example, as cars became cheaper, more people bought them, which led to increased demand for gas. Something similar will happen in software. Given a clear specification for what to build, AI is making the building itself much faster and cheaper. This will significantly increase demand for people who can come up with clear specs for valuable things to build.
The opinions of the team were varied:
- The majority agrees that AI often produces low-quality or incorrect output, requiring expert human review.
- Some said that AI is not accelerating the overall work significantly. But, AI is very good at simple, repetitive tasks (although, some of those might already have a non-LLM-based solution that works 100% of the time and consumes way less power)
- Fernando thinks that there’s a deep fascination with AI in its ability to interpret human-like commands and elaborate human-like responses, which fuel fantasies that bias the perception of reality.
- Nazareno said that Mark Zuckerberg predicted that AI might function like mid-level developers but he thinks that there will be minimal improvements in AI capabilities this year but better system integration.
The conclusion the team came to is that the original thesis is on the correct path but reached an incorrect conclusion: AI makes it easy to write a lot of code fast and not always good the main need will be experienced developers that can understand and analyze code. Experienced solution architects. Also, LLMs are quite capable of solving specific well-laid-out problems. Analyzing and properly laying problems so they can be easy to solve is also something that needs an experienced developer. So this might end up raising the bar for entry-level devs as they won’t be able to acquire this experience by working on a real-life project.
Link dump
Finally, some of the interesting stuff that has been shared in the channel:
On the AI front, Valentin and Fernando shared https://chatgpt.com/g/g-T82Ltp5JC-dataset-finder: A tool designed to assist users in locating and accessing various datasets for training, testing, and fine-tuning LLMs.
Two libraries similar to Ollama:
Diego brought us a video of the column
unix command: https://www.youtube.com/watch?v=uL7KvRskeog.
Related to the architecture discussion above: https://ngrok.com/docs/network-edge/#points-of-presence used to deploy and serve applications from almost anywhere (even a local machine).
Agustin shared the docs about a CSS TIL for customizing scrollbar appearance: https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-color.
And, in a similar vein, Juli shared the weirdness of overflow on the web: https://www.brunildo.org/test/Overflowxy2.html.
That’s it for this issue. See you around next week!