programming

My notes from The Passionate Programmer

Chad Fowler - The Passionate Programmer

It’s been a while since I read Chad Fowler’s The Passionate Programmer.

Recently I found notes I did during reading it. I thought I would share them with you. It is tl;dr of every one of 53 chapters of the book.

1. Keep on radar bleeding edge technologies vs sunset technologies.
2. Follow job market requirements.
3. Understand business.
4. Be the Worst in the team so you can learn from others.
5. Learn/know different type programming languages (C#, C, python, prolog…).
6. Avoid fear-driven career choice.
7. Keep on radar known tech/platforms vs unknown(to learn).
8. Learn what is under abstraction layer of your programming language.
9. Use different technologies.
10. Log your excitement level over days.
11. Everyday learn something new about tech/tools you are using.
12. Learn how business work.
13. Have/find a mentor.
14. Be a Mentor.
15. Practice (Google Code Jam, Project Euler, Code Katas).
16. Know/learn Software Development Methodologies.
17. Read other’s code (and criticize it).
18. Automate tasks.
19. Do it now!
20. Predict the future – possible requested features (make it easy to implement it).
21. Make daily review (problems, processes to improve).
22. Understand your manager/company goals.
23. Set goals for you current job (long term).
24. Make boring tasks fun!
25. How much are you worth?
26. Share you areas of knowledge in job (implemented modules, deployment process etc.). Make documentation.
27. Measure (by metrics), improve, measure.
28. Work as hard as you can (no fb, twitter etc.).
29. Learn how to fail.
30. Say ‘No’ when you know you cannot do something.
31. Don’t panic.
32. Say It, Do It, Show It.
33. Be aware what others think about you (managers, team mates etc.).
34. Don’t make people afraid of you.
35. Track you decisions and analyze them (diary).
36. In person communication over email/Skype.
37. Have elevator pitch (business benefits of your recent work).
38. Have the mission!
39. Be present on-line (blog, twitter, LinkedIn).
40. Care about your brand (google yourself).
41. Contribute to open source!
42. Be remarkable (do something what will take a week in one day).
43. Propose changes/features to software you are using (mail author).
44. Be up to date with current/new tech.
45. Try to do your job as you are your manager.
46. Path is more important than destination.
47. Create map of your past, current and future career (and what your learn, when you lost time).
48. Try to be alpha geek (or follow some of them).
49. Ask your coworkers for feedback.
50. Avoid monkey traps (do not be too confident in some things, or review them from time to time; know your enemy – play with technology you don’t like).
51. Avoid Waterfall career planning.
52. Be better every day.
53. Try to go independent (e.g. 2 hours/day after work hours) – how much did you earn?

This book helped me to drive my career, and I am sure it will help you with your career!

Have you read this book? What do you think? Maybe you know some other books you would recommend?


[HockeyApp + VSTS] Generate release notes from last git commit message

Continuous Integration and Continuous delivery for Xamarin apps with VSTS and HockeyApp is awesome!

I blogged about setting up CI/CD pipeline with VSTS+HockeyApp a few weeks ago.

If you want to add release notes to HockeyApp release you have two options:

  1. Add release notes manually, by setting ‘Release Notes’ property, and update them before every build (AKA – option that sucks)
  2. Add path to release notes file, by setting ‘Release Notes (file)’ property, and update it before every git push (AKA – option that sucks less)
  3. Add path to release notes file, by setting ‘Release Notes (file)’ property, and generate release notes from last git commit message on every build (AKA – option that rocks)

Applying options 1 and 2 is easy.

To make option 3 happen you need to add script that will get last git commit message, and output it to the file that you specified in ‘Release Notes (file)’ property. This script should be executed before ‘Deploy to HockeyApp’ step (of course).

For Xamarin.iOS you need to add ‘Shell Script’ task that can look like this:

echo "last commit: $BUILD_SOURCEVERSIONMESSAGE" > commit.txt

*it will output file to the same directory where shell script is located

For Xamarin.Droid and Windows builds, you can create PowerShell script.


Predicting future with F# and Azure Machine Learning

Earlier this year I blogged about StockEstimator – my side project for predicting future stock prices. Recently in addition to F# module, which estimates future prices, I added Web Service that takes advantage of Azure Machine Learning to do the same much faster.

Last month I talked about my project at .NET Developers Association Meetup in Redmond and in Seattle. I streamed both session with YouTube live, and recordings are already available:

Both videos cover the same topics. Not sure, which one is better. However, there was one gentleman who went to both my talks and he said that the second one was better 🙂

In both presentations I do a quick intro to F#, an overview of Machine Learning, and how I took advantage of both to predict future stock prices.

If you are interested in F# I recommend you to check my Getting started with F#.

Presentation slides are available here (you can find there a lot of references to materials about F#, Machine Learning and Azure Machine Learning).

StockEstimator project is open source and available on github.

I’m not going to stop here. As you can see on my slides, and at the end of my presentations I have future plans to evolve this overnight project 🙂


Continuous Integration and Continuous Delivery for Xamarin.iOS with VSTS (Vistul Studio Team Services)

Visual Studio Team Services has great Continuous Integration and Continues Delivery support for Xamarin.

Recently I was configuring pipeline that would build the project, run unit tests (with xUnit), run UI tests (with Xamarin Test Cloud), and, if all tests pass, deploy new version of the app to Hockey App. During the process of creating VSTS build definition I encountered a few problems that I think are worth to share with you.

To make a basic build definition with building Xamarin.iOS project and deploying to Hockey App with VSTS+Xamarin check James Montemagno’s Continuous Integration for iOS Apps with Visual Studio Team Services first.

The issues I had, that were not described anywhere online:

  • I couldn’t use “Visual Studio Test” task for running xUnit tests, because every build definition on VSTS can be executed by only one build agent, and to build Xamarin project I needed Mac build agent.
  • How to run UI tests (with Xamarin Test Cloud) using the same build that would be later on deployed to Hockey App? Test Cloud requires init code that later on shouldn’t be present in deployed app.

Running xUnit tests with Mac build agent

This requires adding 2 tasks to build definition:

  1. Command Line task – to run tests with mono and xUnit console runner.
  2. Publish Test Results task – to display results in build summary

First, install xUnit console runner NuGet package.

To run tests, add command line task with following settings:

  • Tool: mono
  • Arguments: packages/xunit.runner.console.2.1.0/tools/xunit.console.exe YourApp.UnitTests/bin/Debug/YourApp.UnitTests.dll -xml UnitTestsResults.xml

Remember to replace YourApp with your app name, and set the same xUnit runner version that you have installed.

To publish test results, add “Publish Test Results” task with the following settings:

  • Test Result Format: XUnit
  • Test Result Files: **/UnitTestsResults.xml
  • Always run: true

Running Xamarin UI tests with Test Cloud before deploying to HockeyApp

The solution there is rather simple: build in Debug mode that has TEST_CLOUD preprocessor directive defined, run tests, and then build again in Release mode before deploying to Hockey App.

Delete files before build

For a while I couldn’t figure out why my tests are not passing when run from VSTS while they pass on my machine. It turned out, VSTS was using old builds for tests. I am not sure about MacInCloud, but if you are using your own Build Agent running on your Mac the directories that contains binary files are not being cleaned up before next build automatically. To avoid using old builds, you can add, at the beginning of your pipeline, “Delete Files” task and delete everything from bin/* and obj/*.

Summary

The final build definition looks like that:

Azure Status VSTS build definition

Let me know if I missed some details! I would be happy to add them! Also – if you know better way of doing that – let me know as well!


QCon Shanghai

QCon

Last month I had a pleasure to visit China and attend QCon conference in Shanghai.

I gave a talk about building large scale web apps with TypeScript where I updated my talk from last year to TypeScript 2.0, I showed TypeScript boilerplate project created by Remo Jansen, and using TypeScript with Aurelia Framework.

QCon

//video-coming-soon

QCon

I had a great turnout. Room overflow with over 150 people. I also got a great feedback. People could vote green(awesome), yellow(ok), red(bad), and I received 128 green, only 10 yellow and 1 red, which gives over 92% extremely satisfied attendees.

QCon

QCon has the best of the best from the industry. In Shanghai I met Jaime Levy (famous UX strategist from LA), Kinshuk Mishra (Director of Engineering at Spotify), Pete Soderling (successful entrepreneur from New York and Silicon Valley, founder of Hakka Labs & DataEngConf), Sid Anand (former Cloud Data Architect at Netflix who implemented Netflix migration to the cloud that Adrian Cockcroft later on told the World about, former Tech Lead at LinkedIn where he implemented typeahead search, currently Data Architect at Agari – company that provides fraud detection services), Wesley Reisz (Solutions Architect at HP and University Professor), and Igor Marvić (Software Engineer at Spotify).

China is very interesting place for developers, especially because of its scale. They have over 700 million Internet users! One developer from alibaba.com – largest online store in China – told me that during Singles’ Day (Guanggun Jie), which is equivalent of Black Friday in USA, they had over 400 million customers online at the same time. This is more than entire population of the United States (~325 million). They also sold more than $1 billion in merchandise in first 8 minutes! This is SCALE!

While I was in China I was using WeChat (their Facebook equivalent). People don’t use Facebook and twitter, as they are blocked by China Firewall. You can workaround it using VPN, but sometimes it works very slow, or not at all. Thus, it is much easier to just use WeChat. When I am in USA I use Facebook, messenger and twitter everyday. However, I noticed that on my iPhone 5S, WeChat works much better than all mentioned apps. It doesn’t crash, it’s fast, and it has many cool features. Want to add somebody to friends? Just scan they QRCode. You can also shake your phone, and WeChat will try to find closest person who is also shaking their phone, and show on your phone their profile, and on their phone your profile.

Besides the conference, which was very well organized, I was very impressed by how modern the city of Shanghai is. The skyline looks almost like New York City! Shanghai Tower (2,073 ft / 632 m) is the second tallest building in the WorldShanghai World Financial Center (1,614 ft / 492 m) is number 9 on the same list, which contains only 1 American building – One World Trade Center (number 6 – 1,776 ft / 541 m).

Shanghai - skyline

It was a great journey, and all Chinese people were very nice for me. I look forward to come back to China in near future!