Storytelling for persuasion

2023-07-03 00:00:00 +0000

  • One key message to people, which will not work on its own
  • Find a story that the audience is easier to receive
  • Help audience navigate through challenges
  • End goal is behavioral change
  • What your audience’s problem?
    • What is their unhealthy reaction to it?
      • Don’t do anything - avoidance
    • What is their potential them? Put them to arena to shine
    • What ideas do I need them to embrace?
      • Open up to new ideas. Taking risks
    • What objections could they have to my suggestions
    • What do I want to transform them into
  • Analogy: likely need a few iterations to find the best analogy
    • What the audience already knows or reason with? Open a business
    • Your main topic - analogy with sports
    • the problem - not as easy as it seems
    • The key message or call to action - go to the field
    • The unhealthy approach - going unequipped
    • The recommended approach - find a coach
    • The result
  • The story of their potential future
    • customer, problem, solution, benefits, acquisition or implementation, vision of the future - ideally something we all care about
  • Personal story is most effective in persuading people
    • Context, action, results
    • How was your life before adopting the behavior? Expose your fault or vulnerabilities
    • What makes you change your behavior? Ideally one key event
    • How did you life change after that?
  • Voice
    • tongue twisters
    • Speak with a pen in mouth to warm up before the speak
  • Flow of the story
  • narration, action, break, action, narration
  • Appeal to senses
  • Transformation and belonging. Important to let them have a sense an agency and do them themselves
    • Take a step back and let them make decisions. Reward is them managing to do themselves instead of you getting thanks
  • Transformational customer strategy
    • customer’s top 10 problems, e.g., interviews
    • Educating customer. Build the trust
    • Call to action - buy my product
    • the purchase
    • using the product - turn customers into brand ambassadors
    • problems and errors
    • engagement and connection. e.g., BMW user group
    • brand ambassadorship
  • Human is geared to understand stories rather than data.
  • Data is the story, not your personal story
  • We were always required to find the story behind the story. The story wasn’t the hurricane; it was the person who rescued the dog in the middle of the flood. The story wasn’t the Super Bowl; it was the guy who spent all day lining the field or sewing the football. Look for the story behind the story.
  • Whatever you’d like to get across to your audience needs to provoke some kind of emotional reaction. Otherwise, it won’t get too far. Analyze what emotional hook your story has, find the heroes in the story and create a piece worth reading or watching, even if it’s an ad for a “boring” service or product.
  • add details to enrich story to > 30s
  • For example, say your company is launching a new product. You can share details about when your team came up with the idea, which is more exciting than telling customers you’re about to release the best new product. Talk about the roadblocks and small wins; make your audience feel part of your process.

Stages of storytelling

Exposition

  • Why are data important for the audience
  • Curiosity even though not relevant
  • Related to each person’s personal interest
  • Capture the attention by the story of one person - people would like to connect with them. But don’t solely rely on them because they are misleading

Rising action/Conflict

  • build excitement
  • generate conflict
    • two view points
    • one viewpoint with uncertainty
    • it also makes a happy ending even more uplifting
  • Start with the main message to takeaway and then work backwards, remind yourself of it all the time
    • e.g., back to the conflict, and the first 2 stages of the story telling
  • Tell audience what they are about to learn but not yet
    • Audience see the bomb, but not characters
  • build suspense around the problem through conflict, and then use data to resolve the conflict . “Good storytellers understand that a story needs conflict,” says Morgan. Is there a competitor that needs to be bested? A market challenge that needs to be overcome? A change-resistant industry that needs to be transformed? Don’t be afraid to suggest the road ahead will be difficult. “We actually like to be told it’s going to be hard,” says Morgan. “Smart leaders tell employees, ‘This is going to be tough. But if we all pull together and hang in there, we’ll achieve something amazing in the end.’” A well-crafted story embedded with that kind of a rallying cry means “you don’t have to demand change or effort,” says Sachs. “People will become your partners in change,” because they want to be part of the journey.

Climax

  • key findings
    • big pictures first, details appropriates
    • Reminder on the key hypothesis, main purpose of the data point
    • most important piece of message, “up means better”
  • how can the data can resolve the conflict
  • inconclusive data is ok - leaves suspension
    • Story isn’t over
    • let your audience excited for the resolution in the future and sequel

Falling action

  • details, context, interpretation
    • covers other conditions, go into more details
  • One of the biggest mistakes you can make is “putting in too much detail of the wrong kind,” says Morgan. Don’t tell your audience what day of the week it was, for instance, or what shoes you were wearing if it doesn’t advance the story in an artful way. But transporting your audience with a few interesting, well-placed details — how you felt, the expression on a face, the humble beginnings of a now-great company — can help immerse your listeners and drive home your message.

Resolution

  • key results, importance, action
  • Every good story has a closing. Your resolution should wrap up the story, give context to the characters and conflict(s), and leave your audience with a call to action.
  • Your objective and call-to-action (CTA) are similar, but your CTA will establish the action you’d like your audience to take after reading.
  • What exactly do you want your readers to do after reading? Do you want them to donate money, subscribe to a newsletter, take a course, or buy a product? Outline this alongside your objective to make sure they line up.
  • For example, if your objective is to foster community or collaboration, your CTA might be to “Tap the share button below.”

Techniques

  • 30 - 90 sec stories, better many short ones than a long one
  • one story, multiple meanings. same story to reinforce multiple points
  • Don’t start with “let me tell a story”, use transition phrase
  • Ease in
    • by the way
    • this reminds of a time
    • you know, this is life
  • Ease out
    • back to the point
    • where were we?
  • Pausing w/o answers will help grab audience’s attention
  • ask audience to participate in the middle of the presentation is a high risk/high reward
  • Humor is super high risk
  • For instance, if your target group is opinionated, the typical currency is charm. If your target group are thinkers, the currency is logic and numbers to make a point. For target groups that are meant to be inspired, try testing different images—images with one person versus images with a family, for instance—to accompany your story
  • You can be a central figure, but the ultimate focus should be on people you know, lessons you’ve learned, or events you’ve witnessed. And whenever possible, you should endeavor to “make the audience or employees the hero,” says Morgan. It increases their engagement and willingness to buy in to your message. “One of the main reasons we listen to stories is to create a deeper belief in ourselves,” says Sachs. “But when the storyteller talks about how great they are, the audience shuts down.” The more you celebrate your own decisions, the less likely your audience will connect with you and your message.

References

  • How to tell story with data
  • Storytelling to influence
  • Storytelling for Persuasion and Transformation

Conflict Management

2023-04-02 00:00:00 +0000

Notes from the following udemy courses

  • Conflict Management with Emotional Intelligence
  • Complete Guide to Conflict Management in the Workplace
  • Become a Master at Conflict Management at Home or Work

Thomas-Kilman Conflict Mode

Two dimensions: assertive and cooperative

Accommodating

  • The other side wins
  • People oriented approach
  • Good for
    • Not putting in more effort than the issue is worth
    • Knowing when to pick battles.
    • Need to build relationships
  • Cons
    • Does not really solve the problem when the issue is important
    • Viewed as weak if used too often
    • Sometimes can’t please everyone
    • Bad ideas may go through
    • Not good when expectations/roles are unclear

Avoiding

  • Remove one of the conflicting parties or ignore the issue for a while
  • Sometimes, just letting the people vent is enough for the individual to relieve frustration and move to the problem solving mode.
    • Let people cooldown, but let them know that you are not avoidng and will come back to you.
  • Good for
    • Useful when you need a cooldown period or need to think more on your stance, e.g., when one is emotional/angry.
    • Some issues may solve themselves given time and space
    • Trivial info
    • Pick your battle
  • Cons
    • Does not replace the solution. The issue may grow bigger as the time goes
    • The message is not heard

