<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: toonarmycaptain</title>
    <description>The latest articles on DEV Community by toonarmycaptain (@toonarmycaptain).</description>
    <link>https://dev.to/toonarmycaptain</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F148670%2F7de7b9d2-43cc-4f70-97eb-f128eb33a267.jpeg</url>
      <title>DEV Community: toonarmycaptain</title>
      <link>https://dev.to/toonarmycaptain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/toonarmycaptain"/>
    <language>en</language>
    <item>
      <title>Unit testing with assertive mocks vs not testing implementation: Why not both?</title>
      <dc:creator>toonarmycaptain</dc:creator>
      <pubDate>Tue, 30 Mar 2021 03:47:26 +0000</pubDate>
      <link>https://dev.to/toonarmycaptain/unit-testing-with-assertive-mocks-vs-not-testing-implementation-why-not-both-3po7</link>
      <guid>https://dev.to/toonarmycaptain/unit-testing-with-assertive-mocks-vs-not-testing-implementation-why-not-both-3po7</guid>
      <description>&lt;p&gt;Often I will have a function that contains another function call, and want to write a unit test for it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;my_module&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;function_under_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# do stuff
&lt;/span&gt;    &lt;span class="n"&gt;var&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;called_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# do stuff
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The typical &lt;a href="https://docs.pytest.org" rel="noopener noreferrer"&gt;pytest&lt;/a&gt; way of testing &lt;code&gt;function_under_test&lt;/code&gt; as a unit (rather than &lt;code&gt;function_under_test&lt;/code&gt; and &lt;code&gt;called_function&lt;/code&gt;) would be to mock out/monkeypatch &lt;code&gt;called_function&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_function_under_test&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mock_called_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# I usually assign expected_args/return value 
&lt;/span&gt;        &lt;span class="c1"&gt;# based on test inputs/parametrize
&lt;/span&gt;        &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;expected_args&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;appropriate_test_value&lt;/span&gt;

    &lt;span class="n"&gt;monkeypatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module_containing_called_function&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;called_function&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_called_function&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;function_under_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;expected_result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now often I want to mock out the function call, as it might be writing to file, making network calls etc. &lt;br&gt;
&lt;em&gt;But&lt;/em&gt; this means if I change how I'm calling &lt;code&gt;called_function&lt;/code&gt;, or the internals of &lt;code&gt;called_function&lt;/code&gt;, the test breaks, even if the arguments to &lt;code&gt;function_under_test&lt;/code&gt; and it's return value are exactly the same. So in a sense, it's not a pure unit test unless you get rid of the &lt;code&gt;assert&lt;/code&gt; in the mock, it's still halfway to an integration test, provided your mock is accurate, because it cares what it was called by (although it can be simpler in terms of defining mocks to put a small amount of logic there, rather than specifying for each test case).&lt;/p&gt;

