Category Archives: Coding

The Software Craftsman: Chapters 3 & 4

Chapter 3 of The Software Craftsman is spent defining what is a Software Craftsman. The earlier parts of the chapter are spent on talking about the history of Software Craftsmanship, that is all very interesting but I’d like to discuss the Software Craftsmanship manifesto.

Not only working software, but also well-crafted software

Not only responding to change, but also steadily adding value

Not only individuals and interactions but, also a community of professionals

Not only customer collaboration, but also productive partnerships

So, lets take a look at this line-by-line. The first line states “Not only working software, but also well-crafted software”. I think we can all agree as some form of software developer this is the best thing to strive for. The question then becomes, how do we get here? Sandro makes a statement that is truly interesting. After describing what any good developer would know to be truly well-crafted software, Sandro states “In order to evolve applications, developers must not shy away from changing them.”. This statement is so intriguing to me because it simply makes sense. You can’t have evolution without change, and you want your software to evolve to “well-crafted”, right? Well in order to do that, you’re going to have to make changes to the code, sometimes that may be big. Other times it may be small.

The next line says we should be steadily adding value to the project. This is again something that no one can refute as a good thing. However, I think as developers, we many times find it hard to “Leave it cleaner than we found it”. As you are reading this I can almost guarantee that you are thinking back to a time where you made a bug fix, but that bug fix made things just a little bit messy. I am sure whatever reason you had for putting in that bug fix messy like that was valid. However, this starts becoming an issue when everybody working on the project adds some messy code here and there. Eventually the system becomes maintainable and it’s an unfortunate side-effect to us being humans. However, as software craftsmen we need to strive to not get caught in this net and constantly clean up the code.

The next line says we need to be a community of professionals. I really like this piece. I’ve worked with people on both ends of the spectrum (not in the software field). On one end there are people out there who will give you the bare-bones, need-to-know information to get the job done. I am unsure as to why anybody would want to do this. Flip the coin and I’ve worked with people who are delighted to share their knowledge and understanding of the given subject matter. I think mentor-ship is incredibly important. If no one ever mentored a young developer and didn’t pass down the knowledge that’s been attained over their long career, then the young developer is going to fall into all the same pitfalls that has plagued software development for years.

This final line in the manifesto, is essentially stating: In order to succeed you will need to act as a professional. It also talks about the flip side of your manager needing to act as a professional and expect you to act as a professional. We should want to strive to produce the best possible products we can and in doing just that, I think a lot of the time the customers or the employers are more willing to work with you through issues. They are able to see past you as their employee or contractor and begin to see that developing software is a partnership. In order to create good software there needs to be professionalism on both sides of the coin.

 

 

Chapter 4 talked about attitude of the software craftsmen. More so the chapter discussed our attitude towards pursuit of knowledge. The pursuit of knowledge should be a personal burden and not a burden you try and place of your employer. It is your sole responsibility to continuously improve skills and knowledge as a craftsman.

Many of the ways to improve this were discussed in an earlier blog covering “The Clean Coder” book. I won’t re-hash something I’ve already discussed. But as a brief summary, some good ways to extend your knowledge is through books, blogs, podcasts, training events, seminars, meetups and coding challenges.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

Capstone Project: Sprint 2 Reflections

Another sprint down! This sprint was much more exciting then previous sprints. This sprint we were finally able to get OpenMRS and Ampath running locally on our machines so we could fiddle with it! I have a tendency to probe things I don’t understand until I either 1, understand them or 2 break them. Luckily this time was the former over the latter. Part of our previous sprint was to re-write an Ampath module, specifically the authentication. This was to help us learn how the REST API works and to generally learn how Angular works. We broke our sprint down into a few steps.

  1. Remove all traces of an authentication module from the Ampath directory tree.
  2. Attempt to rebuild a basic html/css of the original Ampath login page.
  3. Creating the Authentication routing so when we visit localhost it will successfully show us the html page we had just created.
  4. Make sure the login button successfully authenticates the user.

These four basic steps were what we felt as a scrum team, each individual could finish in the time we had for the given sprint. Unfortunately for me, because I enjoying coding and learning new things so much, I finished this by day 3 of our approximately 8 day sprint cycle. This left me with nothing to do, but plenty of time on my hands. I took that time to start researching TDD inside of Angular and how to write Karma tests. I really like the Karma framework and the way you simply declare what a test should be doing. I feel that it makes your testing output extremely easy to read, which is especially nice when you are showing it off to your wife who is by no means a software developer. But in the case of the real world, it gives someone A LOT of insight into what your code is supposed to do by them simply running test.


Tomorrow we start Sprint 3. From my understanding we are going to become familiar with JIRA and Ampaths issue tracking, so we can start (hopefully) resolving some issues for them! I am very exciting to be finally diving deep into this project and I hope to make some significant changes!

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapters 9 & 10