Compromising

  • Lose-lose
  • Good for
    • Time constraint
    • Relationship is importatnt
    • Both sides equally strong arguments
    • Moderately important goals
    • Temp mode for complex issues
    • Backup mode for collaboration. Compromise can set the stage for collaboration down the road, and allows both parties to feel heard.
  • Cons
    • Strategic or goals are involved
    • We don’t want to break the committment
    • Each side may still not understand the other’s needs, and trust may still be lacking.

Competing

  • My way or the highway
  • Good for
    • Goal oriented
    • Quick, difficult, or unpopular decisions
    • When people take advantage of you
  • Not good for
    • Morale
    • When there is resistence or sabotage

Collaboration

  • Win-win
  • People often assume win-lose is the only way. This assumption may not be true because the lump of labor is not constant
  • Need to understand each other’s needs and establish the common goals
  • Need good negotiation skills
  • Good for
    • Goal oriented and people oriented
    • Creative solutions
    • High stake issues,e.g., can’t compromise both parties goals
    • Both parties are willing to collaborate
    • Merge insights from different povs
  • Not good for
    • When lack of time. The process is time-consuming
    • Problem is trivial
    • No interested in collaborating

Stages of conflict

More intense conflicts are harder to handle.

  • Latent
    • Disagreement even before parties are aware
    • Step in right away
  • Preceived
    • Parties are aware
    • They favor their own point of view and defend their position.
    • They feel wronged or threatened.
  • Felt
    • Verbal
    • Raised voice
    • Animated conversation
    • Ignoring or avoiding individual
  • Manifest
    • One party takes action before talking to other parties
    • Gossiping, complaining
    • Communication is often hostile, passive-aggressive

Wording

  • Conflicts can easily be escalated by an ill-judged comment combined with an unfiltered response
  • We tend to exaggerate during arguments
    • causes of the situation
    • consequences of the situation
    • conditions of the resolution
  • “yes, but”
    • Negate the other’s contribution
    • Position your idea as the right one
    • “yes, and”
      • Affirming other’s ideas
      • Communicating that they have been heard
      • Building upon their ideas
    • More likely to use “but” rather than “and” in the heat of discussion
  • XYZ techinque, when, what, how I feel. Also works for positive reinforcement
    • “When X happens, I feel Y, because of Z.”
  • Can i disagree and commit? Will you trust me on delivering it, even though i disagree?
    • 100% commitment. No sabotoge or half hearted effort. No “I told you so”
    • Effort to make that decision a success
  • Share feeliing without judging and blaming. Leave ownership on the speaker
    • You make me so mad
      • I feel hurt that I didn’t hear from you
    • You are insensitive
      • I feel angry when I was called out publicly
    • You are undependenble
      • I feel disappointed when we can’t arrive at an agreement
  • Leveling statement
    • Starting stage or de-escalate during the dialouge
    • State a concern w/o blame or hostality
    • Express your desire to understand the other person’s point of view
    • Let them know you’d like to work things out together
    • Focus on the process of communication rather than content
      • It was upsetting to me to learn about the memo. However, I want to understand your pov and then figure out how we can better communication and coordniate our work in the future.
      • I was surprised by what you said this morning during our coffee break. It seems you have some strong feels about this matter which i’d like to understand.
      • I’ve been feeling uneasy in our relationship, ever since the board meeting in Sep. I’d like to understand your pov and see if we can get back to our previous working relationship
      • I sense you are not feeling good about our assignments. I am not either. Let’s agree to talk about this in an open way until we find a solution we both feel good about
      • I think we have different understanding of what he intended and what is fair to each of us. I’d like to understand your point of view and share mine as well and see if we can work this out
      • I’m not feeling good about how this is escalating and you’re prob not either. I want to understand how you are feeling and what we can do to calm our discussion and get it back on track.
  • Priming
    • State your best guess when other side closed down or is struggling identifying thoughts/feelings
    • I would guess you’re not in favor of what we’ve been discussing
    • You prob like to participate but not sure if it is appropriate
    • It seems you were offended by the comment
    • I’ll bet it has been a difficult statement
  • Immediacy
    • When you want to be heard
    • Commenting on the process of communication
    • can we take a time out for just a moment?
    • Seems that you are upset by my pov and you start talking over me. I want to hear what you want to say, but I also want to finish what I’m saying
    • Seems that it is hard for you to hear what I have to say

Third party intervention

  • Listen carefully and dispassionately. Avoid showing your opinion, even if one side seems right.
    • Ask them how to resolve the issue and to move forward
  • Talk to both parties separately first. May circle back and forth to clarify details
  • Instead of focusing on conflict as a behavior issue, focus on the communication of it.
  • Bringing all parties to the same table
    • Ask each party about past conflicts, how to solve them, and how to prevent future issues.
    • Agree and establish observable elements that will have an impact on the decision and outcome
  • Get agreed on what is agreed and the way forward
  • Remind each party of their obligations under the original agreement, and ask their opinion of the progress thus far, and if the conflict has truly been resolved.

Collaboration/Dialogue

Preparation

  • Manage the your own emotion before you start the conversation
  • What is my intent going into this conversation?
    • Often unaware
    • Outcome rather than the need of you being heard
  • Not committed to solutions going in

Invitation

  • Conversation starts poorly most likely ends poorly
  • Use soft start
    • Something i have been thinking about lately
    • I’d like to know you your point of view
    • Disatisfaction rather than blame
      • I feel like I am the one doing all the clean up
      • You people are such slobs
  • Clarifying you intent and/or concerns. Point out what you do and do not intend
  • Stating your commit to collaboration. Keep going back to it when you are bogged down during exploration

Exploration

  • This is the hard part
  • Common mistakes
    • Persuade, convince other into accepting your view at this stage
      • Ignore complexity
      • Only pay attention to the data that supports your pov
    • Moving too quickly into problem solving
  • Different assumptions set up for conflict because of ambiguity
  • Create a pool of shared understanding
    • Surface and understand the assumptions of all partities
    • Search for a common and more complete reality
  • Shared understanding does not mean agreement
  • Start by inquiring the view of others
    • How are you feeling right now about what we’ve learned?
  • Identify what you don’t truly understand.
  • if you want to prove one side is right and one side is wrong, you shut down comm, and parties move to polarization. Curiosity on other side’s story.

Collaboration

  • Unmet needs are the heart of the conflict
  • People are not fighting solutions, rather what is important to them.
    • Often the breaking point is different from the true cause.
    • Conflicts with team often are from the unclear expectations
    • Often they define the problem differently and have different goals.
  • Main reason for the conflict to continue is to focus on the position, rather than interests
    • Ask why such position is important to them
    • Motive often different from what they say
      • They make promises to customers without having even a clue about how much it takes to build a good product.
  • Brainstorming
    • Make sure everyone understands desired outcome
    • One thought at a time
    • No criticism
    • Outrangous ideas are encouraged
    • No discussion of ideas except to clarify its meaning
    • Build on other’s ideas
  • Consensus
    • Everyone has contributed to brainstoriming the solution
    • Support a final solution even though their favorite isn’t part of it

When someone is at the fight position

  • Try not to become frustrated or impassioned, because parties will be even harder to calm down and resolve the issue.
  • Conflict toxin kicks in when what is said is taken literally.
    • Let it pass
    • Ask using neutral, open questions
  • Disarm
    • Don’t aggrevate them by body language, e.g., pointing fingers, shaking hands
    • Let them express the burst of anger, and keep the neutral facial expression and body position
    • Paraphase the information
    • Question the concerns
    • Calm and confident position
    • Use the pace to lower the energy
  • Intervening
    • avoid body languages that is pushy or impatient, e.g., extended eye contacts, leaning in close
    • Clarify what you heard with qualities and quantities their points
    • Use open body/hand gestures to represent 2-3 options, and ask if a decision would address their concern
  • The awkward silence
    • When faced with an insult or a challenging questions, pause and think deepingly before answering
    • Helps move into the rational mind. Keep emotion under control. Answering what you believe rather than what others want to hear.

