Should We Still Write Technical Note - Style Blogs After the Emergence of Large Language Models?

I started writing blogs in 2020, mainly focusing on technical notes. I recorded some problems I encountered during my technology learning process, with topics mainly including VUE, Django, Django Rest Framework, DevOps, etc.

At the beginning of last year, ChatGPT suddenly became extremely popular in China. I also started using it in my daily work in February. The more I used the large language model, the less motivated I was to write technical notes.

I felt that the words I spent a lot of energy writing would no longer be read by anyone. It would be better to just use the large language model directly.

For example, in this blog, I wrote about how to do authentication, permission identification, and throttling in Django Rest Framework. I estimate that it would take at least an hour for a newbie to understand this blog and correctly apply the content to their own code. But if they ask the large language model, they can get an answer in 1 minute.

For example, I asked GPT4: “Introduce in detail how to do authentication, permission identification, and throttling in Django Rest Framework, with actual case code for reference.”

The following is GPT4’s answer, which took less than 1 minute.

Django Rest Framework (DRF) provides a complete set of authentication, permission management, and throttling solutions. I’ll introduce them separately below.

  1. Authentication

DRF’s authentication solutions include BasicAuthentication, SessionAuthentication, TokenAuthentication, etc. You can choose the appropriate authentication method according to your needs, or customize the authentication method.

Take TokenAuthentication as an example. First, you need to define the User model in the models.py file of your app, and then define the UserAuthToken view in the views.py file:

1
2
3
4
5
6
7
8
9
10
11
>from rest_framework.authtoken.views import ObtainAuthToken
>from rest_framework.authtoken.models import Token
>from rest_framework.response import Response

>class UserAuthToken(ObtainAuthToken):
def post(self, request, *args, **kwargs):
serializer = self.serializer_class(data=request.data, context={'request': request})
serializer.is_valid(raise_exception=True)
user = serializer.validated_data['user']
token, created = Token.objects.get_or_create(user=user)
return Response({'token': token.key})

Add a route in urls.py:

1
2
3
4
5
6
>from django.urls import path
>from .views import UserAuthToken

>urlpatterns = [
path('api-token-auth/', UserAuthToken.as_view(), name='api_token_auth'),
>]
  1. Permission Identification

DRF provides IsAuthenticated, IsAdminUser, IsAuthenticatedOrReadOnly and other permission management methods. You can also customize the permission management method.

Take IsAuthenticated as an example. Use it in the views.py file:

1
2
3
4
5
6
7
8
9
10
11
>from rest_framework.permissions import IsAuthenticated
>from rest_framework.views import APIView

>class ExampleView(APIView):
permission_classes = [IsAuthenticated]

def get(self, request, format=None):
content = {
'status': 'request was permitted'
}
return Response(content)
  1. Throttling

DRF provides AnonRateThrottle, UserRateThrottle, ScopedRateThrottle and other throttling methods. You can also customize the throttling method.

Take AnonRateThrottle as an example. Set it in settings.py:

1
2
3
4
5
6
7
8
>REST_FRAMEWORK = {
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
],
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
}
>}

The above code sets that anonymous users can only make a maximum of 100 requests per day.

The above are the basic usage methods of authentication, permission identification, and throttling in DRF. You need to choose and adjust according to actual needs.

Seeing such an answer, I really lost the motivation to painstakingly write blogs. Because the blogs I write may not be better than what the large language model generates. Moreover, others can interact with the large language model in real - time to get answers that better suit their needs.

So, as can be seen, I basically didn’t write any technical note - style blogs in 2023.

However, as I used the large language model in my work for a longer time, I changed my mind. I think it is still necessary to write technical note - style blogs.

Although the large language model can help me write code faster and use new technologies more easily, the behavior of always using the output of the large language model, copying and pasting it into VScode, and then modifying it to complete the development task makes me overlook many details. And many times, I don’t really master the technology behind the content output by the large language model. I just copy it and use it.

There are two benefits of writing technical note - style blogs: review and re - thinking.

To write the notes completely and smoothly, you must be very clear about the entire knowledge point. If there are parts you don’t know or are not clear about, you will find them when writing the notes, and then you will look them up, figure them out, and then continue writing. This is equivalent to checking for gaps and filling them, and often deepens your impression of this knowledge point. Although large language models like GPT are very useful, if we rely on them for everything, what’s the use of engineers like us? In the end, only what we master ourselves is reliable.

Regarding re - thinking, this is what I think is the biggest gain from writing blogs.
I often only have a general idea when I start writing a blog. I think while writing, and after I finish writing, I find that my thoughts are straightened out.
Sometimes, while writing, I suddenly come up with an idea that I didn’t realize before, and then I can think along this idea and gain something. And many times, the ideas that come to mind in this way are quite unique.

For example, as I write this, I suddenly think of the time when I was in high school, going home to do homework after evening self - study. I often entered a state of self - forgetfulness (now I know this is called flow). Now, I rarely enter this state because, whether at work or in life, there are always various things that suddenly interrupt my rhythm. Occasionally, I can enter this state when writing blogs or code.

Finally, I want to say that I will still write some technical note - style blogs in the future to help myself review and think. The large language model is just a tool, and we can’t rely on it completely.