The Management. Such an interesting topic for a book dedicated to becoming a professional. What Uncle Bob is talking about here is two distinct forms of management; personal management and business management. Interestingly enough, these two topics become intertwined quite often. The first instance in which this appears in the book is when he talks about meetings. When the section starts on meetings Uncle Bob stated something I’ve been saying for years now.

There are two truths about meeting.
1. Meetings are necessary.
2. Meetings are huge time wasters.

My current position requires me to attend an occasional meeting, typically conference call style. The one thing I have found is that these meetings are very important to keep people up to date on whatever the contents of the meeting are and it helps get every one on the same page. However, every meeting I have been apart of was by no means short. I believe the shortest meeting I was ever apart of still lasted 45 minutes and by the end I walked out with no more knowledge then I had gone in with. Having had these experiences, when I saw Uncle Bob’s statement about the two truths of meetings I felt relieved that I wasn’t the only one that felt this way. Uncle Bob went on to talk about the different meetings that are had in a Scrum methodology of software development. Reading his thoughts on how these scrum meetings should go is very interesting. Currently with the Capstone class at WSU we are using Scrum and I can see how some of these meetings could go very long. I believe my team and I have done a good job and avoiding wasted time during these meetings, though.

The rest of chapter 9 covers ways to stay focused. Fortunately for me, most of these methodologies or theories appear to be common sense to me and I didn’t take away that much new information from these paragraphs.


Chapter 10 talks about estimates. Interestingly enough, I’ve had to create a few estimates in my line of work. Granted these were extremely small scale and usually completed in under an hour. The thing I learned from creating those estimates was, it’s incredibly hard to estimate time for when things go wrong.

As I mentioned in a previous blog post I listened to a podcast (You can find it here ) on software estimation a few months back. This chapter from Uncle Bob felt like a refresher on the things talked about in the podcast. What I find most fascinating about this subject, is that in my field an estimate is occasionally taken as “set-in-stone” and “done-deal” type of artifacts. However, that’s what business has turned it into and that was never what estimates were intended to be used for.

I don’t have too much more to say about estimates for software, seeing as I haven’t had to ever create one yet. However, I know when my time comes to finally use this information, I will be referring back to Uncle Bob!

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapter 7 & 8

This week in the Clean Coder I read chapters 7 and 8. These chapters covered a lot about testing. Acceptance testing and testing strategies to be specific. One of the more interesting topics that was talked about was estimates. This is an interesting topic to me because a few months back I listened to an interesting podcast on the same exact topic. Now Uncle Bob didn’t go into as much details here as did Steve McConnell on the podcast but he made the most important point:

Professional developers understand that estimates can, and should, be made
based on low precision requirements, and recognize that those estimates are
estimates.

The later-half of that quote is the important part. The statement that estimates are estimates is important. A lot of the time estimates are taken as absolute fact in industry and unfortunately this has become poor practice. Once we remember that estimates are estimates then we start taking uncertainty back into account and everyone is happier for it.


In chapter 8 Uncle Bob began talking about testing strategies. The first point he decided to hit was actually a reiteration of something he said in an earlier chapter, “QA Should Find Nothing”. My understanding initially is that as a developer you should make sure QA has NO role. However, this is not the case. The issue here was my view on the role of the QA engineers. I assumed that their job was to catch the bugs I missed. This is wrong. According to Uncle Bob their role should consist of creating automated acceptance tests and characterizing the true  behavior of an application.

The rest of chapter 8 continues to talk about the different types or stages of automated testing. These are things like; unit testing, component testing, integration testing, system testing and exploratory testing. These are all things I’ve talked about in previous blog posts so I won’t spend too much time talking about them. I do however, want to note one thing Uncle Bob mentioned,

Unit tests provide as close to 100% coverage as is practical. Generally this
number should be somewhere in the 90s. And it should be true coverage as
opposed to false tests that execute code without asserting its behavior.

It’s interesting that when he talks about code coverage he makes it a point to say that our tests should assert something about >90% of the code we’ve written.


That’s all for this week. I look forward to the next week’s chapters which talk about Management and go into more depth about Estimations!!

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapters 5 & 6

Ahhhh Uncle Bob, You always enlighten my week in some way!

This week in the clean coders I delved into chapters 5 & 6. These chapters talked about Test Driven Development (TDD) and Practicing respectively. These chapters really didn’t introduce these topics to me as these are things I’ve known about for a while but, they shed some light on a few areas that I haven’t heard of before.