Be More Strategic

2023-02-02 00:00:00 +0000

  • After a lively debate, one person finally asked the right questions: What’s the overall goal here? What information is essential? What do we need to do with it once we’ve collected it? He pulled us out of the weeds and helped us to see the bigger picture, enabling us to make smarter, more informed decisions. Understanding the users’ needs and the goals for the flow helped the designer make it as efficient and enjoyable as possible.
  • Tackling a new research problem is exciting and invites creative, critical thinking. But it’s all too easy to jump in and get caught up in the details of crafting just the right wording for an elusive question or cultivating the perfect crescendo of questions. Remember to take a step back and consider the larger picture and the core goals for your research project. Why are you doing this research? What do you hope to get out of it?
  • Once you’ve collected abundant, rich data from your qualitative research sessions, you’ll need to sift through your data to identify the valuable insights that address your main goals. But don’t be tricked by fool’s gold! At first, it might be painful to disregard much of your data, but this is necessary to gain clarity.
  • Our stakeholders wanted to focus on the usability issues because we had the most control over them, but we weren’t sure that fixing the usability issues would address the larger awareness and adoption issues. We raised this issue, asking our stakeholders to clarify our key goals for the research—improving adoption or improving usability? Only once our team had agreed upon our main goal could I start planning appropriately targeted research.
  • Without adequate focus on your goals, your research will tend to take on a life of its own and morph into an ill-formed morass. In addition to delineating your research goals up front, it can be helpful to define the expected outcomes of your research. These could be anything from developing a journey map, to better understanding users’ mental models of a feature, to making a decision about the future of a product offering. By pausing to define the desired outcomes at the beginning of your research, you can stay more focused on your goals.
  • Work with your stakeholders to carefully craft your research goals. Once you’ve established them, they should be the North Star that guides you as you plan, moderate, analyze, and present your research.
  • You always need to come back to why you’re doing your research. What do you want to learn? What’s the bigger picture? What are some assumptions you may be taking for granted? What are you ultimately trying to get out of this research?
  • Sometimes we throw ourselves into planning and executing our user research, getting caught up in the details, until someone barges in and asks a simple question: Why?
  • The key to duplicating yourself is duplicating the systems and processes that allow for quality of work to remain high. For most, this is the biggest step back. You see margins drop and your time expenditure temporarily increases. It is predictably more chaotic and uncomfortable.
  • Often, people get caught up in the minutia of a task and overlook the impact. Take time to assess the outcome or results of your work, not just the actions you’ve taken. “What was the challenge I addressed? What specific benefits did my contribution have for my firm?” When you see you’ve had a positive effect and can label your accomplishment, you may be able to stop overanalyzing and move on.
  • Take some time every quarter or six months to evaluate where you are right now.
  • Instead of burdening yourself with speed, start asking yourself — “What do I need to stop?” How did I perform? How do I compare to my own standards? What’s a new experience you can add to your life or career?
  • Like everything, strategic thinking takes practice. If you don’t prioritise it, you’ll drop it in favour of tasks that might seem urgent, but that won’t get you where you want to be. If you make it a habit, it will become the best time you’ll ever spend.
  • When things are busy, but limited tangible progress is being made towards your end goal, you should take a step back and assess why.
  • Whenever you find yourself trying to make a big decision, move forward with some area of your life, overcome a challenge or obstacle or just feel like things aren’t where you want them to be, it’s important to take a step back, look at the big picture and identify what you really want before you move forward. When you step back from your life, your career, your path and look from a bit of a distance, you see things from a different perspective.
  • Reflect on the activities that helped you move ahead or wasted your time. Reflection time each day allows you to ask yourself if you what you learned and how to stay on track with your goals. This is where inspiration and creativity have a chance to grow and be seen.
  • “How do I make sure I’m thinking about the big picture, when I’m always working on a lot of small things that seem to take up all my time?”
  • But the transition from tactical leadership to strategic leadership calls on you to ask questions rather than answer them, to focus on your highest value work rather than “block and tackle,” to chart new paths rather than continue to operate within and execute the status quo.
  • Nurturing a relationship, such as one that could provide unique insight into a supplier, a customer or a competitor can be highly strategic.
  • The tactical mindset is about getting things done, putting out fires and being the expert. The strategic mindset is about aligning with organizational objectives, discovering the unknowns and being a facilitator between ideas, people and plans.
  • With the larger goals of the organization top of mind, they look for connections they can make across functional teams, departments and even operations. They put as much value in building relationships with peers as they do coaching their teams and building a leadership pipeline.
  • When you first get promoted to a senior leadership position, one of the hardest parts of the transition is getting out of the weeds. Let’s face it: every potential use of your time is not equally important. You have to prioritize and focus on the things that need your attention.
  • We often find that leaders make assumptions about the skills, capabilities and motivation levels of others by applying a one-size-fits all delegation approach. Instead, good leaders need to asses each individual’s will and skill level in order to determine who can be trusted to handle what, and how much direction vs. support each individual needs. The ultimate goal is to need to provide less hands-on direction and more support.
  • As a senior leader, highest value activities often include:
  • Coaching direct reports to build a leadership pipeline and improve retention
  • Nurturing strategic relationships with peers and brokering connections to break down silos and foster greater collaboration
  • Bringing the big picture view to your teams that are focused necessarily on their specific tasks and goals, by creating a climate that sets them up for success
  • Challenging the status quo to spark innovation
  • Creating a culture that supports the vision and values of the organization
  • Expanding your perspective also involves actively seeking information outside your sphere: both within your organization and outside it. Developing stronger connections with peers, both internally and externally, as well as with customers through regular conversation will improve insight into current situations
  • Without time for reflection, decision making becomes reflexive and based on past experience rather than a clear perspective on the current situation and potential opportunities. To come up with new, innovative approaches and to be able to gauge the likelihood of success, you need to devote some serious time to thinking.
  • Many clients know what they don’t want but aren’t as clear on what they do want. You need to be clear on what you want before you can effectively move forward.
  • Others know to some extent what they want, but it’s not nearly specific enough for them to go out and get it. Saying “I want a new job” is really different than saying “I want a part-time job where I can be surrounded by like-minded people in sports entertainment.”
  • Merely fantasizing about your goal is de-motivating–it actually tricks the brain into thinking you already have achieved it.
  • During analysis of your research findings, it’s important to focus on your participants’ deeper needs and wants, not simply accept their initial suggestions. For example, if a participant says she wants color-coded communications, dig deeper to find out why she wants this. Does she need quick visual cues to aid in skimming content, or does she just want more color in her life? Her answer will have significant design and product implications.
  • Make sure you don’t make assumptions based on what research participants say. Instead continue questioning participants until you fully understand their deeper needs. If you find a user has suggested color coding to help her categorize and scan communications more quickly, you can consider other options that would also aid quick skimming—such as clearer subject lines or having a consistent structure across all communications. As a researcher, you need to thoroughly understand the users’ problem and leave their solutions to product, design, and development.
  • If you’ve ever received feedback that you “need to be more strategic,” you know how frustrating it can feel. To add insult to injury, the feedback rarely comes with any concrete guidance on what to do about it.
  • Be proactive about connecting with peers both in your organization and in your industry to understand their observations of the marketplace. Then, share your findings across your network.
  • Common obstacles for leaders
    • “I’m not very organized with my time…”
    • “I don’t feel like I am adding value if I am not ‘doing’…”
    • “I don’t delegate to my team members as much as I should…”
    • “I don’t really know how to step back…”
  • If strategic thinking is your goal, you must master your ability to break free periodically from the day-to-day in order to think more broadly, beyond your functional area and onto the bigger picture. When he was running Microsoft, Bill Gates was known to take entire weeks off to ruthlessly prioritize and ponder solutions, not deal with problems.
  • Many managers find themselves in this trap – they are still so attached to the day-to-day execution of tasks that they have no brain space to do the strategic work necessary to advance themselves and their teams

