In a nutshell, it’s like Uber of roadside assistance.
I once experienced a dead battery on a highway. After I called my roadside assistance service, who generally dispatched the request to a near towing provider. It took over 5 hours for the tow to come. We could not do anything but waiting under the sun and busy highway.
The idea is very simple, first, for the user, there will be a smartphone app.
The app is used to send request for assistance to a server, information include:
auto GPS location
The app will show how many providers nearby, accepted the request, and provided a quote to provide the service.
In the car service provider side, there will be a tablet placed in the shop. It will display a request sent to the shop with all the information. It will ask the provider to bid, or decline the request.
The service provider can offer an estimate based on the limited information, the bid could be a range, but must include how long it will take them to reach the client.
Once the provider starts leaving the shop and heading to the client, the feedback will be provided to the client so that the user knows the help is coming.
The benefits of this idea could be: – save time to make phone calls (did I mention I had to wait for the phone to connect with the service provider?)
– save time to describe problem and location (we could potentially use AI to determine what the problem is and sen save time to describe problem and location d the request to the service provider)
– know who is coming (feedback is very important, did I mention when I was waiting, I had no idea how long it would take and if the help was coming?)
– offer multiple providers (because the request is sent automatically to the nearby shop, we are not relying on a single point of provider. In fact, I would be so happy if a help could come earlier with some extra cost at that time).
Honestly, this sounds like a good idea. Unfortunately, I never get the chance to implement it. The real issue is, chicken and egg problem. How do I convince car shop to participate when I don’t have any client? How do I convince user to join the program when there is no provider?
I guess the most important problem is: I don’t have any funding to support this idea.
Today I want to talk about programming, particularly, programming paradigm.
A quick background
I spent a year learning and writing Scala, which is a fascinating language. But I could not get my head around why we wanted to write functional way. And Martin Odersky even said this in one of his talk:
“if you have to inject dependency to your code, something is wrong”.
Probably not exactly the same words, but close enough.
After that year, I switched back to writing C#. Then I suddenly got a hit about why writing functional is such a joy. The code can be much more concise, so easy to write test, and naturally supports concurrency without using lock because no state is shared. Everything starts making more sense.
Give a talk about it
My current director asked me to give a talk about using functional in the project I have been working on. I told him yes, but I am not sure when I will have the time to do so. I actually like giving talk to the team. It feels like sharing your thoughts and learn from each other.
I did it on a few different topic after I joined Starbucks. I gave a presentation about my research long time ago in front of couple hundred people, I enjoyed it. Unfortunately, I always find it challenging to make the commitment to become a regular speaker in conferences. I admire those people who can.
But how do I really talk about functional programming to the people who have never done this before, when myself is not even a guru of functional programming?
The other day when I was running, a few slides came up in my head. So my idea is using them, hopefully.
My potential slides
It is just a tool
First, forget about the word “functional programming”
It is possible that some people will be offended. So I have to make the claim that this is only my personal opinion.
Second, it is important to remember, “functional programming” is just another programming paradigm. It is a style, and it is a tool to write code.
We use the right tool at the right time for the right job.
It is the same idea that I will probably not use a hammer to mow lawn, even though it might work. I will use a knife to chop vegetable or meat, not a scissor, even a scissor will definitely do the job as well.
Choose the tool wisely.
So choose functional paradigm when the situation is right.
I particularly like Anjana Vakil’s talk about programming across paradigm, if you never watch it, I strongly recommend it:
The following is how I believe most people consider a good software product:
If you Google “characteristics of good software”, pretty much the same thing.
Workable: the software is usable, in a working state, and it can realize business values;
Scalable: the software can be scaled in terms of performance, the number of users, as well as the number of business cases.
Testable: the software can be tested from the unit level.
Changeable: I like to say the word “changeable”, which means the team (not just the individual who originally writes it at the first place) can comfortably make change to the code. Others may prefer “extensible”.
Readable: The code is readable and understandable, or the software itself is well documented on the business case.
Note: extensibale and scalable are 2 different things here. If you notice, scalable is referred to the software can scale to more business cases, while extensible is referred to any developer can make change to the source code.
There is a reason a triangle being there.
The bottom is always “workable”. A software must work. If a software does not function, constantly crash, or does not deliver business values, nothing else matters.
Therefore, from a company’s perspective:
It is paying for a workable software that can deliver business values and meet business requirements. The biggest expectation from a company’s perspective is “it works”.
Next expectation from company’s perspective is, “can the software scale to meet more requirements”.
Generally, a company cares less everything else in the source code, unless that is a software company (maybe, hard to say, we all have heard how poor Oracle is written anyway). Therefore, no one will care how beautiful the code is written, or if it is using functional, procedure or imperative.
Only developer cares.
Actually, I probably should say only developers with self esteems care.
In contrast to the previous slide, the following is from software developers’ perspective:
Developers still care about the final product work. But we all know how easily a developer can be distracted in his/her own interest:
In the reversed order, developers care more about the things like how beautiful the code is written. Interestingly, the more ego the developer has, he or she is likely more focusing the things on top of the triangle.
Having developer ego is normal, in fact, it may be a good thing sometimes. It may not be sometimes though.
The funny thing about those things are important to developers, are naturally supported by functional paradigm:
Readable: small and single purpose functions, easier to reason the code logic, thanks to deterministic fashion.
Changeable: this may not be true for someone is new to functional programming; however, since FP advocates function composition, it is actually true that it is easy to make a change to composite existing function to make a change. Additionally, because it is designed to have no state shared and ideally each function is pure, it is less likely to impact existing business logic when making a change.
Testable: I did not believe this before, but it is definitely true that writing unit test for functional code base is way much easier and faster than writing unit tests for imperative style. No mocking framework is needed, and property-based testing is supported.
Scalable: One big advantage of functional paradigm is its strength in concurrency handling. Because it is so easy to make change, the source code can also be scaled to meet different business requirements.
Workable: nah, who cares if it works, it is beautifully written.
Not: functional code is generally/arguably considered hard to understand. That is actually caused by developer ego. As I mentioned earlier, it may or may not be a good thing. If the ego is too high, abusing functional style can be intimating for others to read. But it does not have to be that way.
What does it mean?
So we see company and developer have different perspective when looking at a software and its source code, but what does it exactly mean?
Of course, writing a workable software is the most important thing, because that’s what developers are paid to do. Also, because developers have ego, and different people like to use different paradigm, how do developers work together building a workable software product?
No matter we are building a client application, or a backend application, we will write it into small modules. Each module represents a business feature, and then we stitch them together.
Each module is communicated through contracts, i.e. events driven. Now each module can be coded in different paradigm.
Some module may be good to use functional paradigm because it has a lot of asynchronous processing, another module might be better to use imperative. It does NOT matter. A paradigm is just a tool. Use it in the right situation. I recommend to adopt functional paradigm in pure business logic.
This is an angle I haven’t seen very often:
writing modularized application so developers can avoid paradigm difference….
Only the 3rd idea in my journey, and I missed the date.
Initially, I planned the posting would always happen in Friday, so it would not interfere with my weekend activities. I guess I should now remove this rule. Friday I was busy in working out another idea at work, which seemed to be more important at that time. Saturday I was with the kid all day, since my wife had to work.
It comes out, it is actually a good thing.
Earlier I was going to post an old idea if I did it on Friday, but today (Sunday) I have a different idea.
I had a dream last night. A dream about a painting. I don’t know why I had such a dream, and I am also less interested in understanding what it implies. But it is an idea, which is, I should try to paint it in my later stage of life.
The painting in my dream is much sophisticated and complete. But overall, it looks something like this:
Basically, it is a person with a huge head, but very small body. In my dream, the person is simply just thinking. Yes, something like the thinker. But the illustration is much exaggerated (expanded). Unfortunately, when I sketched it, I had to put a desk and a computer in front of person, otherwise, it looks very weird.
The painting should be in oil. I am not sure if it is really the case in my dream, but that is what I think I will do.
A very close painting (I quickly search on Internet) is probably something like this one:
Unfortunately, when I showed my sketch to my wife. She asked if I was trying to draw this guy:
Ever since I decided to have this 1000 unrelated (aka useless) ideas, I was really looking forward to it. But then when Thursday comes, since I need to put one up on Friday, I get a little nervous, because I don’t know which one I should write.
So I dug my idea folder. I used to have a folder storing all those useless ideas. I found something laughable.
The original idea was:
An app similar to Slack. You create a channel in it. Next the app pretends many users joining your channels. But those are just bots. Now every time you (the owner) post anything, those bots will add reaction to your words, some bots will post a meme to the thread, and some bots may even post a comment to the thread.
However, it is important to note, all those bots will respond positively, such as “LOL”, “that is awesome”, “you are the best”, etc.
This app is called “Feel-Good-Channel” – an app with encouraging bots.
I even made a mock up of it:
Any user can create a new channel anonymously.
Any user can enter an existing channel to see (but no right to post anything).
A channel is automatically deleted after the owner leaves.
A channel can only be persisted if the owner is a registered user and chooses to do so.
A channel will automatically attract bots to join.
A registered owner can configure if the channel allows other real users to post.
All bots will make only positive comments, reaction, or memes.
The owner will be given a short survey to rate his/her happiness level when exit the channel.
In my original notes, the bots will slowly learn from what the real users post and then improve the “feedback” style. Once the bots become mature, the bots may even leave if the owner does not produce enough information or does not appear to require encouragement. Finally, the bots could learn from multiple channels, and find people with similar problem and connect them, if consented by the users.
Why is it interesting?
I still find this idea interesting because it touches 2 intriguing areas:
Natural Language Processing
NLP is always a hard problem to tackle. I am guessing with the Cloud-based machine learning, at least now we have more choices and tooling.
AI plays a key role in this app. If you think about it, we are building a robot that can understand natural language as well as human emotion. That is pretty interesting and challenging.
In fact, there are studies and discussion around the world
I also remember when I was working in the HCI lab, I helped research on a project that uses computer game to track and improve children’s emotion.
Many paper focus on facial recognition to determine the emotion. It is relatively easier than relying on only text. However, there are some old studies in psychology talking about how to do so with people’s handwriting:
And teenage feel more comfortable to use app and text.
Assume a user really feels down and start using this app, and assume we have an engine that highly accurately interprets the user’s emotion through wording. Due to the privacy agreement, the app will not know what this person is and where he or she is. However, if the app is able to derive the emotion level and the user’s physiological state, maybe we can do something:
The bots can determine this user needs a listener or not, if yes, respond accordingly.
The bots can determine the right moment to be funny to cheer the user up.
The bots can connect another user (if there is one) with the similar problem and prompt to connect them.
The bots may send an alert to someone to monitor the scripts.
How can such an app really help? I am not sure. But hey, I can only put that much nonsense at a time.
For years I have been trying to write a blog. However, I was never able to find a topic and stick to it.
Sometimes I want to write about coding as that is really primary daily activity. Unfortunately I am really not a very smart programmer. After all, there are way too many of these blogs all over the places and they are way more helpful.
Sometimes I want to write about user experience, as that is what I studied at grad school and my passion. I once even came out this idea that I would take photo of every poor experience I encounter in the real world and share in my blog. This is definitely not a novel idea, because I am pretty sure I have seen someone’s website exactly like that. Later I realize that I will have to be a person who constantly travel the world to make that blog work.
One night, for no reason I suddenly woke up around 4AM. I checked my phone. In retrospect, it is probably a better idea not to put your phone near where you sleep. I noticed the phone recommend a post about Howard Shultz’s president run. I opened it and read it (again, didn’t know why I even did that). I felt pretty disappointed after reading it, so I seriously made a comment. If anyone is curious, here is the link to the comment and the post.
After making that comment, I closed my eyes, but all I was thinking was to say something about what I would do to the health care if I were the president of United States. Can you believe that?
Also, guess what, no surprise, I lost the sleep for the rest of that night.
The good news is, the very next day, I realize that who kind of person I have always been. I am a:
– day dreamer
– unrealistic-er (?)
Basically, I am very good at nonsense, exactly just like my 7-year old daughter!
I should write a blog with nonsense as the topic!
I used to have so many nonsense ideas, some totally useless ideas, some Startup ideas, some funny ideas, maybe some even good ideas. I should put them together and write them up!
So here comes the first idea:
Writing a blog with 1000 unrelated ideas.
From 2019, March 1st, each week I will try my best to write up 1 idea (either I used to come up, or I will come up in the future), to 1000 of them. This should be fun. It serves no purpose or any intention, simply just want to see what I would gather in the end.