Hacker News new | ask | show | jobs
by codegeek 4523 days ago
I look at this in 2 ways. One is "Learning how something really works and understanding the core" and the other is "Creating production ready applications with a tested abstract magical tool". Frameworks are great to create production ready apps in no time even for a novice. But on the other hand, they have too much magic at times. Take for example, this code in Python/Django:

    user = User.objects.create_user('name', 'email', 'pwd')
    user.save()
In 2 lines of magical code, we are able to create a user object and make sure we are able to save it in the database without worrying about a lot of things. This is great for rapid app building. But what is really happening behind the scenes ? Do you really understand the flow for user.save(). How would you do it without this abstraction ? If you don't understand the core, you will never be able to become a great developer.

So my advice overall is to learn the core by writing stuff from scratch as much as possible and really understand how things work. Then, pick a framework and do the same. So even though you will write crappy bad quality code, you don't need to release that in production. Win-Win here.

2 comments

The problem is how do we define "from scratch", the common definition seems to be "Whatever I had to do when I started".

Even if you throw out of the ORM and go with writing SQL queries by hand, do we need to understand how the database will parse the SQL, how it stores the data on disk and how it executes the query?

The main reason to understand SQL when building a web application is really that the ORM doesn't provide a full abstraction due to the differences between the relational model and the OO model. If we could solve that then we could happily never use SQL again.

Agreed. There is always a limit when it comes to going low level. Yes it probably is an overkill to understand how a db parses an actual SQL but helpful to understand how an ORM converts to a SQL query. This is again contextual. If you are writing your own database, then may be you do want to understand the parsing. But for web dev, may be not.
> Yes it probably is an overkill to understand how a db parses an actual SQL

Yes, I've thought that, too, but it turns out that, beyond a certain relatively low level of complexity, that's a great way to produce SQL queries which take a half hour to complete.

> but helpful to understand how an ORM converts to a SQL query.

Certainly, because there's a degree of complexity beyond which your ORM's going to start getting pathological and you're going to have to fall back on querying the database directly, which see point one.

> If you don't understand the core, you will never be able to become a great developer.

The presumption here is that everyone wants to be a great developer; this mostly isn't true, most developers simply want to complete a task and care only about how quickly they can do it.