My Very First Pull Request

We worked on the issue RAD-138 and we finally made our first pull request! Initially I had tried cloning from, and setting up two remotes, one for our team, and one from the base repository. My goal was to be able to pull from the main repository, and have our team push and pull to the cloned version I created. This worked for those purposes, but I had some difficulty squashing commits into a single commit due to me merging the OpenMRS master into our branch between doing work on the code, and work on the related tests.

I realized after struggling with squashing commits that I needed to fork the repository to send a pull request anyways, so I forked the repository and cherry-picked my commits from my previous branch, squashed them, and pushed them to a new branch on the forked repository. I learned a lot about git rebase, git cherry-pick, and how pull requests work in the process. It would likely have been tremendously helpful if I had actually read The OpenMRS Contributing Guide before beginning, as they explain how to set up the repositories, and use git pull –rebase to more easily squash commits, but I think learning more about git hands-on was incredibly beneficial.

I hope our pull request gets accepted and will let the world know 🙂

OpenMRS Radiology Progress

I finally got the OpenMRS Radiology Module working with vagrant. On my first attempt with vagrant up, it seemed that I must have gotten some errors that prevented the OpenMRS module from correctly building, because although I could access tomcat, the OpenMRS module was not and could not be started. However, I simply deleted the directory, cloned again from git, and ran vagrant up again. I then ran vagrant ssh and changed the mysql password by entering mysql, then running

SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘MyPassword’);

Upon doing this, OpenMRS then worked. I am now working on getting dcm4chee working, as the default user/password of admin/admin specified in the readme does not appear to be working.

The Clean Coder – Chapter 4 and 5

I continue to enjoy this book a lot and glean valuable information pertinent to developing myself as a professional and continue to enhance myself and my career. Chapter 4 focuses on Coding and the goals of a programmer. A software developer’s code must first and foremost solve the problem at hand. Code should solve the correct problem, and a professional developer must often determine what the correct problem actually is by interacting with the customer and business analysts. Any new code developed must integrate seamlessly with the existing system, and must be readable by any other developers.

In Chapter 4, Martin also cautions the reader about 3 AM Code and Worry Code and advises them to take a step back instead. Writing software at 3 AM after staying up all night trying to solve a particularly perplexing problem is not going to produce quality code, nor is coding while personal issues are at the forefront of your brain. I often find it hard to pull myself away from a difficult task and basically just sit at my machine making no progress, only to think of am easy and elegant solution on my drive home as Martin mentions later in the chapter. Martin asserts that taking a step back and clearing your mind will often result in seeing the problem in a new way, and a solution will come to you, and I would have to agree.

Martin also voices his opinions on The Zone and listening to music. I do believe that sometimes certain types of music like video game soundtracks help enhance my concentration and also somewhat block out outside distraction. I know distractions happen and are a regular part of work, but it can be incredibly detrimental to progress with distractions often occupying more time than dedicated development. I don’t mind interruptions as being part of a team and working towards a common goal is important, but if it hinders my own tasks and goals then it is actually quite harmful.

I’ve never really had Writer’s Block when it comes to writing code, as I usually can just move on to a different task or go through, but I see how pairing can help alleviate the inability to progress. Martin also mentions the dangers of working overtime and how it is generally only helpful in some cases. I would have to agree that helping others is also important even if it can sometimes be frustrating if you need to focus on a particular task, one should know that they also  require help sometimes, and asking for help when you need it is okay.

When I first began developing software professionally, I had the view of debugging Martin initially described in which it was something that had to be done and was not really a part of coding. But in part due to reading this book and my growing desire to be more professional, I have changed my views and always spend the necessary time debugging. However, I find it difficult to subscribe to Test Driven Development in some cases even though I believe it would be extremely beneficial.

Chapter 5 is entirely about the benefits of Test Driven Development, and Martin’s initial suspicion but eventual embracing of the practice. I’m not sure if I’m jaded or believe that it is very difficult to introduce TDD practices into an existing project with multiple systems involved. With JavaScript talking to a SaaS platform that then speaks to a Java backend, the amount of unit and integration tests is enormous, and verifying correct testing behavior for all aspects of the system is very time consuming, but generally worth it. Regression and automated testing are invaluable when it comes to developer productivity and assurance of correct behavior. TDD enables a developer to freely refactor code while ensuring that existing functionality is not disrupted. TDD also significantly reduces defect rate by verifying that new code is working the way the developer intends.

Overall I am enjoying this book and finding it incredibly useful as a tool to make myself more of a professional.

The Clean Coder – Chapter 2 and 3

I continue to enjoy reading this book and am gaining a lot of useful knowledge to further my career and mold myself into a professional developer. The topic of Chapter 2 is something I have difficulty with – Saying No. Management always wants to squeeze as much work as possible out of their developers in the shortest possible time frame, and often they may have unrealistic expectations. It is detrimental to oneself as well as the company if one can not assert their position that a particular task can not be completed by the timeline management has laid out. Saying no can be difficult, but doing so early can prove to be beneficial by managing expectations of what is possible.

The topic of Chapter 3 – Saying Yes is obviously the opposite of saying no. However, a lot of the lessons from Chapter 2 still apply. One must present themselves as a professional and assert their positions, but also be realistic with what they are capable of. If a developer can complete an assigned task, then they should have the confidence to say so. They should be willing to commit to the task at hand and never shy away from their responsibility.

I look forward to continuing my reading and applying what I’ve read to help achieve my career goals.

Setting up OpenMRS

Initially getting OpenMRS running was not that difficult, but connecting it to MySQL and installing the Legacy UI was a little more challenging. To Install OpenMRS, I simply cloned the repository to my machine. Initially I had tried importing the project into IntelliJ, but was having difficulty properly configuring JUnit to work with IntelliJ, so I switched to Eclipse. After importing the project, I used the command line to navigate to the directory the repository was in and ran mvn clean install. I then navigated to the webapp subdirectory and ran mvn clean install and then mvn jetty:run to get OpenMRS running whereupon I tried connecting it to my MySQL instance.

I had initially thought that I already had MySQL installed correctly, but I had to re-download an older version and the correct command line utilities to get it to run. I started MySQL from the command line using sudo /usr/local/mysql/support-files/mysql.server start

After starting MySQL the Database correctly connected to OpenMRS, but I still needed to get the Legacy UI. I cloned the Legacy UI repository, navigated to that directory, and ran mvn clean install. I then copied the legacy-ui-snapshot-1.0.omod to my ~/.OpenMRS/modules directory and everything was working!

The Clean Coder

I enjoyed reading the beginning of The Clean Coder very much. The Foreword in which the way that developers  are treated by management is highlighted rang true with my own personal experience. The Foreword also laid out the main theme of the book and gave a great purpose for continuing reading. The Preface was also very powerful, and displayed how management ignores the technical experts with dire consequences. The Pre-Requisite Introduction gave a good introduction to the author and his background. The most powerful part of the reading in my mind was in Chapter 1 where the author said that QA should find nothing, and that bugs making it to QA should be just as embarrassing as bugs making it to production. The emphasis on extensive testing and automated tests had an impact on how I do my software development. I enjoyed reading the beginning of The Clean Coder and look forward to continuing reading.