├── LICENSE.md ├── README.md └── reviewingCode.md /LICENSE.md: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. 396 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Leading Engineers 3 | 4 | This is a set of knowledge for leading engineers in an organization, as evidence driven as possible. This can never encompass everything but can aspire to be a useful place to start. 5 | 6 | * Constructive feedback and contributions are always welcome. 7 | 8 | 1. [As a Leader](#as-a-leader) 9 | 1. [Growth](#growth) 10 | 1. [Focus](#focus) 11 | 1. [Prioritization](#prioritization) 12 | 1. [Coaching](#coaching) 13 | 1. [1on1s](#1on1s) 14 | 1. [Feedback](#feedback) 15 | 1. [Training](#training) 16 | 1. [Motivation](#motivation) 17 | 1. [Performance](#performance) 18 | 1. [Hiring](#hiring) 19 | 1. [Interviewing](#interviewing) 20 | 1. [Combating Bias and Diversity Strategies](#combating-bias-and-diversity-strategies) 21 | 1. [On who to hire](#on-who-to-hire) 22 | 1. [Teams and Meetings](#teams-and-meetings) 23 | 1. [How to stay on top of technical developments?](#how-to-stay-on-top-of-technical-developments) 24 | 1. [How to evaluate performance?](#how-to-evaluate-performance) 25 | 1. [Technical Debt](#technical-debt) 26 | 1. [Sharing Progress with 3rd Parties](#sharing-progress-with-3rd-parties) 27 | 1. [Self service tools and infrastructure](#self-service-tools-and-infrastructure) 28 | 1. [Managing work cadence and deliverables](#managing-work-cadence-and-deliverables) 29 | 1. [Distributed teams](#distributed-teams) 30 | 1. [Books](#books) 31 | 1. [Blogs](#blogs) 32 | 33 | ## As a Leader 34 | 35 | A leader in an organization should seek to emulate the following: 36 | 37 | 1. Seeks to serve those who they manage and place the needs of the team before their own. 38 | 2. Practices '[Extreme Ownership](https://www.amazon.com/Extreme-Ownership-U-S-Navy-SEALs-ebook/dp/B00VE4Y0Z2)'. A leader is always responsible and must own any mistake or shortcoming of the team. i.e. "There are no bad teams; just bad leaders" 39 | 3. Creates a ['Psychologically safe'](https://www.youtube.com/watch?v=y6YbAvEtS8k) environment for the team members to succeed. Safe environments are the basis high performance per Google's [ReWork study](https://rework.withgoogle.com/blog/five-keys-to-a-successful-google-team/), [Maslow's heirarchy of needs](https://en.wikipedia.org/wiki/Maslow%27s_hierarchy_of_needs), and other similar studies. 40 | 4. Work to create an atmosphere of humility, respect and trust. 41 | 5. Scale themselves and setup a culture of autonomy 42 | 43 | ## Growth 44 | 45 | A leader should encourage the following: 46 | 47 | 1. [Growth mindset](https://www.brainpickings.org/2014/01/29/carol-dweck-mindset/) Challenge themselves and others with assignments that stretch their capabilities 48 | 2. [Mastery](https://en.wikipedia.org/wiki/Drive:_The_Surprising_Truth_About_What_Motivates_Us) Aim for a cadence of academic output with the goal of producing small tangible items of value over time. For example, one of more blog posts, open source & conference contributions, Stack Overflow questions, and other such efforts with a cadence, such as quarterly. 49 | 50 | ## Focus 51 | 52 | A key to being able to grow is being able to focus. Studies and some personal experience suggests that engineers need at least [4 hour blocks](https://chase-seibert.github.io/blog/2017/04/14/engineering-meeting-strategies.html) of uninterrupted time to achieve flow. Other literature, such as [Deep Work](https://www.amazon.com/Deep-Work-Focused-Success-Distracted/dp/1455586692/ref=sr_1_1?ie=UTF8&qid=1527856567&sr=8-1&keywords=deep+work+cal) highlight the benefits that many successful knowledge workers have achieved though utilizing periods of intense focus. This is also famously described albiet from a different perspective by the blog post ['Maker's schedule, Manager's schedule'](http://www.paulgraham.com/makersschedule.html) which highlights that a single meeting can ruin the afternoon or morning on a maker, whereas filling another slot costs a manager little. 53 | 54 | * Protect engineers time, seeking to give as long uninterrupted stretches possible 55 | * Perform daily standups over slack/chat when possible 56 | * Timebox meetings 57 | * Batch meetings so that they can occur together 58 | * Allow engineers at least 24 hours to respond to any email or instant message 59 | * Encourage those nearby to take calls in office rooms rather than the desk in the open office space 60 | 61 | ## Prioritization 62 | 63 | ``` 64 | I have two kinds of problems, the urgent and the important. The urgent are not impor‐ 65 | tant, and the important are never urgent. 66 | - US President Dwight D. Eisenhower. 1954 67 | ``` 68 | 69 | The job of a leader is to force yourself (and lead the team) to work on important things, rather than urgent things. 70 | * Delegate - many urgent things can be delgated back to other leaders in the organization 71 | * Schedule Dedicated things - Block out time to work on important tasks such as strategy, career paths, and higher level collaboration 72 | * Find tracking system that works - Method of tracking goals including low level pomodoro type focusing to high level goals such as [OKRs](https://www.whatmatters.com/faqs/okr-meaning-definition-example/) or [GSM](https://www.atlassian.com/team-playbook/plays/goals-signals-measures) 73 | 74 | Determining what is important is a function of gathering inputs from your key stakeholders (typically team, management and customers) and then laying the information out in a systematic manner such as an excel spreadsheet by effort and impact. 75 | * Multiple viewpoints, such as team brainstorms, are advantageous to determining goals 76 | * Excercises to tease out priority such as 'what happens if we don't do xyz' 77 | * Laddering up to company initiatives or OKRs is advantageous as well 78 | * Impact is not effort and the world is not fair, make sure you can deliver and measure impact whenever possible and be diligent to stay on course and review goals 79 | 80 | ## Coaching 81 | 82 | ### 1on1s 83 | 84 | * The [goal](https://a16z.com/2012/08/18/a-good-place-to-work/) of the 1on1 is the create a great company. 85 | * [1on1s](https://a16z.com/2012/08/30/one-on-one/) are primarily for the employee, and secondarily for the manager. 86 | * It is a free form meeting for any issues, concerns, ideas and frustrations not easily expressed in more formal channels. 87 | 88 | Example 1on1 questions 89 | 90 | * How would you improve the org? 91 | * Whats not fun about working at the comp? 92 | * Who is doing really great? Why? 93 | * What is the biggst opportunity that the comp is missing out on? 94 | 95 | Frequency 96 | * Starting weekly or biweekly is common with the caveat of adjusting as needed 97 | 98 | Agendas 99 | * Agendas help keep the meeting on track and set expectations 100 | 101 | [importance of one-on-ones](https://css-tricks.com/the-importance-of-one-on-ones/) - Good overview on 1on1's 102 | [HelpScout blog on 1on1s](https://www.helpscout.com/blog/one-on-ones/) - Another excellent perspective on the subject 103 | [Lighthouse Doc Template](https://getlighthouse.com/blog/one-on-one-meetings-template-great-leaders/) - Very comprehensive tool for 1on1s 104 | 105 | 106 | ### Feedback 107 | 108 | Feedback is a gift. It is difficult to give, especially with quality. It is an ['unatural act'](https://www.radicalcandor.com/about-radical-candor/) Feedback should be received and given: 109 | 110 | * With humility, we all have different perspectives and will often give different feedback in response to the same situation. 111 | * With positive intent on someone's behalf 112 | * With understanding, as even the best of us can have difficulty not taking occasional feedback personally 113 | 114 | Sometimes ask the person if they wish to have the feedback to illustrate its for their growth. 115 | 116 | 117 | ### Training 118 | 119 | Andy Grove [High Output Management](https://www.amazon.com/High-Output-Management-Andrew-Grove-ebook/dp/B015VACHOK/ref=sr_1_1?ie=UTF8&qid=1526430507&sr=8-1&keywords=high+output+management) states that there are only two ways for a manager to improve the output of an employee, motivation and training. Training is a high return activity that should be led by the managers of an organization. a16z [shares](https://a16z.com/2010/05/14/why-startups-should-train-their-people/) how this is a great method to set expectations within an organization. 120 | 121 | ### Motivation 122 | 123 | Developers are primarily motivated with intrinsic motivation, feeling ownership with their products and working to make them succeed. [Intrinsic motivation](https://www.ted.com/talks/dan_pink_the_puzzle_of_motivation) is driven by 124 | 125 | * Autonomy - Allowing developers to drive their work and influence the direction and goals of the product 126 | * Mastery - This is huge, opportunity to improve existing skills and learn new ones. The video game industry is driven in no small part by our inborn desire for progression and mastery. Experts can do amazing things if allowed to grow their knowledge one small victory at a time. 127 | * Purpose - Working on products that have significance and seeing the effects of your work. In a dramatic example, Elon Musk companies have recently been able to harness this with thier employees with the incredible amount of work that went into the Tesla vehicles (Move from Fossil Fuels) vs the much larger traditional auto makers and the progress of SpaceX (Occupy Mars) compared to the traditional space industry. 128 | 129 | ### Performance 130 | 131 | Performance is attributed to a mix of individual and situation. As a hobby farmer, I enjoy using a plants analogy. Different plants need different circumstances, some do better with lots of water while others need to dry out for example. Some plants such as pine trees are highly resilent and can grow in any condition, including the middle of a swamp for example, but don't product much in the way of fruit. Peach trees however, require a very specific mix of light, soil, water and protection from pests but can produce a bumper harvest of fruit in the right conditions. 132 | 133 | Performance is often a tradeoff. An engineer may be 10x more productive than their peers as long as they work in a specific codebase and language but may be very inflexible with tasks that fall outside their preference. Other engineers are good at learning any new language and decifering ambiguity, but don't excel in any one area. Even in nature, specialists thrive when the [environment is stable](https://natureecoevocommunity.nature.com/posts/66199-generalists-or-specialists-population-size-can-be-an-important-determinant) and generalists when there is more upheaval. 134 | 135 | #### Underperformers and coaching to improve performance 136 | 137 | Thought should be given to if the circumstance fits the individual and if they are setup for success. Sometimes people are in a good situation but still miss expectations. Sometimes its because they are not working hard enough and unfortunely other times performance will not improve despite hard work as they are a poor fit for the role. In this case keeping the low performer on the team doesn't do them any favors and likely keeps them from a better fit elsewhere. 138 | 139 | * Ideally, as must trust as possible is built before poor performance is given (or received :) 140 | * Feedback should be given regularly and often, for example, do not let an underperformer do not allow someone to find out they have been missing expectations for the past six months when you could have shared it after one week 141 | * Feedback should be direct, don't beat around the bush 142 | * Any communication should be made sure it has been heard 143 | 144 | Coaching low performers often requires temporary micromanagement, and a lot of trust and respect from both sides. 145 | * Set specific time frame with specific measurable goals so that there is opportunity for small success 146 | * Meet weekly and setup explicit expectations around each milestone 147 | * Low performer will likely improve or find another opportunity 148 | 149 | #### Top Performers 150 | 151 | Like the peach tree or the race car, top performers typically need extra care to sustain themselves. Sometimes it involves understanding the tradeoffs or making sure they are consistently challenged with incremental assignments. 152 | 153 | ## Hiring 154 | 155 | When hiring, aim to be transparent and hiring with offers in line with data. Expect a funnel with a percentage of closing rates that resembles a typical sales funnel. 156 | 157 | ### Interviewing 158 | 159 | It is important to be humble in regards to interviewing. Good candidates may fail the interview and bad candidates may game your system. Nevertheless, it is important to be disciplined and always improving the interview practice based on feedback. Inspiring by [Steve Yegge's](https://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions) post, I have found asking questions that cover multiple areas of computer science allows stronger computer science candidates to succeed and these candidates are generally more flexible and capable than asking trivia about a single technology. I try to cover: 160 | 161 | - Whiteboard coding questions in the style of [Leet code](https://leetcode.com/) 162 | 163 | - General computer science O(n) of algorithms and data structures 164 | 165 | - Linux questions (ls, grep, etc). Linux and bash are important and are growing faster than ever based on the [python developer report](https://www.jetbrains.com/research/python-developers-survey-2018/) and other sources. 166 | 167 | - System design [question](https://github.com/donnemartin/system-design-primer) (How would you design an online web app that does x..). These questions tend to favor those with practical experience or a coding hobby. 168 | 169 | - Behavioral General ability to communicate and bucket for soft skills 170 | 171 | - Misc. Sometimes candidates have skills and capabilities in my experience that generally but not always correlate with high performance. 172 | 1. Open source contributions 173 | 1. Interesting side projects 174 | 1. University or prior work pedigree 175 | 1. Math minors or other scientific degrees 176 | 1. Interest in multiple programming languages/tools 177 | 178 | References 179 | 180 | 1. [Notion](https://www.notion.so/Startup-Hiring-101-A-Founder-s-Guide-946dad6dd9fd433abdd12338a83e931f) 181 | 182 | ### Combating Bias and Diversity Strategies 183 | 184 | Bias is real and a team is well served by actively combating it, otherwise you will likely end up with a team that lacks diversity and thus be lower performing. Some steps that help reduce bias: 185 | 186 | 1. Use automation whenever possible. For example, using a tech screen for new candidates vs a resume screen is a good way to get a broader qualified applicate pool and helps those who have the skills but not the pedigree. 187 | 1. Have a diverse hiring committee contributes to hiring diverse candidates 188 | 1. Use the same diverse committee to review job posts as well to make them neutral 189 | 1. Have hiring managers blind to each others feedback until everyone has contributed their own feedback 190 | 1. Have a standard scoring system based on weighted evaluations, for example the five categories explained in this post, and ask interviewers to explain their scores for candidates. 191 | 1. When possible, share the resume without identifying information 192 | 1. Sourcing candidates from Universities and recruiting are higher yield strategies for getting a diverse candidate pool 193 | 1. One strategy I found interesting to the email the candidates the category and information on the questions I would ask. Even doing so, I found 1/5 candidates noticably used the information to prepare for the phone screen (across roughly 100 candidates for one job posting at one company). I hoped that this allowed candidates who wanted the job more the option to prepare as the majority of candidates seemed to ignore the information. 194 | 195 | ### On who to hire 196 | 197 | I have found that one should aim to hire for strengths rather than lack of weakness. Nearly all High performing individuals tend to have severe weaknesses in my experience and yet they can do remarkable things, such as actually be a '10x engineer'. However, this is harder than it seems as committees tend to hire for lack of weakness as its a more conservative strategy. This is a way to get good but rarely great candidates as nearly all the competitors will be hiring for lack of weakness as well. 198 | 199 | ## Teams and meetings 200 | 201 | Communication can be a big challenge as a team grows in size as the cost of communication grows [quadratically](https://www.researchgate.net/figure/Quadratic-growth-in-the-number-of-edges-in-a-communication-network-Each-edge-incurs_fig11_236085102) ([Brooks Law](https://en.wikipedia.org/wiki/Brooks%27s_law)). The links between team members can be [modeled](http://blog.idonethis.com/two-pizza-team/) as (n*(n-1))/2 or roughly n^2. A team of 5 people has 10 links between the members whereas a team of 14 has 91. [Experiments](http://www.opim.wharton.upenn.edu/~kmilkman/2012_OBHDPb.pdf) have shown larger teams can be less efficient. Finally, the US Military has conducted extensive research on the topic and has found the [ideal team size](https://www.amazon.com/Team-Teams-Rules-Engagement-Complex/dp/1591847486) to be five members. Two recommendations can be drawn from this: 202 | 203 | 1. [Amazon](https://gist.github.com/chitchcock/1281611), [Spotify](http://www.full-stackagile.com/2016/02/14/team-organisation-squads-chapters-tribes-and-guilds/) and others have demonstrated the power of small teams (<10 people) connected by api's. 204 | 2. Meetings should be as small as possible and invite those deemed absolutely necessary. Jeff Bezos ([allegedly](https://www.cnbc.com/2017/08/16/how-jeff-bezos-two-pizza-rule-can-lead-to-more-productive-meetings.html)) will not even show up if the meeting has more than 10 people. For the rest of us, an [8-18-1800](https://hbr.org/2015/03/how-to-know-if-there-are-too-many-people-in-your-meeting) rule can be a good guideline. 205 | 206 | ## How to stay on top of technical developments? 207 | 208 | Even the sharpest knife can get dull over time. 209 | 210 | 1. Read the top engineering blogs such as [Facebook engineering](https://engineering.fb.com/), [Stripe](https://stripe.com/blog/engineering), [Twitter](https://blog.twitter.com/engineering/en_us.html) and others 211 | 212 | 1. Stay up to date with data driven research on industry trends. Resources such as the [annual state of devops report](https://cloudplatformonline.com/2018-state-of-devops.html), [python developer report](https://www.jetbrains.com/research/python-developers-survey-2018/), and [stack overflow trends](https://insights.stackoverflow.com/trends?tags=python%2Cjavascript%2Cjava%2Cc%23%2Cphp%2Cc%2B%2B&utm_source=so-owned&utm_medium=blog&utm_campaign=gen-blog&utm_content=blog-link&utm_term=incredible-growth-python) and finally [kp internet trends report](https://www.kleinerperkins.com/perspectives/internet-trends-report-2018/) are just a few of the excellent resources available. 213 | 214 | 1. Contribute to open source, which keeps one sharp as open source contributors will often hold you work to a high standard which isn't always the case within an organization for various reasons. 215 | 216 | 1. Push yourself to achieve externally validated industry benkmarks. For example, the deployment frequency and service uptime benchmarked in the [annual devops report](https://puppet.com/resources/whitepaper/state-of-devops-report) is a good target that is generally well accepted. 217 | 218 | ## How to evaluate performance? 219 | 220 | Software Engineer performance is difficult to measure objectively. 221 | 222 | * The number one evaluation is hitting goals, which for software engineering usually includes shipping on time. Beyond this as with most industries one can use a combination of quality and throughput. 223 | * Performance and impact is weighed against the individuals level, experience, situation and capabilities 224 | 225 | ### Teams 226 | 227 | Data from the [annual devops report](https://cloudplatformonline.com/2018-state-of-devops.html) which has surveyed over 30,000 developers over the past five years has found the best measures a combination of productivity and quality. 228 | 229 | Productivity/Throughput 230 | 231 | 1. Deployment frequency 232 | 1. Lead time for changes 233 | 234 | Quality 235 | 1. Time to restore service 236 | 1. Change failure rate - The number of deployments in which something goes wrong 237 | 238 | They have found these measures sufficient to segment performance between Elite, High, Medium and Low performers. This can be a useful data point when measuring team performance. Some teams may be really productive but have poor quality. Other teams may excell at both and others still may do poorly at both. 239 | 240 | #### Google Rework Study 241 | 242 | Five key dynamics that set successful teams apart from other [teams at Google](https://rework.withgoogle.com/blog/five-keys-to-a-successful-google-team/) 243 | 244 | 1. Psychological safety: Can we take risks on this team without feeling insecure or embarrassed? 245 | 1. Dependability: Can we count on each other to do high quality work on time? 246 | 1. Structure & clarity: Are goals, roles, and execution plans on our team clear? 247 | 1. Meaning of work: Are we working on something that is personally important for each of us? 248 | 1. Impact of work: Do we fundamentally believe that the work we’re doing matters? 249 | 250 | ### Individuals 251 | 252 | Individual engineers can be evaluated on both productivity and quality as well. 253 | 254 | * Productivity is easier to measure than quality and I would argue less important. An agile course or a scrum board can help you estimate tasks and track their execution over time thus reasonably measuring productivity. Non technical managers can do a good job in this area with agile experience. 255 | 256 | * Quality is more difficult, there are some things to look for as data points to contribute to a weighted sense. 257 | 258 | 1. Achieving agreed up goals is a useful signal and probably the closest proxy to passion and productivity 259 | 260 | 1. 360 feedback aka asking the peers about an individual in their respective 1:1's. Teams who work with someone on a daily basis are difficult to fool and will have an excellent perspective in which to evaluate performance. 261 | 262 | 1. Unit tests - Automated testing is a key indicator of quality. If an engineer fixes a bug and doesn't also create a test to ensure the bug stays fixed, then how does one know the engineer didn't cause two other bugs when they fixed the first bug? Without tests, the engineer could theorectically work forever causing bugs every time they fix a bug and then refixing the same bugs. Tests would let the engineer know when previously working code has been broken due to new changes. 263 | 264 | 1. Comments - Documentation that shares how a code works 265 | 266 | 1. Elegance/brevity - This is more subjective, but typically less code to accomplish a task is better than more. Simpler is better than complex. If a solution is simple and short it is typically better than a solution that is big and complex. Complexity of course can not be avoided but it should be fought for every inch of ground given up. Instead of counting lines of code, perhaps thinking of a solution as to how many lines it cost? 267 | 268 | There is a common trap for a non-technical manager is to overly reward engineers who are productive at the expense of quality. This results in some common anti-patterns such as 'rockstar' engineers who create untested, difficult to maintain spaghetti code but are increasingly rewarded by an organization. Other 'average' engineers are often tasked with maintaining the service afterwards and can be blammed for delays in this code as they finish implementing the shortcuts of the 'rockstar'. 269 | 270 | ## Technical Debt 271 | 272 | Technical debt is a killer of productivity and often difficult to describe to key decision makers. It eludes simple 273 | bar charts and other measurements but clearly impacts productivity. Is can be described many ways, including a measurement of Complexity or simply lacking tests or some other decided upon minimum standard. 274 | 275 | Technical investment work can be framed as improvements, fixes and Upgrade/Updates to Security, Performance, Throughput and Stability. When possible, develop a strategy for iterating and measuring your way to improvement. 276 | 277 | ### Complexity 278 | 279 | There are two main sources of complexity 280 | * Dependencies 281 | * Obscurity 282 | 283 | Three symptoms of complexity 284 | * Change Amplification - Simple changes requiring update in many places 285 | * Cognitive load - How much a developer needs to know to complete a task 286 | * Unknown unknowns - It's not obvious which code must be modified to complete a task 287 | 288 | ### Rewriting services 289 | 290 | * At Google there was a joke that there was always two systems in regards to infrastructure. One that is depreciated 291 | and another that doesn't work. 292 | 293 | * Additionally, at Google they [encourage](https://arxiv.org/ftp/arxiv/papers/1702/1702.01715.pdf) occaisonal rewrites. This is a bold stance that flies in the face of conventional wisdom of never rewriting software. As a single anecdote, consider Outlook vs Gmail. I have had way more experiences with bugs with one of those than the other. 294 | 295 | ```quote 296 | Legacy code is simply code without tests. ― Michael C. Feathers, Working Effectively with Legacy Code 297 | ``` 298 | 299 | Few topics are as divisive and controversal among engineers as that of rewriting services. This is seen as a 300 | sort of engineer obsession and that engineers will always opt to write something new as opposed to work on a [legacy 301 | codebase](https://samuelmullen.com/articles/legacy_isnt_a_bad_word/). 302 | 303 | Service rewrites are possible and can return value, but are the exception and not the norm. It requires trememdous 304 | buy in from stakeholders over a long period of time, which makes it incredibly risky. Furthermore, if the team 305 | maintaining the legacy code is still maintaining and adding features then an additional problem of overtaking 306 | the legacy team's velocity comes into play as well. Finally, entrenced interests in the status quo will also oppose any 307 | rewrite attempt and can point at every delay and validation to their stance. Improvements must usually come in 308 | tiny pieces or not at all. Even harnessing a crises may not help in the long run, as the crises will pass and 309 | the rewrite will be questioned. 310 | 311 | Arguments for the rewrite are similar to those of any proposed disruptive innovation. Since organizations are notoriously 312 | [bad at disrupting themselves](https://en.wikipedia.org/wiki/Disruptive_innovation), such innovations must usually arrive 313 | from outside the organization. 314 | 315 | ### Upgrading 316 | 317 | #### Not all software is worth upgrading 318 | 319 | Ultimately, technical debt should be viewed through the lense of how permanent the code is. Upgrades to code that lives indefinetly is a different matter than a prototype that will be thrown away next week. 320 | 321 | #### If you must upgrade and it hurts, do it more often 322 | 323 | The foundation of continous deployment and integration is minimizing the size of changes and therefore surprises. If upgrading is painful, it should be done more often to reduce the amount of change at any given time. This is of course assuming the benefit tradeoff is positive (i.e. long living software with an positive expected value of upgrading) 324 | 325 | ## Sharing Progress with 3rd Parties 326 | 327 | Kanban Trello boards are an excellent pattern to share engineering progress with third parties. These third parties can include actual clients who want to know status of features or other members within the organization such as executives. 328 | 329 | Notable examples: 330 | * [Red Hat Openshift team](https://trello.com/atomicopenshift) 331 | * [Trello sample dev board](https://trello.com/b/1Jz6SorC/the-dev-board) 332 | * [Trello dev roadmap](https://trello.com/b/nC8QJJoZ/trello-development-roadmap) 333 | 334 | ## Documentation 335 | 336 | Documentation in wiki's tends to become old and out of date quickly. The best documentation lives in github as markdown 337 | next to the source code. This documentation already has an excellent CMS (git) to manage it as well as encourages updates 338 | due to its always being present. Documentation and training are an incredible enabler of high performance teams and 339 | getting a culture to change to one that continually updates documentation (and automation) is one of those factors that 340 | separate great development teams from merely good development teams. 341 | 342 | ## Self service tools and infrastructure 343 | 344 | Enabling engineers with self service tools and infrastructure (cloud) is an enormous benefit. Non developers often 345 | don't think through the waste that can be triggered by making engineers submit a form and get a resource async vs 346 | an instant self service. It is quite literally days and weeks in the former case to seconds in the later. Compound 347 | this with human nature in that the engineer is not going to drop everything once the resource is granted days later 348 | and utilize it. Once a few of these form submitting processes add up (after all, no single raindrop feels responsible 349 | for the flood) and its quite understandable to see how unproductive large enterprise engineering teams can become 350 | compared to similar teams in a startup and developing solely in cloud. 351 | 352 | ### Backups 353 | 354 | Schrodinger Backups: The condition of any backup is unknown until a restore is attempted. So resture from backups regularly! There is an embarrising amount of bounty money paid to hackers because the database was encrypted by an attack and the backups do not work or were obsolete. 355 | 356 | ## Managing work cadence and deliverables 357 | 358 | ### Set Clear Goals 359 | ``` 360 | If you don’t know where you’re going, any road will get you there. – Lewis Carroll 361 | ``` 362 | 363 | * The default state of a team is for every team member to go in a different direction, like a raft going down a raging river with each paddler ignoring their neighbors. If may be even worse than this, the members may be optimizing for speed of individual paddling or having the perfect stroke while the boat itself is heading towards a waterfall. 364 | * Aligning each member in the same direction is very hard work and completely your responsibility 365 | * The first place to start to determine if the business goals being reached by the team. If you don't have goals, thats a great place to start 366 | * Three month or six month goals are a good default if you enter a situation with no explicit goals 367 | 368 | ### Goals, Signals and Metrics Framework 369 | 370 | * A goal is a desired result at a high level 371 | * A signal is how you know you have achieved the result, ideally measureable but typically not 372 | * Metric is a proxy for a singal, something that can be directly measured 373 | 374 | This framework helps you be more objective and prevent metrics creep by being explicit about goals. A good metric is a reasonable proxy to signal and is traceable back to the original goals. 375 | 376 | ### Process 377 | 378 | Regarding processes, it is better to start lighter than heavier. You can always add processes as needed but processes are hard to kill once in place. Every team and every org is different, here are some points to consider. 379 | 380 | 381 | * Highly motivated and directed engineers can self organize and achieve goals, if possible give them an opportunity to do so. Successful FAANG developer teams and startups are often organized this way. 382 | * For everyone else, agile can be useful if it is well understand and adapted to a specific team. Often a heavy, waterfall-like version is imposed on teams at medium and large enterprises as a result of attempts to measure team productivity and thus ROI. Given the freedom and a small team setting, [Agile light](https://github.com/davebs/AgileLite) or similar resource is a good place to start in this regard. 383 | 384 | ## Distributed teams 385 | 386 | * Some people do not work well remote, and thats ok 387 | * Don't expect the same level of bonding with remote teams vs local ones. However, activites such as 'Fun Hat Friday' do help in this regard. 388 | * Turn on cameras during meetings, this helps with bonding and communicating social cues. 389 | * Use emoji, its helps convey emotion otherwise lost in text. 390 | * Over-communicate, particularly for managers. 391 | * Have a great workspace that you enjoy and invest in it. 392 | * Periodically share articles or media with people on topics discussed in the past, take notes of interests of team members if needed to make this happen 393 | * 70% of communications are non-verbal and text can be a poor medium, be patient and reflect on miscommunications as an opportunity to level up. 394 | * Get comfortable with quick 10 min zoom/phone calls 395 | * Over clarify expectionas and how people feel about a topic 396 | * Show gratitude to your team! 397 | 398 | ### Growing talent 399 | * Distrubuted tends to benefit establish engineers with increased focus, however it makes it much harder for new engineers to gain context 400 | #### To Mitigate 401 | * Assign onboarding buddy 402 | * Foster an environment for asking questions 403 | * Make investments in onboarding labs and other interactive documentation 404 | 405 | ### Co-Worker friendly knowledge checklist 406 | * How much do you know about their family? (Spouse, kids, parents, siblings?) 407 | * How much do you know about hobbies, goals or interests? 408 | * How are they feeling overall? 409 | 410 | ### Informal Team Bonding Tactics 411 | * 15 minute watercoolers to promote discussion on any topic 412 | * 1/week meal meeting to encourage bonding and longer form discussion 413 | * Virtual Holiday parties 414 | * Celebrate occasions such as baby showers 415 | 416 | References: 417 | 418 | [Mitchell Hashimoto](https://twitter.com/mitchellh/status/1237540985577459712) 419 | 420 | ## Books 421 | 422 | 1. [Deep Work](https://hackernewsbooks.com/book/deep-work-rules-for-focused-success-in-a-distracted-world/d1b3b31390821e96e1e8f5a5f8855444) Great info about productivity and managing distractions 423 | 1. [Culture Code](https://www.goodreads.com/book/show/33517721-the-culture-code) Useful for understanding how groups work and how to create positive, better work environments 424 | 1. [Software Engineering at Google Whitepaper](https://arxiv.org/ftp/arxiv/papers/1702/1702.01715.pdf) Bold engineering principles at Google 425 | 1. [Software Engineering at Google Book](https://abseil.io/resources/swe_at_google.2.pdf) Engineering patterns and antipatterns 426 | 1. [Designing Data-Intensive Applications](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321) Excellent reference on data structures and scaling 427 | 1. [Building Secure and Reliable Systems](https://www.amazon.com/Building-Secure-Reliable-Systems-Implementing/dp/1492083127) Update on building and maintaining modern systems 428 | 1. [Jason Evanish Book List](https://jasonevanish.com/bookshelf/) 429 | 430 | ## Blogs 431 | 432 | 1. [randsinrepose](https://randsinrepose.com/archives/category/management/) Management blog by engineering leader 433 | 1. [Sarah Drasner](https://sarah.dev/writing/) 434 | -------------------------------------------------------------------------------- /reviewingCode.md: -------------------------------------------------------------------------------- 1 | # Set of guidelines and tips for reviewing code 2 | 3 | 1. [Obvious Code](#obvious-code) 4 | 1. [Naming](#naming) 5 | 1. [Red Flags](#red-flags) 6 | 1. [References](#references) 7 | 8 | ## Obvious Code 9 | 10 | Things that make code more obvious. Software should be designed for ease of reading, not 11 | ease of writing 12 | 13 | * Good, specific and precise names 14 | * Generous use of whitespace 15 | ```cpp 16 | for(int pass=1;pass>0&&!empty;pass--) 17 | for (int pass = 1; pass >= 0 && !empty; pass--) 18 | ``` 19 | * Use of comments to provide information that is nonobvious 20 | - For example: Event driven or deep Object Oriented calls to code. Such calls should be highlighted with comments 21 | 22 | ```cpp 23 | /* 24 | * This method is invoked in the dispatch thread by a transport if a 25 | * transport level error prevents an RPC from completing 26 | */ 27 | void Transport::RpcNotifier::failed(){ 28 | } 29 | ``` 30 | 31 | ### AntiPatterns 32 | 33 | * Misusing Generic Containers 34 | 35 | Grouping variables that do not have a relationship for convienence of 36 | passing or returning. 37 | ```java 38 | return new Pair(someTerm, false); 39 | ``` 40 | * Different types for declaration and allocation 41 | 42 | Reader may expect var is a List and not an ArrayList 43 | ```java 44 | private List incommingMessageList; 45 | incomingMessageList = new ArrayList(); 46 | ``` 47 | * Code that violates reader expectations 48 | Code doesn't exit as implied by void type, but actually spawns threads 49 | ```java 50 | public static void main(String[] args){ 51 | new RaftClient(myAddress,serverAddresses); // Spawn threads 52 | } 53 | ``` 54 | General ways to make code more obvious 55 | - Reduce information that is needed such as abstraction and eliminating special cases 56 | - Take advantage of known information through conventions and conforming to expectations 57 | - Present information in code through naming and comments 58 | 59 | ## Naming 60 | 61 | Names should be precise and consistent. 62 | 63 | ```cpp 64 | int widgetManager getCount(); 65 | ``` 66 | GetCount of what? getActiveWidgets or numWidgets would be better 67 | 68 | ```cpp 69 | // true when cursor visible 70 | bool blinkstatus = true; 71 | ``` 72 | cursorVisible would be better 73 | 74 | If its hard to pick a name, perhaps the variable does not have a clear 75 | definition or purpose. Consider refactoring into several variables 76 | 77 | ## Red Flags 78 | 79 | * Shallow Modules - Interface for class/method is not much simplier than implementation. i.e. 80 | a class barely does enough to justify learning its API 81 | * Information Leakage - The same specific knowledge is needed in multiple places such as a 82 | file type 83 | * Overexposure - API for a commonly used feature forces users to learn about other features that are rarely used, increasing cognitive load for all users 84 | * Pass through method - Method does nothing but pass its arguments to another 85 | method with a similar signature 86 | * Conjoined Methods - It takes reading two methods to understand whats going one, 87 | methods should be able to be understood by themselves 88 | * Comment repeats code - Information from comment is obvious 89 | * Vague Naming - Variable or method name broad enough to refer to many different 90 | things, thus making it likely a future developer will misuse it 91 | * Hard to describe - If a method or function is hard to describe, perhaps a 92 | refactor could be warrented 93 | 94 | ## References 95 | 96 | 1. [Awesome Code Review](https://github.com/joho/awesome-code-review) 97 | 1. [Flatten code arrows](https://blog.codinghorror.com/flattening-arrow-code/) Excellent and practical on the all too prevelant nested if's 98 | 1. [A Philosophy of Software Design](https://hackernewsbooks.com/book/a-philosophy-of-software-design/12be0ff26a765aa737d6b042043aa079) A great design book with lots of examples from class experience 99 | 1. [Google Code Submitting/Reviewing Practices](https://github.com/google/eng-practices) Google Advice for Code Review and Submittals 100 | --------------------------------------------------------------------------------