Style: toward Clarify and Grace - Notes

2022-12-31 00:00:00 +0000

Chapter 4: Emphasis

  • Shift less important information to the left. One way to revise for emphasis is to move unimportant phrases away from the end of a sentence to expose what you want to emphasize
  • Occasionally, when we shift a phrase, we may have to separate subjects from verbs or verbs from objects. This sentence ends weakly. To create better emphasis, we put that short, less important modifier before the longer, more important object, even if we have to split the object from its verb:
    • No one can explain why that first primeval super atom exploded and thereby created the universe in a few words.
    • No one can explain in a few words why that first primeval superatom exploded and thereby created the universe.
  • As we have seen, the older information should come first, the newer last. When it doesn’t, we can often reverse the order of subjects and what follows the verb:
    • Those questions relating to the ideal system for providing instruction in home computers are just as confused.
    • Just as confused are those questions relating to the ideal system for providing instruction in home computers.
  • A way to recover the appropriate emphasis is to break the sentence in two, either just before or just after that important idea. Then revise the new sentences so that you guide your reader to the crucial information. That often means you have to isolate the point of a long sentence by putting it into a shorter sentence of its own
  • If you begin too many sentences with “There is” or “There are,” your prose will become flat-footed, lacking movement or energy. But you can open a sentence with there in order to push to the end of that sentence those ideas that the next sentences will build on.
  • When you introduce a technical term for the first time or even a familiar but very important term, design the sentence it appears in so that you can locate that term at the end, in its stress, never at the beginning, in its topic, even if you have to invent a sentence simply for the sake of defining or emphasizing that term.

Chapter 5: Coherence I

  • Principle 1: A cohesive paragraph has consistent topic strings.
  • Principle 2: A cohesive paragraph has another set of strings running through it that we will call thematic strings.
  • Principle 3: A cohesive paragraph introduces new topic and thematic strings in a predictable location: at the end of the sentence(s) that introduce the paragraph.
  • Principle 4: A coherent paragraph will usually have a single sentence that clearly articulates its point.
  • Principle 5: A coherent paragraph will typically locate that point sentence in one of two places.
  • The problem is to understand what your reader knows about your subject. Since we ordinarily write for readers who know much less than we do about a subject, it is always prudent to underestimate a reader’s knowledge and make themes explicit.
  • Don’t strive for “elegant variation.” When you use two words for one concept, you risk making your reader think you mean two concepts.
  • In short, we can introduce new topic strings and thematic strings in a single sentence. But just as often, we create introductions consisting of two or three sentences, or (though rarely) more. To be certain that our readers do not overlook the importance of those new topic and thematic strings, we put them into the stress of the last sentence of the introduction.
  • The issue of a paragraph may be one, two, three, or more sentences long; the issue of a section or short essay one, two, or three or more paragraphs;
  • Most of these problems usually result from the way most of us write our first drafts: When we draft, we are often happy just to get an opening sentence down on paper, never mind whether it sets up what follows (particularly since at that point we probably have no clear idea what in fact will follow). Only as we go on drafting the rest of the paragraph, section, or document do we begin to discover and explore some useful themes. But by that time we may be in the middle of the paragraph or essay, long past the point where our readers expected to find them.

Chapter 6: Coherence II

  • By POINT we mean the specific sentence on the page that the writer would send as a telegram if asked “What’s your point?” In fact, the better question is not “What’s your point,” but “Where’s your POINT?”
  • However long the issue, though, readers expect POINT sentences in a predictable position: in the last sentence of an issue. This is another reason why it is important to keep issues short. If you make your issue very long and do not clearly signal when you finish, your reader may take your POINT to be an earlier sentence.
  • What purposes are served by the sentences preceding the POINT? They typically provide transition from a previous paragraph, make a general claim that the writer will narrow in the POINT, or make a preliminary claim that the POINT sentence rejects
  • Think of an issue as the overture to an opera, in which the composer announces the themes that he will repeat, modulate, combine, and develop in a variety of interesting ways.
  • But predictably, a writer will put her POINT sentence at the end of the paragraph because she intends to develop, expand, elaborate, explore that POINT in the following series of paragraphs. In fact, if the writer uses the paragraph to introduce a whole document, then she will predictably locate her POINT at the end of that paragraph.
    • In a single opening paragraph such as this, a paragraph that constitutes the issue to everything that follows, the writer typically locates the main POINT sentence at the end of the paragraph, in the last sentence. And if the opening of an article or report consists of more than one paragraph, then the main POINT sentences will appear at the end of the whole opening.
  • If the paragraph is a body paragraph ,if it does not introduce a section or whole document, you can make your POINT sentence in either or both of two places: (a) at the end of the introductory issue, and (b) at the end of the paragraph; i.e., at the end of the discussion. But if the paragraph introduces a section or even a whole document, then you should put your POINT sentence at the end of that paragraph.
  • In the issue, introduce key thematic and topical words
  • In the discussion, keep strings of topics consistent.
  • In the discussion, repeat those thematic words or words related to them.

Chapter 7: Concision

  • Attributors and narrators tell your reader where you got your ideas or facts or opinions. Sometimes, when we are still trying to work out precisely what we want to say, we offer a narrative of our thinking rather than its results. If we eliminate the narrators and refocus attention on what the reader needs to know, we make the passage more pointed
  • Unless you have some good reason to hedge a bit, leave out the fact that any unspecified observer has observed, found, noticed, or seen something. Just state what the observer observed

Style: toward Clarify and Grace - Notes

2022-12-30 00:00:00 +0000

Chapter 1 - Causes

  • We write a first draft for ourselves; the drafts thereafter increasingly for the reader
  • We measure the quality of writing not just by what is objectively on a page, but by the way we feel as we construct new knowledge out of our experience with the words on the page.
  • Since a writer usually overestimates how much readers know, a writer should give readers more help than he thinks they need.
  • Once a writer expresses actions in nouns, she can then eliminate whatever (usually concrete) agents perform those actions along with those whom the actions affect

Chaper 2 - Clarity

  • Categeories of “unclear” writing
    • “abstract” or “turgid” - actions expressed in abstract nouns
    • “disjointed” or does not “flow” - Separated parts of the sentences that he should have kept together
    • “too technical” - used words that most of us do not understand
  • A quick method is simply to run a line under the first five or six words of every sentence. If you find that (1) you have to go more than six or seven words into a sentence to get past the subject to the verb and (2) the subject of the sentence is not one of your characters, take a hard look at that sentence;
  • When you align subjects and characters, verbs and actions, you turn abstract, impersonal, apparently expository prose into a form that feels much more like a narrative, into something closer to a story.
  • We usually feel we are reading prose that is clear, direct, and readable when a writer consistently expresses the crucial actions of her story in verbs and her central characters (real or abstract) in their subjects.
  • Most writers of turgid prose typically use a verb not to express action but merely to state that an action exists.
  • When the nominalization follows there is or there are, change the nominalization to a verb and find a subject
  • When you find consecutive nominalizations, turn the first one into a verb. Then either leave the second or turn it into a verb in a clause beginning with how or why
  • When nominalization is OK
    • The nominalization is a subject referring to a previous sentence
    • The nominalization names what would be the object of its verb
      • I do not understand either her meaning or his intention.
      • I do not understand either what she means or what he intends.
    • A succinct nominalization can replace an awkward “The fact that”
    • Some nominalizations refer to an often repeated concept
  • When passive is OK
    • we avoid stating who is responsible for an action
    • make your sequence of subjects appropriately consistent, then choose the passive