In the topic of TDD Uncle Bob made a statement about TDD I hadn’t truly thought of before – Courage. He basically stated that when you follow proper TDD practices you gain courage to go back and fix code. The reason for that is because, we will know whether or not we actually broke the code or not when trying to “fix” it. I’ve worked on a few projects now that I went the wayside of TDD for two reasons, I didn’t really understand it and it seemed like a waste of time. However, even though these were small projects mainly going to be used by myself, when I come across a bug (That wouldn’t have been there in the first place if I’d TDDed) I am always nervous to touch the function or method again. I find myself between this state of “Well did the bug really hard the ability of the software to work? Should be fine.” or “During normal use this shouldn’t happen, I can leave it be.”. Where as if I had written tests I wouldn’t be fearful at all to rewrite and “fix” old code!


Chapter 6 delved into the topic of practice. Uncle Bob seemed to mostly talk about practice in the terms of physical speed of writing code. Like, writing the same method over and over to gain speed of being able to write methods. I’m not going to lie, this is something I’ve done. I’ve worked hard creating code snippets and practicing using key-binds to be able to get the most out of my workflow. The less time I spend writing “boiler-plate” the more time I actually get to be solving the hard problems (aka the “Fun stuff”).

Practicing your workflow and making sure you can code really quickly and you are good with the tools you are using is an important thing. However, one thing I feel Uncle Bob missed is practicing our language specific knowledge. I know for myself and the projects I’ve worked on, every time I don’t have to refer back to documentation is major time saved. One thing I’m not saying is that we should spend major amounts of time learning the deep dark corners of each language. What I am saying is that you should know how to do semi basic things in the language you are working in, without referring to documentation. I remember working on a PHP project where I was doing a massive amount of string manipulation and find/replace type stuff. The first few pieces of code I wrote, I would google my problem and typically find a similar solution to what I needed on Stack Overflow. I would then go to the PHP documentation and see what it had to say to try and figure out the rest of my problem. I found that I kept coming back to the same 4 or 5 functions so I decided to commit these to memory and really try and understand the full capabilities and “hackish” things you could do with each. The 3 or so hours I took reading the documentation about string manipulation probably saved me a week or two worth of work over the projects duration. I’d say that’s worth it!


All in all another great week from The Clean Coder. I am really enjoying this book and cannot wait to see what Chapters 7 & 8 have in store! Thank you Uncle Bob for this awesome book.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

Capstone Project: Week 3 Reflections

Yet another week here and gone. This weeks reflections will be fairly brief due to it being the end of our sprint and having a weekend with nothing to work on. However, we did have a sprint retrospective this week due to our sprint completion! The retrospective went well. Our team has really great communication and that has helped us, so these retrospectives are just re-caps of things we found during the week.

One of the major issues we discussed was with our daily stand-ups. Due to us having to all do them remotely there leaves a lot open for loosely worded statements. We were using a lot of “I’ll try” or “I might get it done” and we wanted to clear up this language and be more precise. We found that two things happened when we became more precise.

  1. Others trusted what we said and knew we were going to get done what we said.
  2. We held ourselves personally accountable to truly get the things done that we said we were going to.

These two things I feel are very important for any scrum team!


We did our first real sprint planning today and I am very excited to start working with the AMPATH code and seeing what true professional software looks like!

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapters 3 & 4

Another week done and two more chapters of The Clean Coder read. This book has been quite enjoyable and it’s nice to have assigned reading from school that isn’t so “text-booky”. It’s nice to have something to read that is someone’s personal experience in the field of software engineering and hear about his successes and mistakes.

Chapter 3 talked about the flip side of chapter 3, saying yes and when to say it. I really enjoyed this chapter because it’s something I had make an conscious effort to approach in the past 9 months or so. I noticed at work I was using the phrases “try to get it done” and “might get it done”. I noticed this was simply giving me an excuse to take things at more of a relaxed pace and maybe not giving 100% to my employer. In May or June (I do not recall the exact date) I was moved into more of an IT infrastructural role at work. My first task.. Fully rebuild the LAN/WLAN structure of the facility. The president of the company told me this was of high importance to get this done a.s.a.p. and requested I estimate how long this would take. After some research and getting the things I needed on order I gave my boss a definitive date of 2 weeks until completion. Because I gave the president a definitive date and completed 2 days ahead of that date. He then started giving me tasks that we meant for my immediate supervisors because he knew that we would get a date things would be done by. I have since found that using correct language and giving good time tables creates better channels of communication and makes everyone in the organization happier.


Chapter 4 was the first time I had some serious differences in my ideas compared to Uncle Bob’s ideas. This was negated by the fact that he explicitly stated:

You will likely not agree with everything I say here. After all, this is deeply personal
stuff. In fact, you may violently disagree with some of my attitudes and principles.
That’s OK—they are not intended to be absolute truths for anyone other than me.

