HNHacker News
TopNewBestAskShowJobs

jmconfuzeus

200 karma · joined April 6, 2021

Python (Django, Django REST Framework) and Javascript (Typescript, React) developer from Mauritius.

I'm available for work.

Find my website at https://joshkaramuth.com

submissionscomments
jmconfuzeus··on Harmful Defaults in Django
You'd be surprised how many developers are working on Django projects right now who have never written a line of SQL in their entire lives.

Instead of thinking about data and business logic, they're preoccupied by code and separation of concerns. That's why we end up with database that are unqueryable from outside of Django's ORM itself.

Good luck if you end up working in a project that makes heavy use of GenericForeignKeys.

jmconfuzeus··on Harmful Defaults in Django
You pulled only the good ones. Where are the migrations named 0019_auto_20181224.py?
jmconfuzeus··on Harmful Defaults in Django
I consider them harmful for beginners who need to start working on non trivial production code.

Multiple apps are definitely good for the admin but what I was advocating isn't 100% avoidance of apps but to avoid creating apps for every tiny feature.

Personally, I like my databases to be designed for longevity and avoid couple code to my data. Code can die at any point in time but data is an asset that needs to live for as long as the company is in operation.

jmconfuzeus··on Harmful Defaults in Django
I never said that people need to stop using Django. It's still my favorite framework and will continue to be.

I just wanted to point out some mistakes that many beginners make and that I made when I first started.

Personally, I think Django could use better opinions from the core team because beginners should be set for success by default. In the current state, that's not the case.

jmconfuzeus··on Harmful Defaults in Django
Good point! Django is full of surprises like this and it would take an eternity to enumerate all of them.

inb4 some grumpy guy shoots me down for claiming that his favorite framework isn't perfect.

jmconfuzeus··on Harmful Defaults in Django
Many developers never look at the SQL panel in debug toolbar. That's why I'm advocating to evaluate QuerySets before presenting any data.

It's just a way to make less mistakes.

jmconfuzeus··on Harmful Defaults in Django
I wrote this post for beginners and most of them never read the docs before hacking on production code.

Lazy querysets aren't dangerous but it's always best to evaluate them before rendering anything in order to avoid secret SQL queries. Many developers never run EXPLAIN, so these extra queries go unnoticed until your server crashes during Black Friday.

I don't see why your database table needs to encapsulate the app's name. Most apps get rewritten at some point but databases can live for centuries. Why couple code with your data?

Maybe I should be more humble to please sensitive people like you but no thanks. If a simple blog post hurts your feelings then you need to professional help.

jmconfuzeus··on Harmful Defaults in Django
It's easier to notice expensive SQL queries in the view vs in the template.

Anyone who claims that it's fine to run queries in templates has smoked something really good. Personally, I'll continue to aggregate all my data using JOINs before presenting them.

jmconfuzeus··on Harmful Defaults in Django
No need to hash password if you subclass AbstractUser.

Tell me, if I have {{ customer.auth_user.email }}. Where in this line of code does it say that a SQL query is going to be performed? So much love for lazy queries eh.

You're so new to Django and yet you pretend to understand everything.

I don't understand how I'm supposed to help someone like you. I hope your tech lead is able to guide you through this.

jmconfuzeus··on Harmful Defaults in Django
1. How are you supposed to change the concrete User model that Django provides without forking Django itself? It's 1000x better to subclass AbstractUser and provide your own User model that you own.

2. One migration file per model is easier to manage. It's my opinion of course, but think about how you'd squash migrations for old models if you're in the habit of bundling multiple RunPython or RunSQL methods in the same migration file.

I wish you'd think straight instead of being angry. It's not like I'm claiming that the earth is flat.

jmconfuzeus··on DIY Mail
Scrolling on this web page is really annoying.
jmconfuzeus··on Ask HN: Working with large code base for the first time
VSCode is pretty barebones. You'll need to setup a language server and figure out how to search everywhere and also learn grep in the process if you don't know it already.

In Webstorm, you just press on Shift twice and a popup appears that allows you to search for everything you need. Since the IDE indexed all symbols in your project already, you'll be able to quickly find whatever you need.

jmconfuzeus··on Ask HN: Freelancer? Seeking freelancer? (December 2021)
SEEKING WORK | Mauritius | Remote

Fullstack Django developer with experience in devops.

Looking for opportunities in SaaS and CMS based projects.

Email me michael@confuzeus.com for a quick intro.

jmconfuzeus··on Django 4.0 release candidate 1 released
There's a "through" argument for the ManyToManyField that allows you to specify a custom model to track relationships.

Then there's InlineModelAdmin that allows you to integrate your relationships in the admin.

You gave up instead of reading the docs.

jmconfuzeus··on The Evolution of Jamstack
Sounds like you built something for yourself instead of building something that the market wants.

Every non technical person I've spoken with loves Wordpress and Squarespace for good reason.

jmconfuzeus··on The Evolution of Jamstack
They don't want to build the whole interface but they sure want to move things around and try out pages with different layouts.

The goal is to allow them to ship marketing experiments as quickly as possible. With Jamstack, they always have to wait on the developer.

The only people who enjoy Jamstack are developers themselves because it's a cool toy to play with. I used to like playing around with Gatsby and Contentful 3 years ago. Then I decided that businesses need to make money and I can't be doing what I find fun to use at the detriment of the ecosystem.

jmconfuzeus··on The Evolution of Jamstack
Not just Git, marketing people also hate headless CMSes because they're hard to use and make it more complicated to try new things out. You have to use different tools to build forms, pages, and track users. Even as a developer I think it's a nightmare.

They best way to build a website is by using something like Elementor or Webflow so that engineers can spend time building useful things instead of reinventing the wheel.

Block based CMSes like Wagtail are also very good because unlike page builders, you get good performance. Of course, there will be additional development costs.

In the end, it's very important to not require development time for every little experiment your marketing team needs to carry out and with Jamstack you always need to bother your developer when you need to make a change.

jmconfuzeus··on The Evolution of Jamstack
Jamstack sounds good on paper but it causes too much trouble for marketing people.

The role of a website is to do marketing and if your marketing people can't easily work with it then it's a failure of a website.

jmconfuzeus··on Snowden Dunks on 'The Get-Rich-Quick Real Estate Investing Conference
There's also Coffeezilla and Spencer Cornelia. We need more people to talk publicly about these things so that less and less people can get scammed.
jmconfuzeus··on Squarespace S1
How did you do that?
jmconfuzeus··on Django 3.2
This is one of the reasons why I'm moving to Rails. Frontend work is quite hard with templates and most of the community has moved towards Reactjs because of that, which I don't like.

I think they designed it this way because they assumed that the backend and front developers would be different persons/teams, which makes sense for many projects but for me I'm just a solo dev trying to get work done as fast as possible.

The way Rails does things with ERB makes total sense. DHH himself said that Rails was designed in a way that a single dev can take the framework and build something with it, no teams, no microservices, just plain Rails.

ERB is more dangerous than Django Templates but I like it when a framework doesn't try to protect me from myself.

← PreviousPage 4 of 4