123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- import datetime
- import hashlib
- prag_tips = [
- 'Care About Your Craft',
- 'Think! About Your Work',
- 'You Have Agency',
- 'Provide Options, Don’t Make Lame Excuses',
- 'Don’t Live with Broken Windows',
- 'Be a Catalyst for Change',
- 'Remember the Big Picture',
- 'Make Quality a Requirements Issue',
- 'Invest Regularly in Your Knowledge Portfolio',
- 'Critically Analyze What You Read and Hear',
- 'English is Just Another Programming Language',
- 'It’s Both What You Say and the Way You Say It',
- 'Build Documentation In, Don’t Bolt It On',
- 'Good Design Is Easier to Change Than Bad Design',
- "DRY—Don't Repeat Yourself",
- 'Make It Easy to Reuse',
- 'Eliminate Effects Between Unrelated Things',
- 'There Are No Final Decisions',
- 'Forgo Following Fads',
- 'Use Tracer Bullets to Find the Target',
- 'Prototype to Learn',
- 'Program Close to the Problem Domain',
- 'Estimate to Avoid Surprises',
- 'Iterate the Schedule with the Code',
- 'Keep Knowledge in Plain Text',
- 'Use the Power of Command Shells',
- 'Achieve Editor Fluency',
- 'Always Use Version Control',
- 'Fix the Problem, Not the Blame',
- "Don't Panic",
- 'Failing Test Before Fixing Code',
- 'Read the Damn Error Message',
- "`select` Isn't Broken",
- "Don't Assume It—Prove It",
- 'Learn a Text Manipulation Language',
- 'You Cant Write Perfect Software',
- 'Design with Contracts',
- 'Crash Early',
- 'Use Assertions to Prevent the Impossible',
- 'Finish What You Start',
- 'Act Locally',
- 'Take Small Steps—Always',
- 'Avoid Fortune-Telling',
- 'Decoupled Code Is Easier to Change',
- 'Tell, Don’t Ask',
- 'Don’t Chain Method Calls',
- 'Avoid Global Data',
- 'If It’s Important Enough To Be Global, Wrap It in an API',
- 'Programming Is About Code, But Programs Are About Data',
- 'Don’t Hoard State; Pass It Around',
- "Don't Pay Inheritance Tax",
- 'Prefer Interfaces to Express Polymorphism',
- 'Delegate to Services: Has-A Trumps Is-A',
- 'Use Mixins to Share Functionality',
- 'Parameterize Your App Using External Configuration',
- 'Analyze Workflow to Improve Concurrency',
- 'Shared State Is Incorrect State',
- 'Random Failures Are Often Concurrency Issues',
- 'Use Actors For Concurrency Without Shared State',
- 'Use Blackboards to Coordinate Workflow',
- 'Listen to Your Inner Lizard',
- 'Don’t Program by Coincidence',
- 'Estimate the Order of Your Algorithms',
- 'Test Your Estimates',
- 'Refactor Early, Refactor Often',
- 'Testing Is Not About Finding Bugs',
- 'A Test Is the First User of Your Code',
- 'Build End-To-End, Not Top-Down or Bottom Up',
- 'Design to Test',
- 'Test Your Software, or Your Users Will',
- 'Use Property-Based Tests to Validate Your Assumptions',
- 'Keep It Simple and Minimize Attack Surfaces',
- 'Apply Security Patches Quickly',
- 'Name Well; Rename When Needed',
- 'No One Knows Exactly What They Want',
- 'Programmers Help People Understand What They Want',
- 'Requirements Are Learned in a Feedback Loop',
- 'Work with a User to Think Like a User',
- 'Policy Is Metadata',
- 'Use a Project Glossary',
- 'Don’t Think Outside the Box—Find the Box',
- "Don't Go into the Code Alone",
- 'Agile Is Not a Noun; Agile Is How You Do Things',
- 'Maintain Small Stable Teams',
- 'Schedule It to Make It Happen',
- 'Organize Fully Functional Teams',
- 'Do What Works, Not What’s Fashionable',
- 'Deliver When Users Need It',
- 'Use Version Control to Drive Builds, Tests, and Releases',
- 'Test Early, Test Often, Test Automatically',
- 'Coding Ain’t Done ’Til All the Tests Run',
- 'Use Saboteurs to Test Your Testing',
- 'Test State Coverage, Not Code Coverage',
- 'Find Bugs Once',
- "Don't Use Manual Procedures",
- "Delight Users, Don’t Just Deliver Code",
- 'Sign Your Work',
- 'First, Do No Harm',
- 'Don’t Enable Scumbags',
- "It’s Your Life. Share it. Celebrate it. Build it. AND HAVE FUN!",
- ]
- today = bytes(datetime.datetime.today().strftime("%Y%m%d"), encoding='utf-8')
- idx = int(hashlib.sha1(today).hexdigest(), 16) % len(prag_tips)
- print( prag_tips[idx] )
|