Generally, to learn anything, you need a learning framework that focuses on
* structured detail - ie how things connect to other things. For example, when you use a list comprehension in python, what is the equivalent for loop syntax?
* differentiability - i.e what happens if you do something different. For example, if you don't close a file descriptor, what happens? If you use string instead of bytes, what happens?
If you try to learn with a "how to do stuff" approach, you end up with having an internal lookup map where you can't reason through code if the knowledge is not in the map.
So for prompts, asking the LLMs those style questions goes far.
What about asking it to always use pure functions. In theory they are stateless, easier to test, and you can also have the LLM write the tests which should illustrate what arguments the function should have and what the expected output should be.
This usually lets you build a cleaner mental model of what is happening, and then you can think clearer about composition of functions where each building block is confirmed to be working because you have tests.
At least that’s how I would use an LLM to help me.
In general though it might be worth spending time on the architecture of whatever you are building as well, this requires thinking on your part rather than a fancy prompt, but you can also use the LLM to help bounce ideas off and suggest common architectures.
For example in Python you can get really far with just pure functions and the majority of classes you use being dataclasses and minimal methods /minimal OOP stuff to model your domain and data shapes.
Thanks that’s exactly the type of guidance I was hoping for. I’m trying to think more of architecture now that I move from basic (50-150 LoC) scripts to more complex applications, I’ll try to read up on good practices suited to my skill level on that front
Generally, to learn anything, you need a learning framework that focuses on
* structured detail - ie how things connect to other things. For example, when you use a list comprehension in python, what is the equivalent for loop syntax?
* differentiability - i.e what happens if you do something different. For example, if you don't close a file descriptor, what happens? If you use string instead of bytes, what happens?
If you try to learn with a "how to do stuff" approach, you end up with having an internal lookup map where you can't reason through code if the knowledge is not in the map.
So for prompts, asking the LLMs those style questions goes far.
What about asking it to always use pure functions. In theory they are stateless, easier to test, and you can also have the LLM write the tests which should illustrate what arguments the function should have and what the expected output should be.
This usually lets you build a cleaner mental model of what is happening, and then you can think clearer about composition of functions where each building block is confirmed to be working because you have tests.
At least that’s how I would use an LLM to help me.
In general though it might be worth spending time on the architecture of whatever you are building as well, this requires thinking on your part rather than a fancy prompt, but you can also use the LLM to help bounce ideas off and suggest common architectures.
For example in Python you can get really far with just pure functions and the majority of classes you use being dataclasses and minimal methods /minimal OOP stuff to model your domain and data shapes.
Thanks that’s exactly the type of guidance I was hoping for. I’m trying to think more of architecture now that I move from basic (50-150 LoC) scripts to more complex applications, I’ll try to read up on good practices suited to my skill level on that front