Chapter 3 - Cohesion

  • With every sentence we write, we have to strike the best compromise between the principles of local clarity and directness that we discussed in Chapter 2, and the principles of cohesion that fuse separate sentences into a whole discourse. But in that compromise, we must give priority to those features of style that make our discourse seem cohesive, those features that help the reader organize separate sentences into a single, unified whole.
  • To end a sentence well, we need only decide which of our ideas is the newest, probably the most complex, and then imagine that complex idea at the end of its own sentence
  • We can create a topic out of the object of a verb if we shift that object to the beginning of its sentence, before the subject
    • I cannot explain the reasons for this decision to end the treaty.
    • The reasons for this decision to end the treaty, I cannot explain.
  • We can also put topics in introductory phrases
    • As for abortion, it is not clear how the Supreme Court will rule.
    • In regard to regulating religious cuits, we must proceed cautiously.
  • The most important concern of a writer, then, is not the individual topics of individual sentences, but the cumulative effect of the sequence of topics.
  • Long sentences may not announce topics often enough or clearly enough to guide us through a multitude of ideas. We need topics as thematic signposts to help us assemble ideas in individual sentences and clauses into cohesive discourse.
  • The secret to a clear and readable style is in the first five or six words of every sentence. At the beginning of every sentence, locate your reader in familiar territories
  • Sometimes, we simply switch the subject and complement, especially when what follows the linking verb be refers to something already mentioned
    • The source of the American attitude toward rural dialects is more interesting [than something already mentioned].
    • More interesting [than something already mentioned] is the source of the American attitude toward rural dialects. ‘
  • If you have a very long subject that does not allow you simply to switch it to the end of the clause, you can occasionally turn it into an introductory clause, allowing you to construct two shorter topics
  • Among groups of related sentences, keep their topics consistent, if you can. They don’t have to be identical, but they should constitute a string that your readers will take to be focused.
  • You may find yourself using nominalizations as topics because those nominalizations refer to ideas in sentences that went before. That is an important use of nominalizations: to sum up in one phrase actions you have just mentioned so that you can comment on them
  • Run a line under the first five or six words of every sentence (in fact under the subject of every verb in every clause, if you can do it). Read the phrases you underlined straight through. If any of them seems clearly outside the general set of topics, check whether it refers to ideas mentioned toward the end of the previous sentence. If not, consider revising.
  • we can make our prose more immediate, more available to the reader, if in those sentences we can also make the reader the topic of a sequence of sentences.
  • Generally, use the beginning of your sentences to refer to what you have already mentioned or knowledge that you can assume you and your reader readily share.
    • Of all the wars in American history, none has exceeded the Civil War in the huge number of wounded and dead. The memory of this terrible carnage is one of the reasons for the animosity between North and South today.

Writing effectively

2022-11-27 00:00:00 +0000

References

Bring values to the reader

  • Writing is about changing the reader’s ideas and bringing values to your readers, rather than conveying your ideas to the reader.
  • launage as ways to deal with people - relationship between people, no longer about you, the writer
    • No rule makes sense without readers and functions in mind. Who is the reader and what is the function of the writing?
      • For example, use jargons and passive voice
  • Valuable work vs new/original knowledge. Readers care only the former
  • Underline the subject of sentences - do your readers care about this?
  • Tell what is the paper is about - what is the value to the reader?
    • ideas (does not suggest value) vs tools (purpose, use, value)
    • instead of start with background, identify a problem with the reader’s community. When we say background, we mean building the problem, not history
    • my paper will be about (only about writer, writing about the world - show me how much you know about this topic. I will assess your grasp), my paper will argue - tells you that what quetions you have this paper has answers (most room for reader)
  • Academic papers - I know what you are thinking, and you are wrong/unrealistic
  • Professional writing - I know what you need, and here is the value.
  • You must know the code of the community to create value. Capture them and create a word list. Have ten of them in the first two paragraph
    • Taking an article in the field, circle out words that create value to me

Misalignment between reading and writing

  • expert writer: writing about a subject where you have expert knowledge. Have to use writing to help thinking. This is different from jounalist’s writing, which don’t use the writing process to think of NEW ideas about the world
  • Writer: think about the world and write the text. Reader: read the text to know more about the world.
  • Most expert writers think and write at the same time, but this is not reader friendly. It is more about how much the writer knows rather than the world

Difference between school and work

  • Teachers are paid to read the text to care about you, rather than the world. But at work, you want to get paid and people read it
  • At work, Your readers do not trust you, thinking you are gonna waste their time.
  • When you hear “i don’t understand”, don’t explain, this is unlike teacher’s model. Explain: reveal the inside of your head
  • Why do you think like that? - teacher’s way. Your readers have the professional function of challenging what you write - different from teachers. Explain INSIDE values generated and persuations
  • More often than not the “gap” in the knowledge does not work - because it assumes the accumulative model. filling an infinitely gaps does not help

Focus and stress

  • Strucuture: focus of the sentence and stress at the end. Writer should control both for readers.
    • focus once we get it, it becomes invisible, and then we move to the stress part, often just the subject of the sentence
  • stress pos is near the end of a sentence. Along the way, have lesser stress points. A lot of stress points mean nothing.
  • The subject is known information and the verb gives new information about that subject. It is because this structure is so common that readers expect to find new information in the latter part of a sentence. This expectation is called the Known-New Contract.

Techniques

  • How to make readers feel important: however, netherliess, although, widely, inconsitent, reported
  • Create instability: anomaly, inconsitency, but , however, always
  • We value reading about bad stuff/conflict/trouble/tension - it is more entertaining, make ppl feel better about themselves
  • shorter sentence better with people wants to have fun, e.g., NYT opinions
  • persuation is based on what they doubt - know your (community of) readers: widely accepted, reported
  • “but” and point out they are wrong vs and I want to add something you didn’t you - they don’t care or even putting their voice in
  • Compare and contrast your ideas with concepts that your audience already understands, because you write mostly on evolutional ideas
    • This new app is similar to the Frambus app, except with much better graphics.
  • Writers start sentences with There is or There are to avoid the hassle of creating true subjects or verbs. If no subject exists, consider creating one
  • Place the pronoun as close as possible to the referring noun. In general, if more than five words separate your noun from your pronoun, consider repeating the noun instead of using the pronoun.
    • If you introduce a second noun between your noun and your pronoun, reuse your noun instead of using a pronoun.

Mixins anti-patterns in Ruby on Rails

2022-05-29 00:00:00 +0000

“Template methods”

Suppose we have the following setup


module M1 
    included do 
        def m1_method1
            building_block1
        end

        def building_block1
            implementation1
        end
    end
end
  
class C1
    include M1

    def building_block1
        override_implmentation1
    end
end

C1.m1_method1

Problems with this setup

  • Often building_block1 has a generic name. As a result, RubyMine and VSCode are not able to find definitions or references precisely. They return a giant list of methods with the same name instead.
  • Ideally, template method interface is abstract. A concrete implementation1 misleads me on the runtime behavior, espeically when the I find the definition through C1.m1_method1
    • What if I take out the M1.building_block1 or implementation1? Then we expect the classing mixining M1, e.g., C1, should implement or override building_block1., but there is no class or method signature to enforce this expectation. You can imagine my frustration when I find this during the runtime

Override mixin’s constant

module M1 
    STATE = "m1_state"
    included do 
        def m1_method1
            process(STATE)
        end
    end
end
  
class C1
    include M1
    STATE = 'c1_state'
end

C1.m1_method1

This setup frustrates the code reader. Imagine the sequence of actions:

  • The user finds the defintion of C1.m1_method1
  • The code runs, but STATE in m1_method1 is different from the definition in the same class.
  • The user finds the reference of the STATE, and the IDE returns 20 different places with 3 different overrides.

Stateless mixins that are not utils

module M1 
    included do 
        def m1_method1
        end
    end
end

module M2 
    included do 
        def m2_method2
            m1_method1
        end
    end
end

module M3 
    included do 
        def m3_method3
            m1_method1
        end
    end
end

class C1
    include M2
    include M3
end

C1.m3_method3
C1.m2_method2
  • Hard to navigate through layers of definitions, especially if any name is generic. Often IDEs are not able to resolve the method precisely
  • I prefer just merging stateless mixins

