How can I avoid always feeling like if I completely rebuilt my program from scratch I'd do it much better?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I have learned a significant amount of coding however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been.. messy... I've noticed now that whenever I build some type of program, by the end, I realize how I could have done it far more elegantly, far more efficiently, and in a way that is far more flexible and easy to manage going forward. In some circumstances, I've actually gone back and rebuilt things from the ground up, but usually this is not practically feasible. While most of my programs so far have been relatively small, it seems quite unwieldy to completely rewrite large programs every time you create something... I'm just wondering, is this a normal experience? If not, how do you prevent this from happening? I've tried planning things in advance, but I can't seem to really foresee everything until I start hammering out some code.










share|improve this question







New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • If you're going to downvote, care to explain why...?
    – Ashish
    3 hours ago






  • 5




    its normal, program more
    – Ewan
    3 hours ago










  • Relevant.
    – Neil
    49 mins ago














up vote
4
down vote

favorite












I have learned a significant amount of coding however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been.. messy... I've noticed now that whenever I build some type of program, by the end, I realize how I could have done it far more elegantly, far more efficiently, and in a way that is far more flexible and easy to manage going forward. In some circumstances, I've actually gone back and rebuilt things from the ground up, but usually this is not practically feasible. While most of my programs so far have been relatively small, it seems quite unwieldy to completely rewrite large programs every time you create something... I'm just wondering, is this a normal experience? If not, how do you prevent this from happening? I've tried planning things in advance, but I can't seem to really foresee everything until I start hammering out some code.










share|improve this question







New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • If you're going to downvote, care to explain why...?
    – Ashish
    3 hours ago






  • 5




    its normal, program more
    – Ewan
    3 hours ago










  • Relevant.
    – Neil
    49 mins ago












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I have learned a significant amount of coding however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been.. messy... I've noticed now that whenever I build some type of program, by the end, I realize how I could have done it far more elegantly, far more efficiently, and in a way that is far more flexible and easy to manage going forward. In some circumstances, I've actually gone back and rebuilt things from the ground up, but usually this is not practically feasible. While most of my programs so far have been relatively small, it seems quite unwieldy to completely rewrite large programs every time you create something... I'm just wondering, is this a normal experience? If not, how do you prevent this from happening? I've tried planning things in advance, but I can't seem to really foresee everything until I start hammering out some code.










share|improve this question







New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have learned a significant amount of coding however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been.. messy... I've noticed now that whenever I build some type of program, by the end, I realize how I could have done it far more elegantly, far more efficiently, and in a way that is far more flexible and easy to manage going forward. In some circumstances, I've actually gone back and rebuilt things from the ground up, but usually this is not practically feasible. While most of my programs so far have been relatively small, it seems quite unwieldy to completely rewrite large programs every time you create something... I'm just wondering, is this a normal experience? If not, how do you prevent this from happening? I've tried planning things in advance, but I can't seem to really foresee everything until I start hammering out some code.







programming-practices project-management development-process coding-standards






share|improve this question







New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









Ashish

261




261




New contributor




Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Ashish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • If you're going to downvote, care to explain why...?
    – Ashish
    3 hours ago






  • 5




    its normal, program more
    – Ewan
    3 hours ago










  • Relevant.
    – Neil
    49 mins ago
















  • If you're going to downvote, care to explain why...?
    – Ashish
    3 hours ago






  • 5




    its normal, program more
    – Ewan
    3 hours ago










  • Relevant.
    – Neil
    49 mins ago















If you're going to downvote, care to explain why...?
– Ashish
3 hours ago




If you're going to downvote, care to explain why...?
– Ashish
3 hours ago




5




5




its normal, program more
– Ewan
3 hours ago




its normal, program more
– Ewan
3 hours ago












Relevant.
– Neil
49 mins ago




Relevant.
– Neil
49 mins ago










2 Answers
2






active

oldest

votes

















up vote
7
down vote













This is a very common experience



Most people I interact with, and I myself as well, feel like this. From what I can tell one reason for this is that you learn more about the domain and the tools you use as you write your code, which leads you to recognize many opportunities for improvement after you've already written your program.



The other reason is that you might have an idea in your head about the ideal clean code solution and then the real world and its messy limitations get in your way, forcing you to write imperfect work-arounds and hacks that may leave you dissatisfied.



"Everyone has a plan until they get punched in the face."



What to do about it



To some degree you will have to learn to accept that your code will never be perfect. One thing that helped me with that is the mindset of "If I hate the code I wrote a month ago, it means I have learned and become a better programmer".



A way to alleviate the issue is to constantly be on the lookout for potential improvements as you work and refactor continuously. Make sure to hit a good balance between refactoring and adding new features / fixing bugs. This won't help with big design issues, but it will generally leave you with a more polished code base you can be proud of.






share|improve this answer








New contributor




Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
    – David Arno
    1 hour ago

















up vote
0
down vote













