Saturday, December 14, 2019

I don't know C#

I decided to jump into a Twitter thread being a little facetious.

I 've been using C# for a number of years, within the very first year of my first contract. Initially, I used it sparingly for tasks that were outside of what I could do with C. C is the language I was actually hired for. It would have been between C and Java since those were the languages I had experience with from my courses at The University of the West Indies. Eventually, I started using C# more and more for internal tools and client tools written using Windows Forms, and supporting the company's client portal which was written using ASP.NET WebForms.

Subsequent jobs, beginning in December 2013 required C# as the primary programming language. The impetus which triggered that first job change brought on a spiral that impacted my performance and confidence in my skills in cycles.

One manager told me I was a journeyman, though he may have had a different opinion had he met me at a different time. It was meant as a compliment on my skills, but indicating that there were areas I needed to improve on. He recommended a few books, but the primary ones were Clean Code, Clean Coder, and Design Patterns. I started the first two but distractions got the best of me. The aforementioned cycles culminated with an extended break.

Work Experience

Work Experience

  • Independent Software ContractorSelf Employed
    Dec 02, 2019 - Present
    Joined an undisclosed company as an independent contractor for a payroll management product
  • January 07, 2017 - December 01, 2019
  • Application DeveloperZero Chaos
    Jan, 2016 - Jan, 201711 months
    Started as a member of the Implementations Development team responsible for developing custom integrations for new clients being imported and eventually migrated to primary Integrations developer (internal)
I decided to participate in Advent of Code 2019. This was after taking on the #100DaysOfCode challenge where I committed to writing at least 1 hour of code per day for 100 Days. I spent the first 26 days or so on freeCodeCamp, going through every single learning level. I skipped some of the Responsive Web Design projects to get through the JavaScript Algorithms and Data Structures Certification. I'll dedicate another post to my FCC progress.

For Advent of Code, I decided to use C# with Visual Studio Code. I'd also been using C# for leetcode puzzles. For previous competitions, I used Python, even though I've never really dived into learning the language properly. It was just easy to implement what I needed with the rich packages and simple integration with contest platforms. Fewer possibilities of "But it works on my machine".

Then came https://blog.dalevross.com/2019/12/advent-of-code-2017-day-7-yikes.html. I couldn't figure out how why my solution wasn't working so I first requested help on Reddit. That failed to bear fruit so a few days later Eric Wastl, the creator of Advent Of Code, shared my request on Twitter. I got a few offers to help, but this is what I desperately needed to hear.
Now, I'd known my code was far from clean (See Code Smells from Jeff Atwood), much farther than normal, but I initially hoped to struggle along by myself without anyone seeing the mess and worry about refactoring (if necessary), later. David shared a port of his TypeScript solution and another good samaritan shared his C# solution as well.


After viewing their code, it was clear that I needed to improve.

  • I know how to get things done, but if I planned to troubleshoot or share any code I should first make it easy to understand. The C# Language Specification provides many options to ensure your code is SOLID.
  • Writing testable code should never be an afterthought and I have for far too long treated it as such.

So in essence, while I know SOME C#, enough to be paid handsomely, I don't know or practice enough to comfortably call myself a Senior C# developer, though I used it regularly spanning 11 years, prior to the break.

That's why I dedicated this morning to this blog post instead of diving right into Day 14 of Advent of Code. I intend to migrate to Visual Studio from VS Code, to get a richer and up to date development experience by default for C# development. VS Code will still be my go-to for scripting, and websites.
The blog title's inspiration came from You don't know JS.  So, in the spirit of knowing C#, I'll be using this resource serendipitously shared by Scott Hanselman while I was crafting this post.
This will be similar to my approach with freeCodeCamp where no stone will be left unturned this time around. I'll try to improve the readability score for the next draft, and subsequent posts.

Monday, December 9, 2019

Advent Of Code 2017 - Day 7 yikes

I planned to blog about the solution after getting help from another Advent of Coder. She's tagged in the tweet below. However, I spent all day Saturday until a few minutes before Sunday, the 8th swatting bug including elementary stuff like reinitialization of objects in loops after the feedback was implemented. Thankfully that wasn't dependent on day 7. Jump to assumptions or full code
Well, this blog post is now a cry for help.

A few lines are based on assumptions so I'd like to highlight those.

  1. I stored the next index for each amplifier to continue from there without restarting from the beginning. I also tested starting from the first input index and that didn't work so I assumed that assumption was wrong
  2. I initially had a bug with the assumption that halts only occurred after an output opcode. That may still be true but in my debugging, I saw where using assumption 1 led to an exit after opcode 5 when a comparison with 0 resulted in a premature exit.
Please forgive the formatting and ancient look and feel. I'd migrated to Wordpress but lost that installation due to life happenings. I have been diagnosed with a mental illness but please read the following if you have the time, though it was written at a time a was slightly manic.
Perception and ignorance -  The main point is how some are perceived based on factors they have no control over, how these perceptions can be wrong and are sometimes based on ignorance.