Written communications tips and tricks

2022-03-18 00:00:00 +0000

Phrases to avoid

  • Managmenet cliche
    • think outside the box
    • low hanging fruit…
  • jargon, fancy words, and acronyms.
    • Even if only 10% of audience don’t know them, don’t use it
  • Sign of making massive assumptions/curse of knowledge
    • Of course
    • as you seen, you will have seen,
  • Meaningless words
    • think, feel, believe,
    • just, sort of, extremely, absolutely
    • “My name is”, “i am writing to tell you that”
    • to the degree that, in the case of, in nature, of the fact that
  • Turn -ion, -ment, -ing, -ance into verb
    • Please submit your application - please apply
    • here is the report for approval - please approve this report
  • Avoid FYI messages.
    • If there is no action needed, most likely it is not important and no need to send it. Frame it into AIs

Clear & Concise

  • When assigning, be clear on AI, assign DRI, no “teams”, “someone”, or cc everyone
  • Active voice + strong verb means taking responsibility. This is difficult but increases credibility and builds trust, and vice versa
  • Use passive you want to move on and don’t want to point fingers
  • If there is no time to write it short and concise, then don’t bother wasting your effort
  • Remove same sentence and words multiple times in the paragraph
  • There is always more you could say, cut them down to what you should say, and finally to what you must say just to one message. one acts as a foundation for another

Email

  • Summarize the purpose of the email,e.g., including key deadlines, [action required] is ok. Ok to label the most important issues. Expand immediately after the subject line. AIs in simple sentences.
    • ACTION by Friday 1pm: healthcare speech
  • Smoothing over conflicts is for face-to-face. Harder to say no when in face to face. Email is the lowest cue so harder for reader to digest

Mindset

  • Mirroring: reflect your audience preference of communication
  • Readers implicitly have more expectation with written communication
  • Think hard about the goal/what you want from your writing, have an outcome objective and work backwards.
  • Peronsal connection - not as systems, focus on the impact on the readers. Work hard to ground the reality. What would actually mean the reader? Talk about people, and give reader a picture of what is happening
  • good writings come from editing and rewriting. Writing block is the fear of writing it bad. Embrace it
  • better clear rather than brief when you have to make a trade off
  • Main types of business writing
    • Informative. “As a result of this message, I want my audience to know X “
    • Persuasive
    • Negative/Show goodwill

Persuade

  • Starting with the word “you” sets the tone that the message is important to the user
  • So what?
    • Use tension. Show the audience where they could be now and where they could be - a user story
    • Justify solution.
    • Frame your proposal with “you view” From the audience with the you view “You will get this if we do that” instead of “I need this because…”. Show the bleak reality and show them what it could be if they follow your advice
  • Be direct with requests. Conditional phrasing will water down the message.
  • Reader’s attention is valuable and finite. Attention getter at the beginning + audiences remember last
  • build evidence
    • credibility - different from showing off
      • What you feel creditible may not be so to others
      • What my reputation? How much people know me?
      • How much background information we need
      • credentials we could use
      • Speaking the language we use
      • Quote is a way to borrow credibility
    • logic
      • aside from data, stats, use metaphors and comparable examples
    • emotion
      • Stories is order of magnitude more effective than facts
      • Fact is only 50% of persuasion. Emotional appeals - use anecdotes when possible, personal story is the best.
  • anticipating readers’ questions and answer them with facts and emotional appeals

Process

  • Starting with body, because beginning and end of the message are the hardest. Quantity over quality
  • Use writing to clarify the thought means that the document is confusing in structure and message. Need an extensive edit
  • Re-read your entire text. Re-read both questions and answers. If it is awkawrd to read aloud, then the text requires revision
    • have ear plug may help reduce embarassment
  • 25% planning, 25% producing, 50% polishing, but it is not a linear or waterfall model
  • Polishing: Think, revise (on the global issues, 45% of time), proofreading (5%, local issues). Works backwords from deadline

Structure

  • First sentence should contain a summary of the message and the action you want readers to take. It should be self-contained for the user to make a preliminary decision.
    • You have 30 secs to deliver the message, so try to reduce background because the reader can get back to you for more info. Leave background and details to the back
  • Order by the decreasing importance. Don’t build up to the most important part.
  • Summary should be <= 5 sentences. Main point + all AIs. Repeating info from summary section is OK, reinforces the impression.
  • Focus each paragraph on 1 main idea, can be only 1 line.
    • 8 lines or less or each paragraph
    • 1 topic sentence + 2-4 other sentences
    • Add a new line between paragraphs
  • Avg 15-20 words per sentence
  • 1-pager doesn’t need intro or conclusion.

YAML notes

2021-12-29 00:00:00 +0000

  • Superset of JSON. No literal tab for indentation. The indentation level can be one or more spaces.
  • The difference between single quotes and double quotes is that in double quotes you can use escapes, i.e., \t, \n
  • YAML supports multiple documents, and compliant parsers will recognize each set of dashes as the beginning of a new one
  • YAML documents in a stream may be preceded by ‘directives’ composed of a percent sign (%) followed by a name and space-delimited parameters
  • Common to use JSON Schema to validate, e.g., patternProperties, additionalProperties, anyOf
--- # These dashes indicate the start of a new YAML document
key: value
boolean: true
single quotes: 'have ''one'' escape pattern'
# Notice that strings don't need to be quoted. However, they can be.
however: 'A string, enclosed in quotes.'
# Multiple-line strings can be written either as a 'literal block' (using |). This is particularly helpful when defining shell commands
# a 'folded block' (using '>'): all newlines will be replaced with a single space
literal_block: |
    This entire block of text will be the value of the 'literal_block' key,
    with line breaks being preserved.

    The literal continues until de-dented, and the leading indentation is
    stripped.

        Any lines that are 'more-indented' keep the rest of their indentation -
        these lines will be indented by 4 spaces.
# Sequences (equivalent to lists or arrays) look like this
# (note that the '-' counts as indentation):
a_sequence:
  - Item 1
  - Item 2
  - 0.5  # sequences can contain disparate types.
  - Item 4
  - key: value
    another_key: another_value
  -
    - This is a sequence
    - inside another sequence
  - - - Nested sequence indicators
      - can be collapsed
# Since YAML is a superset of JSON, you can also write JSON-style maps and
# sequences:
json_map: {"key": "value"}
json_seq: [3, 2, 1, "takeoff"]

# YAML also has a handy feature called 'anchors', which let you easily duplicate
# content across your document. Both of these keys will have the same value:
anchored_content: &anchor_name This string will appear as the value of two keys.
other_anchor: *anchor_name

# Anchors can be used to duplicate/inherit properties
base: &base
  name: Everyone has same name

# The regexp << is called Merge Key Language-Independent Type. It is used to
# indicate that all the keys of one or more specified maps should be inserted
# into the current map.
foo:
  <<: *base
  age: 10

# Strings and numbers aren't the only scalars that YAML can understand.
# ISO-formatted date and datetime literals are also parsed.
datetime: 2001-12-15T02:59:43.1Z
datetime_with_spaces: 2001-12-14 21:59:43.10 -5
date: 2002-12-14

# enforce a newline to be kept
fold_some_newlines: >
    a
    b

    c
    d
      e
    f


# enter nulls with a tilde or the unquoted null string literal.
foo: ~
bar: null

#To save the last character, add a plus to the fold or block operators.
#  if the value ends with whitespace, like a newline, YAML will preserve it. To strip the character, use the strip operator.,i.e., - instead of +
bar: >+
  this is not a normal string it
  spans more than
  one line
  see?

d: !!float 123             # also a float via explicit data type prefixed by (!!)
e: !!str 123               # a string, disambiguated by explicit type
f: !!str Yes               # a string via explicit type

Radical Candor Notes

