Thoughts on minimize code and maximize data philosophy

前端 未结 6 1707
小鲜肉
小鲜肉 2021-02-12 19:24

I have heard of the concept of minimizing code and maximizing data, and was wondering what advice other people can give me on how/why I should do this when building my own syste

6条回答
  •  时光说笑
    2021-02-12 19:32

    When I think of this philosophy which I agree with quite a bit, the first thing that comes to mind is code efficiency.

    When I'm making code I know for sure it isn't always anything close to perfect or even fully knowledgeable. Knowing enough to get close to maximum efficiency out of a machine when it is needed and good efficiency the rest of the time (perhaps trading off for better workflow) has allowed me to produce high quality finished products.

    Coding in a data driven way, you end up using code for what code is for. To go and 'outsource' every variable to files would be foolishly extreme, the functionality of a program needs to be in the program and the content, settings and other factors can be managed by the program.

    This also allows for much more dynamic applications and new features.

    If you have even a simple form of database, you are able to apply the same functionality to many states. You may also do all manner of creative things like changing the context of what your program is doing based on file header data or perhaps directory, file name or extension, though not all data is necessarily stored on a filesystem.

    Finally keeping your code in a state where it is simply handling data puts you in a state of mind where you are closer to envisioning what is actually going on. This also keeps the bulk out of your code, greatly reducing bloatware.

    I believe it makes code more maintainable, more flexible and more efficient aaaand I like it.

    Thank you to the others for your input on this as well! I found it very encouraging.

提交回复
热议问题