&lt;p&gt;I have found (and it might just be me), that even when I run integration tests and pure(r) unit tests, I diagnose errors more easily when I have the assertions in my mocked function calls, because then it's easy to nail down the source of the error. &lt;br&gt;
Yes, it can be a &lt;em&gt;lot more work&lt;/em&gt;, because you might have to make changes to tests when you change the implementation (although you might have to anyway if the mocked function's return value would be different...).&lt;/p&gt;

&lt;p&gt;But what if you simply did both?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@pytest.mark.parametrize&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;sup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;sup&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="c1"&gt;#footnote-1)('mock_assertions', [True, False])
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_function_under_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mock_assertions&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mock_called_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;mock_assertions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;expected_args&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;appropriate_test_value&lt;/span&gt;

    &lt;span class="n"&gt;monkeypatch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module_containing_called_function&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;called_function&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mock_called_function&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;function_under_test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;expected_result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, you get instant feedback if you changed the behaviour of &lt;code&gt;function_under_test&lt;/code&gt;, but you also get feedback if you changed the calls you might make to &lt;code&gt;called_function&lt;/code&gt; in ways you did not expect. Sure you can make mistakes in your &lt;code&gt;mock_called_function&lt;/code&gt; args and return values...but at least you need to think about them, particularly if the calls/needed return values change.&lt;/p&gt;

&lt;p&gt;Integration tests are still necessary, because whatever you &lt;em&gt;say&lt;/em&gt; &lt;code&gt;called_function&lt;/code&gt; returns in your mocks, that might not be what it &lt;em&gt;actually&lt;/em&gt; returns. &lt;br&gt;
Yet I wonder if, despite some extra work to maintain, testing this way gets the best of a couple of worlds, helping us better pin down that our functions do what we expect, without flawed tests that pass because we returned what we'd want, rather than what we'd get, and helping us pinpoint &lt;em&gt;why&lt;/em&gt; our integration tests failed (&lt;em&gt;if&lt;/em&gt; we have them, and &lt;em&gt;if&lt;/em&gt; they have the same exploration of edge cases as our unit tests).&lt;/p&gt;

&lt;p&gt;Or is it better to have the integration tests and pure(r) unit tests, even if the integration tests force you to mock expensive/disk/network calls anyway?&lt;/p&gt;

&lt;p&gt;What do you think? &lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
&lt;a id="footnote-1"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; Do you use &lt;a href="https://docs.pytest.org/en/stable/parametrize.html" rel="noopener noreferrer"&gt;&lt;code&gt;@pytest.mark.parametrize&lt;/code&gt;&lt;/a&gt;? It lets you specify a bunch of different inputs to your tests, and pass/fail the test run on each input. It is excellent.&lt;/p&gt;

</description>
      <category>unittest</category>
      <category>python</category>
      <category>pytest</category>
      <category>mock</category>
    </item>
    <item>
      <title>Dropping local test runtime and scope with pytest</title>
      <dc:creator>toonarmycaptain</dc:creator>
      <pubDate>Thu, 25 Feb 2021 20:26:31 +0000</pubDate>
      <link>https://dev.to/toonarmycaptain/dropping-local-test-runtime-and-scope-with-pytest-3e3g</link>
      <guid>https://dev.to/toonarmycaptain/dropping-local-test-runtime-and-scope-with-pytest-3e3g</guid>
      <description>&lt;p&gt;I love pytest. &lt;/p&gt;

&lt;p&gt;I have a &lt;a href="https://github.com/toonarmycaptain/dionysus" rel="noopener noreferrer"&gt;project&lt;/a&gt; that I use as something of a learning platform (and that I don't want to break because it's at least occasionally used in production by my wife..). Most recently I've used it to learn how to abstract a database layer, implement a SQLite database, and now I'm similarly implementing &lt;a href="https://www.sqlalchemy.org/" rel="noopener noreferrer"&gt;SQLAlchemy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Database tests can take a...while to run. &lt;br&gt;
The cross product of a test suite and a variety of database backends via &lt;code&gt;pytest.mark.parametrize&lt;/code&gt; takes...longer. &lt;/p&gt;

&lt;p&gt;The other day I &lt;a href="https://www.google.com/search?q=pytest+only+run+specific+parameters" rel="noopener noreferrer"&gt;googled "pytest only run specific parameters"&lt;/a&gt; and happened across the &lt;code&gt;python -m pytest -k some_string&lt;/code&gt; invocation.&lt;/p&gt;

&lt;p&gt;Now, I see that the &lt;a href="https://docs.pytest.org/en/stable/usage.html#Run" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; refers to strings in quotation marks,&lt;sup&gt;1&lt;/sup&gt; but I missed that, and my incovation &lt;code&gt;python -m pytest -k sqlalchemy&lt;/code&gt; works just fine cut my test runtime down to 1/6th the full suite, running only tests specific to my &lt;code&gt;SQLiteSQLAlchemyDatabase&lt;/code&gt; object in &lt;code&gt;sqlite_sqlalchemy.py&lt;/code&gt;, and my common tests that run against every database backend, but only the parameters using my &lt;code&gt;empty_sqlite_sqlalchemy_database&lt;/code&gt; fixture.&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;So while I'm working on this backend, and assuming I'm not changing the database interface, I can run the full suite of tests, but only on the part of the code I'm working on. This way, I can ensure that the implementation works (or is getting closer to working), and that it's not breaking any thing that relies on it (because my common interface tests are running, and that one test for another component I would have forgotten that uses this code) as I go, without waiting for the entirety of the project's tests to run!&lt;/p&gt;

&lt;p&gt;This is not only saving me time waiting, but means I'm not just running the tests more often, but receiving the feedback  much closer to the writing of the code. You know, I'm actually checking the results of the tests &lt;em&gt;before&lt;/em&gt; writing much/any subsequent code, that generally relies on the former actually working. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a id="footnote-1"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; Later I wondered how run my &lt;code&gt;SQLiteDatabase&lt;/code&gt; tests without also catching my &lt;code&gt;SQLiteSQLAlchemyDatabase&lt;/code&gt; tests (which is what would happen by using &lt;code&gt;sqlite&lt;/code&gt;). The answer was to use a string with logic: &lt;code&gt;python -m pytest -k "sqlite and not sqlalchemy"&lt;/code&gt;. More options and ideas: &lt;a href="https://stackoverflow.com/questions/44943470/parametrize-and-running-a-single-test-in-pytest" rel="noopener noreferrer"&gt;SO: parametrize and running a single test in pytest&lt;/a&gt;,
&lt;a href="https://stackoverflow.com/questions/52785961/pytest-select-tests-based-on-mark-parameterize-value" rel="noopener noreferrer"&gt;SO: Pytest select tests based on mark.parameterize value?&lt;/a&gt;, &lt;a href="https://docs.pytest.org/en/latest/example/markers.html" rel="noopener noreferrer"&gt;Working with custom markers&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a id="footnote-2"&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; I should write a post about how I use fixtures as parameters in &lt;code&gt;pytest.mark.parametrize&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>pytest</category>
      <category>productivity</category>
      <category>testing</category>
    </item>
    <item>
      <title>What you need to learn that's not writing code.</title>
      <dc:creator>toonarmycaptain</dc:creator>
      <pubDate>Fri, 04 Dec 2020 07:27:33 +0000</pubDate>
      <link>https://dev.to/toonarmycaptain/what-you-need-to-learn-that-s-not-writing-code-4pk3</link>
      <guid>https://dev.to/toonarmycaptain/what-you-need-to-learn-that-s-not-writing-code-4pk3</guid>
      <description>&lt;p&gt;A mate told me they're trying to pick up coding. While I'm not yet employed with my skills, I thought I'd write down my thoughts about what they need to learn.&lt;/p&gt;

&lt;p&gt;[They're planning on learning HTML/CSS/JS and Python for front end development, and have started with Python.]&lt;/p&gt;

&lt;p&gt;What do they need to learn?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Version control - Git/GitHub
&lt;/h3&gt;

&lt;p&gt;Use version control, preferably externally hosted. &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;Git&lt;/a&gt; hosted on &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;Github&lt;/a&gt; is the ubiquitous place to start.&lt;br&gt;&lt;br&gt;
It can be a bit of a head trip when you first try it, but at least get the basics of making a repo, cloning it to your machine, .gitignore, adding/tracking files, committing changes in sensible portions regularly, pushing, and the rest will come.&lt;br&gt;&lt;br&gt;
The rest being branching, making/merging PRs (Pull Requests), &lt;code&gt;reset&lt;/code&gt;, and the-rest-you-will-likely-google-when-you-need-them-the-first-few-times-and-even-then-still-google-to-be-sure.&lt;br&gt;&lt;br&gt;
Seeing what files are tracked/ignored and what changes are committed is much easier when starting out with some sort of GUI, like an...&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  IDE - Pycharm
&lt;/h3&gt;

&lt;p&gt;Become proficient in at least one full-featured IDE, and it's features.&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.jetbrains.com/pycharm/" rel="noopener noreferrer"&gt;PyCharm&lt;/a&gt; is a good one for python, and integrates with the rest of these well, and has useful features for HTML/CSS/JS.&lt;br&gt;&lt;br&gt;
Some call this cheating, but I believe learning how to use an IDE well is worthwhile both for productivity and understanding what is going on in the code you're writing.&lt;br&gt;
The debugger in whatever language you're using is also a great skill, but when you're beginning, the GUI debugger in most IDEs is a good place to start.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Some testing skills - pytest
&lt;/h3&gt;

&lt;p&gt;Whether or not you decide to go hard into TDD (Test Driven Development), as long as you write tests around the time you write the code, or figure out what you need the code to be doing/not doing, you'll be doing yourself a favour.&lt;br&gt;&lt;br&gt;
In tandem with git and automated testing, this will save you from your own assumptions, and force you to learn the basics of extremely useful tools (eg &lt;a href="https://travis-ci.com/" rel="noopener noreferrer"&gt;TravisCI&lt;/a&gt;, &lt;a href="https://ci.appveyor.com/" rel="noopener noreferrer"&gt;Appveyor&lt;/a&gt;).&lt;br&gt;&lt;br&gt;
&lt;a href="https://docs.pytest.org/" rel="noopener noreferrer"&gt;Pytest&lt;/a&gt;, compatible with python's builtin &lt;code&gt;unittest&lt;/code&gt;, and has lots of plugins for testing most things you'd care to test.&lt;br&gt;
*While technically writing code, the concepts, practise, skill set of writing tests are separate from writing production code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Documenting your code
&lt;/h3&gt;

&lt;p&gt;When you go back in a few months and wonder what you were thinking...this is your chance to help yourself fix the mess you created when you had no idea what you were doing (for me this is generally yesterday). This includes comments as well as more formal documentation (ie package/module/class/function/method docstrings, README.md).&lt;br&gt;
This also includes git commit messages that make enough sense for you (and preferably others) to follow what changes are being made.&lt;br&gt;&lt;br&gt;
Python has the helpful &lt;a href="https://www.python.org/dev/peps/pep-0008/" rel="noopener noreferrer"&gt;PEP 8&lt;/a&gt; and &lt;a href="https://www.python.org/dev/peps/pep-0257/" rel="noopener noreferrer"&gt;PEP 257&lt;/a&gt; general guides.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Learning practices
&lt;/h3&gt;

&lt;p&gt;Keeping a journal or record of the things you're learning, or even a blog, are great practices. Even if it's as simple as text document you can search in, recording the things you learn and figure out gives you a reference later ("how did I do that obscure weird thing that other time and why") is invaluable. This can also function as a record of what you've learned and grown, for yourself, and to potentially to draw on to give current or future employers specific evidence of growth and experience.&lt;br&gt;&lt;br&gt;
Writing in public about what you're learning or doing also seems good advice; it's why I'm here; and the process of distilling knowledge for communicating or teaching others is a boon to your personal learning, if for no other reason than the gaps in your knowledge will be filled when you double-check your facts (I mean...research), or get corrected publicly. Which, if you've any humility, is more good than bad!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Speaking of which, please let me know what I'm missing, or wrong about!
&lt;/h4&gt;

&lt;p&gt;I'll note that these are habits that will grow into well-developed skills when they're practiced as part of a workflow, rather than as an afterthought.&lt;br&gt;
Or at least, I hope they will...&lt;/p&gt;

&lt;p&gt;There are a few of almost-without-saying skills that are independent of any technology, but worth mentioning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Problem solving, and a rough personal methodology, both when debugging code, and figuring out how you need to solve a problem (or, first, what the problem is).&lt;/li&gt;
&lt;li&gt;...and the tool to find the details: Google and/or &lt;a href="https://stackoverflow.com/" rel="noopener noreferrer"&gt;StackOverflow&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn to find, and how to navigate, the documentation for the technologies you're using.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>learning</category>
      <category>git</category>
      <category>testing</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Getting things done. Or, "how to solve problems".</title>
      <dc:creator>toonarmycaptain</dc:creator>
      <pubDate>Tue, 24 Nov 2020 06:29:31 +0000</pubDate>
      <link>https://dev.to/toonarmycaptain/getting-things-done-or-how-to-solve-problems-3ph1</link>
      <guid>https://dev.to/toonarmycaptain/getting-things-done-or-how-to-solve-problems-3ph1</guid>
      <description>&lt;p&gt;It's very easy for me to set myself tasks. Build that website. Write a blog post. Clean the house. Learn about that library or a new technology. Get a degree. Get the outside of the house ready for winter. Find a job. So easy. There, done.&lt;/p&gt;

&lt;p&gt;Or...not?&lt;/p&gt;

&lt;p&gt;One of the problems with this way of (not) planning is that it sets tasks or identifies problems, without a map to to a solution.&lt;/p&gt;

&lt;h1&gt;
  
  
  Breaking tasks down
&lt;/h1&gt;

&lt;p&gt;One of the things I've learned to do deliberately since I've been coding is to break tasks down into their component elements. I've found myself doing this away from the keyboard, and it's been very, very helpful, particularly when getting motivated to tackle tasks I'm unlikely to complete in one session. Like the mountain of laundry that existed yesterday:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;find place for baby clothes&lt;/li&gt;
&lt;li&gt;sort into piles&lt;/li&gt;
&lt;li&gt;think about ironing (then decide to put this off/not)&lt;/li&gt;
&lt;li&gt;put away parents clothes&lt;/li&gt;
&lt;li&gt;put away kids clothes&lt;/li&gt;
&lt;li&gt;figure out organisation in spot for baby clothes&lt;/li&gt;
&lt;li&gt;put away baby clothes&lt;/li&gt;
&lt;li&gt;iron clothes (or not)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recently for me this involved making and posting &lt;a href="https://dev.to/toonarmycaptain/hello-world-ke6"&gt;my first blog entry&lt;/a&gt; last week, and breaking down "make incomplete site presentable and deploy":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;point site blog link at this blog&lt;/li&gt;
&lt;li&gt;clean up CSS&lt;/li&gt;
&lt;li&gt;remove "content coming soon" from home/landing and projects pages&lt;/li&gt;
&lt;li&gt;bare bones projects content with links, minimal explanation from GitHub descriptions.&lt;/li&gt;
&lt;li&gt;fix/insert titles on subpages&lt;/li&gt;
&lt;li&gt;deploy at &lt;a href="https://toonarmycaptain.pythonanywhere.com/home/" rel="noopener noreferrer"&gt;pythonanywhere.com/toonarmycaptain&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This skill is really important to a lot of things, from isolating bugs by breaking down the possible causes, to writing simple and maintainable code by following the adage to keep functions/classes to one purpose. Of course, it's also helpful when attacking large projects. :)&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>organization</category>
    </item>
    <item>
      <title>Hello world!</title>
      <dc:creator>toonarmycaptain</dc:creator>
      <pubDate>Tue, 17 Nov 2020 05:58:36 +0000</pubDate>
      <link>https://dev.to/toonarmycaptain/hello-world-ke6</link>
      <guid>https://dev.to/toonarmycaptain/hello-world-ke6</guid>
      <description>&lt;p&gt;I've been planning on writing this for ... awhile. &lt;/p&gt;

&lt;p&gt;There's a lot of advice around regarding getting into tech suggesting blogging and building your own website. I'm working on the latter.&lt;br&gt;
On the former, I'm finally following the part of the advice that says "just start writing" and "use other services rather than building a blog yourself". So here we are. &lt;/p&gt;

&lt;p&gt;I've been teaching myself python for a few years now on the side, recently transitioned (back) to a stay at home dad with another newborn, so my time is limited, but my goal is to get into a paid tech role in the next year or so.&lt;/p&gt;

&lt;p&gt;In the shorter term, I plan to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have my embryonic personal site hosted on &lt;a href="https://toonarmycaptain.pythonanywhere.com" rel="noopener noreferrer"&gt;pythonanywhere&lt;/a&gt;.  ✓ &lt;/li&gt;
&lt;li&gt;Implement recaptcha on my contact form. &lt;/li&gt;
&lt;li&gt;Delegate contact form submissions to async functions. or/and celery, implement rate limiting.&lt;/li&gt;
&lt;li&gt;Link to this blog from my website.  ✓&lt;/li&gt;
&lt;li&gt;Add social/github links to site.&lt;/li&gt;
&lt;li&gt;Manage posts here from &lt;a href="//github.com"&gt;github&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Migrate to hosting at Heroku, AWS, Digital Ocean, or similar. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My intention is to write about these things. Not that there's not great posts about them already around, but maybe my perspective can help someone. &lt;br&gt;
I will likely also heavily edit this post. But that's the fun of being a picky writer and maintaining a blog. &lt;/p&gt;

</description>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
