Monday, September 13, 2021

Pragmatic Programmer : Chapter 1 - A Pragmatic Philosophy

Your attitude towards your work makes things very different. Do you have a job or a career? Pragmatic Programmer reminds you that it is a career. Your attitude and behavior shapes your career, setting you up for being a better developer long term.
  1. It's Your Life - I've seen a lot of developers just throw their hands up in the air and not even attempt to make things better. It can be as simple as just getting a nicer mouse for their own desktop. There's a sense of entitlement among many developers, that everything needs to be handed to them in terms of training, or their work environment. That's a shame.

    Take control of your ability to complete your responsibilities, even if that means investing in yourself. The idea of "You Have Agency" is a great way of looking at things and separates craftsmen from workers.
  2. The Cat Ate My Source Code -We all make mistakes. We all find others' mistakes. Ownership of your work, and the mistakes that have been made really changes the attitude and tone of your team. Reaching out for help, alerting others to those mistakes early is key. Perhaps things can be adjusted to still meet the goals. However, when you do make a mistake, do whatever you need to to resolve said mistake. If you need to come up with a list of options to do so, put in extra time, do it. Document it. Be an example of someone you want to work with.
  3. Software Entropy - When I first read this book, I thought this idea was garbage, but the idea really is true. I now recognize this is a bigger picture item.  Bugs need to be documented, and incomplete pieces need to be shown in the code. Finding the right ways of doing that can be difficult though. Fix what you can, when you can.
    When things are broke, you may not be able to fix right away. If you can, go for it. But you need to make others aware of it. It can result in extra testing and requirements gathering. Things didn't get to their current state by accident and there's probably a reason that the problem exists. 
    Just make sure you're going in the right direction.
  4. Stone Soup and Boiled Frogs - Being a catalyst for change can be difficult. Rocking the boat really can upset people who are resistant to change and don't want to do things differently.
    Making those changes is difficult and takes practice. There's always a lot of different factors involved including time, resources, money and long term vision. You may not always be successful, but maybe you can combine ideas with someone else to make things just 1% better.
  5. Good-Enough Software -  The best line of software is one that is not written. I use different libraries all the time, and those bring in bugs. I use other team's NuGet Packages and thus, I can inherit defects from that. It goes on and on. 
    The point is, we have resources available and sometimes the requirements aren't as strict as we come to believe. If the 40 hours it takes to add a feature saves users a total of 10 minutes a year, maybe it isn't worth it. Do the right things from the beginning like Automated Unit Testing, and Continuous Integration where it makes sense.
  6. Your Knowledge Portfolio - Having different tools, different ways of solving problems, knowing about how others solve their problems is huge. I believe that learning things takes a long time, and takes a lot of effort. I'm no longer in college where I can stay up three nights in a row studying and absorb everything I studied. By doing things regularly, and in different ways, you become a well rounded developer with a variety of ways that you can solve problems.
  7. Communicate! - I wish I paid more attention to this earlier in my career. Some of the best training I got in the last 5 years was how to write an email. This chapter reminds me that we're in an age of different generations, and that comes with different communication styles. More experienced technical people may want to talk through something to communicate an idea. I'm a huge fan of a wall of text in an email (that people don't seem to read), while developers fresh out of college seem to lean towards visuals like charts, and videos on things. These are tools, that have their own benefits and flaws. Use all of them, not just one. Pick the right one not just for the context, but your audience.
    Additionally, the idea of code comments being documentation violating the DRY principal is something I had not considered. I've gone all over with my comments in code from being too verbose to non existent. This is something I think deserves to be explored in a deeper sense. 

Pragmatic Programmer : Your Journey to Mastery

I recently was in a meeting where I was reminded of the idea that exceptions should be used for exceptional cases. I thought it was in Pragmatic Programmer, but I've purchased and loaned this book out so many times that I could not find my copy. I talked to another developer about these exceptions, and mentioned the book. They genuinely seemed interested, and I wanted to revisit the book since I was overdue. So I bought the hard cover 20th anniversary edition, and it will not be loaned out. I rather buy one for someone than lose my copy again.

This has been the most beneficial book to my career. I've read it multiple times, and feel called out by it regularly. It refreshes me on keeping focus on my career, and being a better developer. Very quickly, you learn that it isn't just who knows the code the best being a valuable team member, but who can maintain the code, communicate, work together, solve problems and come up with long term strategies. There's minimal code in it, and they're more about strategies to solving the different challenges that come with development.

This is an excellent book, that I recommend for anyone with over a year of development experience. I've decided to make my own cheat notes to come back to from time to time as I read this book. I'm also happy to discuss any of these concepts and ideas. My notes can be found with the Pragmatic Programmer tag. 

Monday, April 10, 2017

Copping Mechanisms - Sleep

Ed Wisniowski wrote a blog post on coping with the difficulties of being a scrum master. He talks about some steps that he takes to keep his professional life from taking over, working with others, and sleeping patterns. It is true that he's got a position that demands a thick skin, and people skills are essential for success.

Perhaps the most unique part of what he's talked about in our industry is the sleep. Anyone will tell you that their job is difficult because of how it can take over, or the individuals they work with. But the sleep portion is something that is quite a bit different at times. Ed's strategy involves making sure he has that uninterrupted sleep. Like Ed, I've interacted with offshore teams. I've skimped out on sleep, or tried to split it into multiple chunks. I may not get the 8 hours I need, but I can get 5 hours here, and 3 later, that counts, right? It doesn't work.

The benefits of sleep cannot be understated. When you're not getting quality sleep, the quality of your life suffers. You're going to get sick, your brain will not function as well, you will be cranky - you get my point. I can remember multiple times where I would show up at work exhausted and unable to solve problems. At the same time, I remember accomplishing surprising tasks in part to being well rested. The sleep also impacts how I interact with others. If I was up late working on an issue, and someone attempts to exchange a pleasant greeting- well, it may not get a great response from me.

I encourage people to get sleep. I encourage them to turn off and escape from the workplace that can be toxic when people give exceeding attention toward it. I have seen people become the "all knowing" individual of a system, and had their vacations interrupted. I've seen people depart from positions because of their schedule. Know your limits. Know where to draw a line, and be proactive in providing options to prevent this from happening. You need to be flexible, yes. But you also need to protect your own sanity.





Saturday, October 22, 2016

Declining To Be Superman

Recently I declined a job offer. The position had some amazing perks including a lot of time off, picking out my own hardware I worked on and a corner office with an amazing view of the Chicago River on both sides. The position was being the sole developer for a non-profit organization. They were small, and genuinely seemed like great people. It was clear to me that they were treated well and happy being there.

During my interview, I was able to ask questions about their development process. It was really non-existent. Things such as source control, testing, and continuous integration just was not happening there – yet. I viewed this as an opportunity to implement a development process. This could be a great way to not only say that I know about continuous integration, I implemented it. I was setting the standards. I would set the standard. They had a number of projects there that I saw potential in and they were a chance to use technologies I hadn’t done before. The possibilities were seemingly endless. I had a chance to be Superman.

I put a lot of thought into the offer. I discussed it with multiple developers, trying to see if I was missing something. I talked to non-developers who worked in non-profit organizations for their insights. Four years ago, I would have accepted the offer. I would have viewed it as my opportunity to do something big.

But at this point in my career, it isn’t the right fit for me. I didn’t realize that despite enjoying being a heads down coder, working with others made me a better coder. I thought about how many times I’ve sent a code review to someone and asked, “What do you think?” Often times, they would do the same to me. Looking at other people’s code and being able to discuss it made me think about how I can approach problems differently. I thought about how I recently acted as a mentor to three developers and gave them wisdom and feedback. In turn, they asked me questions that maybe I couldn’t explain clearly right on the spot which forced me to think about how I can word things more concisely.

Had I taken this position, there wouldn’t be anyone there to enforce process on me. No one there is going to make sure that I have everything checked in properly. No one there is going to make sure I’m following my own rules. Being Superman would mean I would be responsible for everything – even in times of disaster. What happens when I misunderstand a requirement? What happens if I make a typo and it isn’t caught until it is in production because there are yellow screens everywhere? Not only that, but being such a small IT department, I would probably be called upon to fix paper jams in printers and telling people to turn their computer off and on again because something isn’t working! Who is going to send me pictures of dogs when I’m overly stressed about an assignment? Who will I learn from, and who will challenge me to be better?

I don’t want to be the smartest, or the only developer in the office. If I’ve learned anything from where I currently work, it is that the overhead of working with other developers is worth it to have multiple minds on the problem. It makes for better software, and better developers.

Tuesday, September 6, 2016

5 Quick Ways to help your Search Engine Optimization

Search Engine Optimization (SEO) is a marketing strategy to help your website appear higher in search engines such as Google, Bing, or Yahoo.  It is important to be listed in search engines because that is how customers will find you. Being listed in the top spot makes it more likely than anyone else. How often do you look at the 42nd ranked item for your search results?

Each search engine has their own algorithm which helps put content in order. Every organization wants their web site to come up first. This creates a competitive industry where businesses will do anything they can to get one spot higher than the other. Businesses will hire people to constantly be working on improving their ranking because it is so critical to their business.

Think of Search Engines as automated
analysis of your web site's reputation. 
Odds are you won’t have the resources to pay someone full time to get you on the first page of Google organically. Sometimes, you can have a day or two in downtime and want to do something quick to help improve the traffic to your website. Some of the things people do to help their search engine ranking can be done quickly, and are long lasting. Here are five tips that you can quickly do to help improve your ranking.


Secure your site


According to a 2014 post from Google, using a secure connection will positively impact you and your search engine ranking. Google is calling for HTTPS everywhere on the web, and as a result, they’re trying to push website owners to help out.

HTTPS allows for a secure communication between your visitors and your website. This is used with any reputable bank, e-commerece site, or anyone using information that could be used in identity theft. While securing your site is not free, it does allow for a quick way to help improve your page ranking.

Update Content Regularly


As a user, would you rather have content that came from today, or content that came from 1996? By providing new content regularly, you’re showing that your site is being maintained. Things such as industry news, product sales, or a simple blog can be a great way to generate new content for your web site. Not only will these help your search engine ranking, it gives your visitors a reason to return to your site regularly. Returning visitors are more likely to be engaged in your content and trust your brand.

So write a blog post. Change up your home page a bit to feature a different product. Update your about section. Content is king. Provide fresh, relevant content regularly and you can get a great boost to where you are in a search engine.

Link


Think about how CNN or any other major news outlet is one of the top web sites when you search “news”. One of the big reasons for this is the way links can impact where you rank in search engines. When many people are linking to your web site, it is considered to be an inbound link. These help your credibility as a trusted source. Trusted sources are listed higher than non-trusted sources.

Additionally, when you link to trusted sources, it helps you as well. These are called outbound links By referencing a trusted source, it is viewed that you are using trusted references, and that your content is documented.

Links are also what help create the Internet. When search engines find new web sites, they find them through other web sites. This is how these search engines build their database of web sites. When many sites are linking to the same site, or page, the importance of that site is increased.

Remove Broken Links


Remove any broken links on your current site. Over time, websites go away, they change URLs, and so on. When you have a link that breaks, it comes across as your site is abandoned and no longer maintained. There are a lot of great tools to help make sure that your links are in working order:



Remember – the search engines you are targeting are about delivering content to their users. If you help make it easier to deliver content, they’ll help drive traffic to you in exchange.

Contact Page


Create a contact page – correctly. At the bare minimum, have your name, address and phone correctly marked up with the appropriate micro data.  Take advantage of Google’s Map and Street View. By having it easy to find your location, and contact you, your page becomes easier to index. Search engines are designed to make it easier for users to find information and this type of content is considered to be valuable content.

Big search engines additionally favor local businesses over ones further away. This is why when you search for “driving range” or “dry cleaners”, local businesses are returned higher than a business a thousand miles away.

A few things to remember


  • Results do not happen overnight. While these are considered quick tips, they’re quick from an implementation perspective. 
  • Everything is automated. It doesn’t matter if your page looks amazing – the content has to be easy to get to and read by a computer. No one is out there manually ranking your page higher than your competitors.
  • Reputation is important. Do not take short cuts. Do not try anything shady that will get you black listed from a search engine. Once you’re blacklisted, you’re done. Your business may end up closing its doors if no one can find it on google.


Monday, March 28, 2016

Circular Dependencies

I’ve been working with relatively green developers the past few months. I’ve been trying to find an efficient way of letting them learn from their mistakes and be creative without damaging the integrity of the product. A lot of times, questions are asked of me that I explain as best as I can on the spot. Sometimes I do a quick search on Google and find a few articles that have been better thought out than my on-the-spot explanation. The other day, a developer asked me why circular dependencies weren’t acceptable. I explained it partway, but I couldn’t find a well thought out writing piece that explained it.

How this occurs

Suppose you have a Data Access Layer (DAL) and your own logging layer for auditing purposes. Inside your DAL, you’ve got a method that is supposed to insert a record into the database. In the event that you add a record to the database, you need to log it by calling your audit logging layer. The logging layer will accept the request, and try and log it to the database using the DAL.
Now you’ve got a problem. What if the method that was initially called in the DAL is now the one that my logging layer is calling? You’re going to go around and around in a circle.

What I saw

The project I inherited has been worked on for many years by over 100 developers of different strengths in their skill set. One area that I come across frequently is how projects are referenced. Rather than adding a reference to the project itself, developers add a reference to the DLL in the Bin. Sometimes this works, other times I would have to hit Build multiple times to get a complete build. The developer was getting around the circular dependencies problem.

This can “work” based on the build order. Visual Studio helps out as best as it can, but it cannot help out with references to DLLs directly. Projects references need to be added correctly for Visual Studio to help you.

How do you solve this problem?

The example above will never end. It violates the Single Responsibility Principle. The Single Responsibility Principle states that each object will be responsible for only one purpose. There should be only one reason to change the class. While I try not to go overboard with SOLID design, this is an example where you have two different layers that need to be called by a middleman.
Create a layer that calls the DAL directly. In this newly created layer, also call the logging. This prevents you from creating a circular dependency.

Each object now will follow the Single Responsibility Principle. The DAL only puts things into the database. The DAL does not care about logging, who is calling it, or what happens next. The Logging Layer will allow for other middlemen to call it, and it will behave the same way. It can log using the DAL if it wants, or it can call a web service, or log to the file system. Finally, the middle man is responsible for making sure that both the DAL and the logging are called. The middle man is responsible for the order of execution, but it does not care how either the DAL or logging occurs, just that it occurs. Each layer only has one reason to change.

Sunday, March 20, 2016

E-mail - The Friend of this Developer

Ed Wisniowski wrote a post called E-mail – the Enemy of a Scrum Master. He calls e-mail a time suck of busy work, and a poor way of conveying information to others. He makes some valid points about e-mail and how it is abused. Ed and I work together, and work together well. He and I are often receiving a lot of the same e-mails and included on the same exact chains.

I’ve seen lots of different tools tried to be used, some come and go. Others stick around longer and make traction with certain teams and that’s great. But it is specific to that team and everyone has to be involved in it and learn it. It doesn’t matter if they’re using webmail, Gmail, Outlook, Thunderbird, a Mac, or a cell phone . Everyone has an e-mail– it is the first thing that people get when they go to an organization. I had an e-mail at my current company before I had a computer!

What I’ve discovered as a developer is that e-mail is my favorite collaboration tool. Screen sharing is great, but there’s always problem with people not really paying attention, having connection issues, and being there. Trello is certainly popular, but it requires people to learn to use it, discussions about how to use it, and so on. Instant messenger is great, but then there’s different networks, versions, requiring the user to be there, and so on. E-mail on the other hand – everyone knows how to use it, e-mail isn’t dependent upon any software, and it doesn’t require both parties to be available.

But perhaps the best part of e-mail is when it requires my attention – on my time. Ed can send me an e-mail asking me for a status update, notify me that he is requiring a report for an upcoming meeting, or anything else and I don’t get interrupted. Writing software is tedious and requires undivided attention to write it efficiently. I turn off e-mail notifications because I don’t want to be interrupted. I do the same with instant messages. Every interruption anyone receives, including scrum masters, delays that task from getting done. Developer or not, flow is the hardest thing to find in the work place and it should not be destroyed.

Ed quotes the agile manifesto saying that face-to-face conversation is the most efficient way of conveying information. This is somewhat true- face to face communication is the most efficient way of getting information to people. If I’m working with a developer and we are speaking, having a hard time conveying information to each other, we can walk to a white board, sit down at a machine and look at something, look at documentation, etc. This requires developers to be in the same location. This can be a problem when half of your team is on the other side of the world. It can also be difficult because one of the parties may be elsewhere physically (like in a meeting) or mentally. Additionally, if there is something that is forgotten, or not clear, another instance of communication needs to happen again. This frequently happens with problem solving. With an e-mail, the communication is there in black and white for reference to at any time in the future.

Ed gets at least 3 times the number of e-mails I do. This comes from his role on the team, and the number of teams he's on. I frequently unsubscribe from automated e-mails. I have told people to not include me in certain subjects unless necessary. I decline meeting invites if I’m not needed. I recognize Ed’s problem of e-mail abuse and deal with it as best as I can.

E-mail needs to be used efficiently. Specific subject lines, bullet points and bold text are all great ways of making your e-mail efficient. The first lines of most of my e-mails frequently indicate what I’m trying to do and the problem I am encountering. Long e-mails are frequently ignored by readers, same thing with frequent or automated e-mails.

It takes time to develop the skill of managing e-mail, and communicating efficiently in them. I find myself taking an extra minute or two with writing and reading e-mails so that I do not waste others’ time.  Our job isn’t to communicate about software development, it is to develop the software. Communication just helps us write the software as a team.