2021-10-09 00:00:00 +0000

  • Challenging people is often the best way to show them that you care when you’re the boss. Caring personally about people even as you challenge them will build the best relationships of your career.
  • Central difficulty of management: buidling a trusting relationship
  • The emotional labor is not just part of the job; it’s the key to being a good boss
  • “You need to do that in a way that does not call into question your confidence in their abilities but leaves not too much room for interpretation … and that’s a hard thing to do. I don’t mind being wrong. And I’ll admit that I’m wrong a lot. It doesn’t really matter to me too much. What matters to me is that we do the right thing.”
  • Implicit with candor is that you’re simply offering your view of what’s going on and that you expect people to offer theirs. If it turns out that in fact you’re the one who got it wrong, you want to know
  • You have to accept that sometimes people on your team will be mad at you. In fact, if nobody is ever mad at you, you probably aren’t challenging your team enough. The key, as in any relationship, is how you handle the anger. When what you say hurts, acknowledge the other person’s pain. Don’t pretend it doesn’t hurt or say it “shouldn’t” hurt—just show that you care. Eliminate the phrase “don’t take it personally” from your vocabulary—it’s insulting. Instead, offer to help fix the problem.
  • The hardest part of building this trust is inviting people to challenge you, just as directly as you are challenging them.” You have to encourage them to challenge you directly enough that you may be the one who feels upset or angry.
  • If we have the data about what works, let’s look at the data, but if all we have are opinions, let’s use yours.
  • Challenging people directly takes real energy—not only from the people you’re challenging but from you as well. So do it only for things that really matter. A good rule of thumb for any relationship is to leave three unimportant things unsaid each day.
  • I don’t have to spend a lot of time getting to know a person or building trust before offering Radically Candid guidance. In fact, a great way to get to know somebody and to build trust is to offer Radically Candid praise and criticism
  • The secret to winning, he said, is to point out to great players what they could have done better, even when they have just won a game. Especially when they have just won a game.
  • Start by asking for criticism, not by giving it. Don’t dish it out before you show you can take it
  • If a person is bold enough to criticize you, do not critique their criticism. If you see somebody criticizing a peer inappropriately, say something. But if somebody criticizes you inappropriately, your job is to listen with the intent to understand and then to reward the candor. Just as important as soliciting criticism is encouraging it between your team members.
  • The notion of a “right” ratio between praise and criticism is dangerous, because it can lead you to say things that are unnatural, insincere, or just plain ridiculous. Sandwich techique does not work well with experienced - may erode trust
  • “Hey, Alex, your fly is down. I always appreciate when people point it out to me when I’ve done the same thing. I hope you don’t mind my mentioning it.”
  • “Yes, and it was your job to convince me I was wrong and you failed!”
  • Do not use someone else’s name or authority to get a point across.
  • If, on the other hand, you can listen to the criticism and react well to it, both trust and respect will follow.
  • One technique is to count to six before saying anything else, forcing them to endure the silence. The goal is not to be a bully but to insist on a candid discussion—to make it harder for the person to say nothing than to tell you what they’re thinking.”
  • Remind yourself going in that no matter how unfair the criticism, your first job is to listen with the intent to understand, not to defend yourself.
  • A common concern that people raise about giving feedback is “What if I’m wrong?” My answer is that you may very well be wrong. And telling somebody what you think gives them the opportunity to tell you if you are
  • “situation behavior impact” to help leaders be more precise and therefore less arrogant when giving feedback. This simple technique reminds you to describe three things when giving feedback: 1) the situation you saw, 2) the behavior (i.e., what the person did, either good or bad), and 3) the impact you observed.
  • impromptu guidance really, truly is something you can squeeze in between meetings in three minutes or less. If you give it right away in between meetings, you will not only save yourself a subsequent meeting but also deliver the guidance in less time than it would take you to schedule the subsequent meeting. And the quality of your guidance will be much better.
  • When you try to soften the blow by saying, “Don’t take it personally,” you are in effect negating those feelings. It’s like saying, “Don’t be sad,” or “Don’t be mad.” Part of your job as a boss (and as a human being) is to acknowledge and deal with emotional responses, not to dismiss or avoid them
  • In which Radical Candor trumps political BS is to never let one person on your team talk to you about another behind their back. It feels like you’re being empathetic to listen, but actually you’re just stirring the political pot. Instead, insist that they talk directly to each other, without you. Hopefully, they’ll work it out.

Ruby/Rails/Rspec keywords

2021-09-04 00:00:00 +0000

Rspec

  • xdescribe
  • shared_examples
  • expect { }.to raise_error
  • it_behaves_like
  • create_list
  • raise_error
  • expect_any_instance_of
  • have_key
  • be_nil
  • be_successful
  • include
  • shared_context

Rake

  • task
  • TaskArguments.new
  • Task[].execute

Rails

  • ”«-SQL” block
  • around_action/before_action

ActiveRecord

  • .connection.execute
  • .update!
  • .find_by
  • .pluck

Ruby

  • raise/rescue
  • .to_i
  • .uniq
  • .present?
  • .nil?
  • .blank?
  • .to_h
  • .deep_symbolize_keys
  • .map(&:func)
  • .map(&:to_sym)
  • .merge
  • .with_indifferent_access

def print_phrase(&block)
  block.call
end

# the methods in ruby can take only one block
print_phrase { puts "Hello from block!" }

def print_phrase(amount, &block)
  amount.times.each do |x|
    yield
  end 
end 

def print_phrase
  puts yield 
end

print_phrase { "Example phrase" }

On CSS Flexbox

2021-09-03 00:00:00 +0000

  • The flexbox layout is direction-agnostic as opposed to the regular layouts (block which is vertically-based and inline which is horizontally-based).
  • Flexbox layout is most appropriate to the components of an application, and small-scale layouts, while the Grid layout is intended for larger scale layouts.
  • Replaces float and positioning in most cases

Concepts

  • main axis: The main axis of a flex container is the primary axis along which flex items are laid out. Beware, it is not necessarily horizontal; it depends on the flex-direction property
  • main size: A flex item’s width or height, whichever is in the main dimension, is the item’s main size. The flex item’s main size property is either the ‘width’ or ‘height’ property, whichever is in the main dimension.
  • main-start and main-end: The flex items are placed within the container starting from main-start and going to main-end.
  • Similar properties for “cross” instead of “main”

Properties for the Parent (flex container)

  • display: This defines a flex container; inline or block depending on the given value. It enables a flex context for all its direct children,i.e., display: flex;
  • flex-direction: This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside from optional wrapping) a single-direction layout concept. Default: row
  • flex-wrap: By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
    • nowrap (default): all flex items will be on one line
    • wrap: flex items will wrap onto multiple lines, from top to bottom.
  • justify-content
    • flex-start (default): items are packed toward the start of the flex-direction
    • left: items are packed toward left edge of the container, unless that doesn’t make sense with the flex-direction, then it behaves like start.
    • start: items are packed toward the start of the writing-mode direction.
    • center: items are centered along the line
    • space-between: items are evenly distributed in the line; first item is on the start line, last item on the end line
    • space-around:
    • space-evenly: items are distributed so that the spacing between any two items (and the space to the edges) is equal.
  • align-items: This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).
  • align-content: This aligns a flex container’s lines within when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.

Properties for the Children (flex items)

  • flex-shrink: by default will allow item to shrink when the container is nowrap and cannot fit items on a single line
  • flex-basis: auto — in this case the browser looks to see if the items have a size. If the items don’t have a size then the content’s size is used as the flex-basis
  • flex-grow: flex items can grow along the main axis from their flex-basis. This will cause the item to stretch and take up any available space on that axis, or a proportion of the available space if other items are allowed to grow too.
  • flex: This is the shorthand for flex-grow, flex-shrink and flex-basis combined. Most common format you will see
    • Setting flex: initial resets the item to the initial values of Flexbox. This is the same as flex: 0 1 auto. In this case the value of flex-grow is 0, so items will not grow larger than their flex-basis size. The value of flex-shrink is 1, so items can shrink if they need to rather than overflowing. The value of flex-basis is auto. Items will either use any size set on the item in the main dimension, or they will get their size from the content size.
    • Using flex: auto is the same as using flex: 1 1 auto; everything is as with flex:initial but in this case the items can grow and fill the container as well as shrink if required.
    • Using flex: none will create fully inflexible flex items. It is as if you wrote flex: 0 0 auto. The items cannot grow or shrink but will be laid out using flexbox with a flex-basis of auto.