I find it funny that he had to mention 3 AM code. It seems to me that the general idea behind anyone who has tried solving a difficult problem with programming has come across this at least once in their efforts. I know I’ve talked with multiple programmers who all say the same thing, “If you can’t solve it, walk away for a while”. I’ve even told this to many programmers. It’s just a fact of life with any issue you can’t solve immediately. If you walk away and let your subconscious mull on the issue, 9 times out of 10, you’ll find the solution.

The one major thing I disagree with Uncle Bob on, is listening to music when trying to be productive. I am never more productive without music. I imagine this is something that changes from person to person as well. I know for my wife, she’s the most productive when things are dead silent. Now she’s a not a programmer and has never written a line of code but everyone has their own way of steadying their brain to focus in on a task. Part of my ritual to steady my brain is put on some music. Now I know that he also mentions avoid getting into the zone and this is something I already avoided anyways. But what music helps me accomplish is two things. It helps me set a rhythm to my work that keeps easily distracted part of my brain busy. Also, when I have headphones in it lets others know that I am baring down to get work done. In my office there are times I simply need to get stuff done and don’t have time for idle chit-chat. These are the times I find music especially helpful. If someone needs me they know they can simply come in to my area and I will almost always take my headphones off immediately. However, it puts up some sort of barrier that tells people I am too busy to chat about non-work-related topics.


All-in-all, it was another good week of reading what Uncle Bob had to say on Software engineering! I look forward to see what he has to say in Chapters 5 & 6.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapters 1 & 2

The Clean Coder, this is my first book by Uncle Bob (Robert C. Martin) that I’ve read. Clean Code was on my list of “to read” books along with many other great books for programmers and developers. I had been working through Godel, Escher, Bach: An Eternal Golden Braid, albeit at a sluggish pace and that is a great book as well. However, I read through the first two chapters of The Clean Coder this week and it is simply amazing. It’s a breath of fresh air from all the other “coding” books. What’s most interesting about this book is the fact that, at least with these first two chapters, the ideas extend far beyond just software development. His ideas of professionalism will essentially make any type of career better.


Chapter 1 began by talking about Professionalism. Uncle Bob’s main point in this chapter to strive towards professionalism was taking responsibility for our problems. He elaborated on this and really pushed the point of “Do No Harm”, and by this he meant strive create working and easily maintainable code. Obviously this is what we all strive for as programmers, but he went a step beyond that and began talking about making the responsibility of “perfect code” ours and ours alone. Don’t leave it to the QA team to find and report bugs, take that on yourself. Don’t leave it up to someone else to refactor your code to make it more extensible, do that yourself. I really appreciated this point, because sometimes I find myself slipping into the mindset of, “I don’t need to take care of that, it’s someone else’s problem. Even if I don’t have the answer 100% I should do my best to help the person reach the solution faster.


Chapter 2 talked about Saying no. This is something I personally struggle with. I am the kind of person who generally can’t tell people no – especially my bosses. I was bread with the mindset, from an early age, that when your employer instructs you to do something, do it. Now not to say this is a bad mindset by any means, but in the real world this can seriously hurt your career and your companies future.

My first major piece of “Software” the I ever attempted at building was a simple front end for a database that also had some data crunching abilities. I also had to design and build out the database. My company is not a software company but an environmental engineering firm so no one really had a clue about building software/coding. Fairly straight forward and easy to build project, for a Senior in his CS degree program. However, when I started this program I was in my first year as a CS student. At this point I had written small programs in languages like Java or Python, but each of these programs did simply CLI type functions and nothing too complicated. I think the most interesting thing I had done at this point was a Fibonacci calculator that used recursion and memoization. I hadn’t approached any problems that essentially required an architecture that used a front end as well as needed data persistence. I had no idea where to begin but I dove in anyways. I told my boss it was going to take 3 months or so to build something like this. I was going to work non-stop over the summer on this project to get it done. The end of the summer came and I felt I barely had anything done. I was probably half way done with the feature sets that had been requested but felt I was on a roll. When my boss asked when it wouldn’t be done, I responded with the fact that I was “unsure”. I wasn’t sure what more bumps I was going to hit along the way because I had no experience at this. He gave me three more weeks and he wanted it done. I said okay.

I got all the features done is this program and it’s still being used at my company today. But I get requests constantly to fix some bug because I didn’t have time to test it. Because I didn’t tell my boss “No I can’t finish it in three weeks”, I was left with an embarrassing piece of work that I always afraid to show people due to my unprofessionalism during the development of that project.


In summary, I am extremely excited about going through this book and being able to apply what I read to not only Capstone project but also to my day to day work life. I think that not only developers should read at least the first 2 chapters of this book but anyone who builds a product for a customer.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.