Guests: Scott Nimrod
- Regarding the listener e-mail comment
- It’s often a losing battle to convince management who have an incomplete understanding of software quality to adopt new techniques (e.g., test-driven development).
- If you don’t have the set of skills to persuade your company, perhaps you could bring in an evangelist like Uncle Bob.
- It’s a catch-22: You need to show results to get people on board, yet you can’t get the results unless you have a chance to do the work in the right way.
- An option is to bring in a team short-term to demonstrate how to use the new techniques; at the end, the company chooses whether to model themselves on that team. This eliminates the need for learning those techniques from scratch — possibly poorly — and then having the process fail.
- Find out what actually matters to the decision makers in your organization (e.g., money, prestige, cost of failure) and press those buttons.
- Why use functional programming for mobile development?
- How does F# work with Xamarin for Android?
- Did you use a test-driven perspective?
- Why did you choose F# for this particular app?
- Scott wanted to break the stigma that F# is only for statistics or financial applications.
- F# is functional-first, and has lots of object-oriented programming support.
- F# has other benefits, such as its type system, discriminated unions to represent a distinct number of choices, and the option type (e.g., having no data is different from null, especially where repositories are concerned).
- What are the functional ways to deal with plumbing?
- The view model is just a mediator that sits between presentation (pages) and the domain logic (model). The view models and repositories are classes and are object-oriented.
- In the end there’s less code. Note that the Visual Studio tooling does not support measuring this at this time (November 2016).
- The tests are also implemented in F#. Because the repositories are built to an interface, you can run the tests in isolation.
- F# supports abstract classes and interfaces, just like object-oriented languages.
- There are namespaces to harbor the classes (i.e., view models, repositories) and modules to leverage the types declared and the pure functions implemented.
- What were you particularly happy with?
- Practicing railway oriented programming; everything else is just types.
- The pattern matching that’s associated with the Some type was helpful.
- If you’re accustomed to object-oriented programming and try something that’s a paradigm shift, it opens you up to new ways of thinking.
- There’s a trade-off between functional and object-oriented. Many of the libraries (e.g,. Xamarin.Forms) are object-oriented.
- There are times when you would like classes to behave in a functional way. For example, SQLite classes have setters; sometimes you don’t want setters so that you have immutability. You end up having to work around (i.e., ceremony) the fact that the setter should not be used.
- Perhaps the object-oriented classes would be okay for boundaries of the system (e.g., user interface); you want to keep the domain logic as pure as possible.
Better Know a Framework
Yarn – “Fast, Reliable, and Secure Dependency Management”
From show #1214 (Testing and Craftsmanship with Scott Nimrod); the listener appreciated Scott’s insights on craftsmanship, and tried to get shops he’s worked for to embrace TDD and automated testing. It can be an uphill battle to convince your team/company to adopt these practices. It comes down to insisting on an intentional culture: We value quality, but how do we demonstrate that?
Technology Giveaway Ideas
Scott recently purchased a Can-Am Spyder. He’d like to alter the vehicle to get 15-20 more horsepower, and use the remaining money to buy a Batman suit.