React/JS notes

2021-08-15 00:00:00 +0000

useMemo

Motification: cache the expesive computation executed at rendering. Note that it is still a function at rendering time, so starndard limitations, e.g., side-effect, apply

Reduce re-rendering

cache the funcational component, so that when the parent components changes but the props to the child remains same, we useMemo on the child so it does not re-render in this case. Note comparing the props is by reference only

However, if the prop has a callback function passed in, most likely, this function will be regenerated when the parent re-rendered (even with the the same params). In this case, we can put the callback in the useCallback to prevent child re-rendering

How does react render works when the state changes

When render is called, it returns a new virtual DOM. We compute which real dom is changed by diffing the virutal dom recursively (tag, data, and children properties), mark the changed node as dirty, and then render the real dom

Async-await

  • On seeing await, the control will be yielded back to the caller of await. Without await, async will run synchrounously
  • Async functions always return a promise. If the return value of an async function is not explicitly a promise, it will be implicitly wrapped in a promise.

Context

Motiviation: share global data amount component tree nodes

If you only want to avoid passing some props through many levels, component composition is often a simpler solution than context, but moving more complexity higher in the tree makes those higher-level components more complicated and forces the lower-level components to be more flexible than you may want.

React.createContext: When React renders a component that subscribes to this Context object it will read the current context value from the closest matching Provider above it in the tree.

The defaultValue argument is only used when a component does not have a matching Provider above it in the tree. This default value can be helpful for testing components in isolation without wrapping them.

useEffect

Common side effects

  • Mutations
  • subscriptions
  • timers
  • logging
  • async tasks. By definition, this should/does not block the browser from updating the screen

The function passed to useEffect is going to be different on every render. This is intentional. In fact, this is what lets us read the count value from inside the effect without worrying about it getting stale. Every time we re-render, we schedule a different effect, replacing the previous one.

JS keywords

  • Window.localStorage

Good company cultures I can reuse

2021-02-22 00:00:00 +0000

Amazon’s Leadership Principles

  • Although leaders pay attention to competitors, they obsess over customers
  • They act on behalf of the entire company, beyond just their own team. They never say “that’s not my job.”
  • As we do new things, we accept that we may be misunderstood for long periods of time.
  • They seek diverse perspectives and work to disconfirm their beliefs.
  • Many decisions and actions are reversible and do not need extensive study. We value calculated risk taking.
  • They are vocally self-critical, even when doing so is awkward or embarrassing
  • are skeptical when metrics and anecdote differ. No task is beneath them

Netflix Culture

  • You only say things about fellow employees you say to their face
  • We have no bell curves or rankings or quotas such as “cut the bottom 10% every year.” That would be detrimental to fostering collaboration, and is a simplistic, rules-based approach we would never support. We focus on managers’ judgment through the “keeper test” for each of their people: if one of the members of the team was thinking of leaving for another firm, would the manager try hard to keep them from leaving? Those who do not pass the keeper test (i.e. their manager would not fight to keep them) are promptly and respectfully given a generous severance package so we can find someone for that position that makes us an even better dream team
  • Ultimately, your economic security is based on your skills and reputation, not on your seniority at one company. At Netflix, you learn a lot working on hard problems with amazing colleagues, and what you learn increases your market value. Knowing that other companies would quickly hire you if you left Netflix is comforting. We see occasional outside interviewing as healthy, and encourage employees to talk with their managers about what they learn in the process.
  • Picking up the trash is the metaphor for taking care of problems, small and large, and never thinking “that’s not my job.” We don’t have rules about picking up the real or metaphoric trash. We try to create a sense of ownership so that this behavior comes naturally.

Sorted set problems

2021-02-16 00:00:00 +0000

On bridge and cut vertices

2021-02-04 00:00:00 +0000

Example problems

On Eulerian path/cycle

2021-02-03 00:00:00 +0000

On elevator pitch

2021-01-25 00:00:00 +0000

Dos and don’ts

  • Goal is to attract more attenion, not convincing people to hire you upfront
  • Around 30 secs ~ 80 words. No need to recap the entire history. Focus on what matters most
  • SLOW DOWN. To fix it, record your speech, but avoid the trap of over-practice. That makes it sound unnatural
  • Structure
    • Who you are, and your background
    • What you do, and your unique selling propostition, i.e., what can you bring to the team
    • What you want to do/Your goals. What you are looking for
  • Omit negative/dislike areas
  • Use terms based on target audience. Use different pitches for different audiences

My technical elevator pitch

As a backend engineer, I have architected and maintained systems that serve > 20m users and > 1k TPS. I was part of the team that build the leading payment app in Japan from the very beginning, and my code processes billions of dollars each month. I am also the system architect that increased the throughput of this app by a factor of 3. I am excited to work with top engineers to deliver new impacts in the fintech domain or with high traffic systems.

How to answer behavioral questions

2021-01-25 00:00:00 +0000

STAR Method

  • One or two sentences per STAR. Easy to have too long/detailed answers when you are stressed
  • 45-60 secs/120-150 words answer. Too short it doesn’t cover enough details. Too long it becomes rambling
  • After the high level STAR, ask the interviewer if need to provide more details
  • Situtation: Scene and details of example. Make things as measurable as possible, as the interviewer lacks the context of your mind image.
  • Task/Goal/Role: your role/job/goal in the situation. Don’t mistake this for Action
  • Action: What YOU did to achieve the goal. Not what YOUR TEAM did, or what you WOULD do.
  • Result: need to emphaize on the (ideally measurable) impact of your action. Often this was not done enough by candidates
  • Focus on facts and avoid comment/conclusions. If you really need to include comment/conclusions, use the eval from the third party, not yourself.

Tell me about a time you took a risk and failed.

  • Defind failure definition upfront: not meeting expectation/goal/highest standards(maybe)
  • Try not to spend too much time setting the stage, and get to the punch line quickly
  • Start with the situation, and explain why it was challenging. Then go into what you specifically did to try and rectify it
  • Wrap up with your lessons learned, ideally with postive impacts of this learning to future events

Tell me about a mistake you’ve made.

  • How did you handle it?

Tell me a time where you disagreed with your manager

  • Disagree and commit. the bulk of your answer should be talking about how you delivered successfully in spite of not being on board with the initial decision
  • Decision was made after conflict, doesn’t matter which side won
  • Be clear about what you don’t agree with and offer alternatives
  • When I disagree and was wrong, it is because of unknown unkowns. Known unkowns would mean i didn’t do due diligence
  • Would be nice to define “right/wrong” but probably too much detail to cover in 1 min

Describe a time when you struggled to build a relationship with someone important.

  • How did you eventually overcome that?

Tell me about a time you were under a lot of pressure.

  • What was going on, and how did you get through it?

Give me an example of a time when you were able to successfully persuade someone to see things your way at work.

Describe a time when you saw some problem and took the initiative to correct it rather than waiting for someone else to do it.

Tell me a time you had received a negative feedback

  • Explain a situation where you improved your performance after receiving constructive criticism.
  • Talk about how you listened and made changes when a boss or client critiqued your work.
  • It can also be insightful to describe a time when your work was unfairly criticized, and how you were able to rebuff the criticism without making anyone look bad.
  • Do not make the mistake of going into excessive detail about any work slip-ups—instead, focus on your positive reaction to criticism.

Editorial: LC premium set 4

2020-12-21 00:00:00 +0000