Learn refactoring - the art of gradually improving code. We all learn all the time, so it is very common to realize that the code you have written yourself could be written in a better way. But you should be able to transform the exiting code to apply these improvements without having to start from scratch.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "131"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Ashish is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f380597%2fhow-can-i-avoid-always-feeling-like-if-i-completely-rebuilt-my-program-from-scra%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    7
    down vote













    This is a very common experience



    Most people I interact with, and I myself as well, feel like this. From what I can tell one reason for this is that you learn more about the domain and the tools you use as you write your code, which leads you to recognize many opportunities for improvement after you've already written your program.



    The other reason is that you might have an idea in your head about the ideal clean code solution and then the real world and its messy limitations get in your way, forcing you to write imperfect work-arounds and hacks that may leave you dissatisfied.



    "Everyone has a plan until they get punched in the face."



    What to do about it



    To some degree you will have to learn to accept that your code will never be perfect. One thing that helped me with that is the mindset of "If I hate the code I wrote a month ago, it means I have learned and become a better programmer".



    A way to alleviate the issue is to constantly be on the lookout for potential improvements as you work and refactor continuously. Make sure to hit a good balance between refactoring and adding new features / fixing bugs. This won't help with big design issues, but it will generally leave you with a more polished code base you can be proud of.






    share|improve this answer








    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

















    • The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
      – David Arno
      1 hour ago














    up vote
    7
    down vote













    This is a very common experience



    Most people I interact with, and I myself as well, feel like this. From what I can tell one reason for this is that you learn more about the domain and the tools you use as you write your code, which leads you to recognize many opportunities for improvement after you've already written your program.



    The other reason is that you might have an idea in your head about the ideal clean code solution and then the real world and its messy limitations get in your way, forcing you to write imperfect work-arounds and hacks that may leave you dissatisfied.



    "Everyone has a plan until they get punched in the face."



    What to do about it



    To some degree you will have to learn to accept that your code will never be perfect. One thing that helped me with that is the mindset of "If I hate the code I wrote a month ago, it means I have learned and become a better programmer".



    A way to alleviate the issue is to constantly be on the lookout for potential improvements as you work and refactor continuously. Make sure to hit a good balance between refactoring and adding new features / fixing bugs. This won't help with big design issues, but it will generally leave you with a more polished code base you can be proud of.






    share|improve this answer








    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

















    • The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
      – David Arno
      1 hour ago












    up vote
    7
    down vote










    up vote
    7
    down vote









    This is a very common experience



    Most people I interact with, and I myself as well, feel like this. From what I can tell one reason for this is that you learn more about the domain and the tools you use as you write your code, which leads you to recognize many opportunities for improvement after you've already written your program.



    The other reason is that you might have an idea in your head about the ideal clean code solution and then the real world and its messy limitations get in your way, forcing you to write imperfect work-arounds and hacks that may leave you dissatisfied.



    "Everyone has a plan until they get punched in the face."



    What to do about it



    To some degree you will have to learn to accept that your code will never be perfect. One thing that helped me with that is the mindset of "If I hate the code I wrote a month ago, it means I have learned and become a better programmer".



    A way to alleviate the issue is to constantly be on the lookout for potential improvements as you work and refactor continuously. Make sure to hit a good balance between refactoring and adding new features / fixing bugs. This won't help with big design issues, but it will generally leave you with a more polished code base you can be proud of.






    share|improve this answer








    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.









    This is a very common experience



    Most people I interact with, and I myself as well, feel like this. From what I can tell one reason for this is that you learn more about the domain and the tools you use as you write your code, which leads you to recognize many opportunities for improvement after you've already written your program.



    The other reason is that you might have an idea in your head about the ideal clean code solution and then the real world and its messy limitations get in your way, forcing you to write imperfect work-arounds and hacks that may leave you dissatisfied.



    "Everyone has a plan until they get punched in the face."



    What to do about it



    To some degree you will have to learn to accept that your code will never be perfect. One thing that helped me with that is the mindset of "If I hate the code I wrote a month ago, it means I have learned and become a better programmer".



    A way to alleviate the issue is to constantly be on the lookout for potential improvements as you work and refactor continuously. Make sure to hit a good balance between refactoring and adding new features / fixing bugs. This won't help with big design issues, but it will generally leave you with a more polished code base you can be proud of.







    share|improve this answer








    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.









    share|improve this answer



    share|improve this answer






    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.









    answered 2 hours ago









    Andreas Kammerloher

    792




    792




    New contributor




    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





    New contributor





    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    Andreas Kammerloher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    • The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
      – David Arno
      1 hour ago
















    • The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
      – David Arno
      1 hour ago















    The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
    – David Arno
    1 hour ago




    The only thing I'd add to this answer is, learn and follow TDD principles when writing code. Those tests then provide a secure environment for refactoring and rewriting as you continue to improve as a developer and want to make changes to existing code.
    – David Arno
    1 hour ago












    up vote
    0
    down vote













    Learn refactoring - the art of gradually improving code. We all learn all the time, so it is very common to realize that the code you have written yourself could be written in a better way. But you should be able to transform the exiting code to apply these improvements without having to start from scratch.






    share|improve this answer
























      up vote
      0
      down vote













      Learn refactoring - the art of gradually improving code. We all learn all the time, so it is very common to realize that the code you have written yourself could be written in a better way. But you should be able to transform the exiting code to apply these improvements without having to start from scratch.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Learn refactoring - the art of gradually improving code. We all learn all the time, so it is very common to realize that the code you have written yourself could be written in a better way. But you should be able to transform the exiting code to apply these improvements without having to start from scratch.






        share|improve this answer












        Learn refactoring - the art of gradually improving code. We all learn all the time, so it is very common to realize that the code you have written yourself could be written in a better way. But you should be able to transform the exiting code to apply these improvements without having to start from scratch.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 12 mins ago









        JacquesB

        40.2k1683117




        40.2k1683117




















            Ashish is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Ashish is a new contributor. Be nice, and check out our Code of Conduct.












            Ashish is a new contributor. Be nice, and check out our Code of Conduct.











            Ashish is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f380597%2fhow-can-i-avoid-always-feeling-like-if-i-completely-rebuilt-my-program-from-scra%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery