Skip to content

Instantly share code, notes, and snippets.

@thiagomarini
Created February 10, 2018 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomarini/1d97f10b10843eea35cdacb9837cafd8 to your computer and use it in GitHub Desktop.
Save thiagomarini/1d97f10b10843eea35cdacb9837cafd8 to your computer and use it in GitHub Desktop.
PHP array of The Pragmatic Programmer tips so you can slack/email them or do whatever you want to spread some good programming tips ;)
<?php
/**
* Tips from The Pragmatic Programmer
* @var array
*/
$tips = [
[
'title' => 'Care About Your Craft',
'message' => 'Why spend your life developing software unless you care about doing it well?'
],
[
'title' => 'Provide Options, Don’t Make Lame Excuses',
'message' => 'Instead of excuses, provide options. Don’t say it can’t be done; explain what can be done.'
],
[
'title' => 'Be a Catalyst for Change',
'message' => 'You can’t force change on people. Instead, show them how the future might be and help them participate in creating it.'
],
[
'title' => 'Make Quality a Requirements Issue',
'message' => 'Involve your users in determining the project’s real quality requirements.'
],
[
'title' => 'Critically Analyze What You Read and Hear',
'message' => 'Don’t be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project.',
],
[
'title' => 'DRY—Don’t Repeat Yourself',
'message' => 'Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.',
],
[
'title' => 'Eliminate Effects Between Unrelated Things',
'message' => 'Design components that are self-contained, independent, and have a single, well-defined purpose.',
],
[
'title' => 'Use Tracer Bullets to Find the Target',
'message' => 'Tracer bullets let you home in on your target by trying things and seeing how close they land.',
],
[
'title' => 'Program Close to the Problem Domain',
'message' => 'Design and code in your user’s language.',
],
[
'title' => 'Iterate the Schedule with the Code',
'message' => 'Use experience you gain as you implement to refine the project time scales.',
],
[
'title' => 'Use the Power of Command Shells',
'message' => 'Use the shell when graphical user interfaces don’t cut it.',
],
[
'title' => 'Always Use Source Code Control',
'message' => 'Source code control is a time machine for your work—you can go back.',
],
[
'title' => 'Don’t Panic When Debugging',
'message' => 'Take a deep breath and THINK! about what could be causing the bug.',
],
[
'title' => 'Don’t Assume It—Prove It',
'message' => 'Prove your assumptions in the actual environment—with real data and boundary conditions.',
],
[
'title' => 'Write Code That Writes Code',
'message' => 'Code generators increase your productivity and help avoid duplication.',
],
[
'title' => 'Design with Contracts',
'message' => 'Use contracts to document and verify that code does no more and no less than it claims to do.',
],
[
'title' => 'Use Assertions to Prevent the Impossible',
'message' => 'Assertions validate your assumptions. Use them to protect your code from an uncertain world.',
],
[
'title' => 'Finish What You Start',
'message' => 'Where possible, the routine or object that allocates a resource should be responsible for deallocating it.',
],
[
'title' => 'Configure, Don’t Integrate',
'message' => 'Implement technology choices for an application as configuration options, not through integration or engineering.',
],
[
'title' => 'Analyze Workflow to Improve Concurrency',
'message' => 'Exploit concurrency in your user’s workflow.',
],
[
'title' => 'Always Design for Concurrency',
'message' => 'Allow for concurrency, and you’ll design cleaner interfaces with fewer assumptions.',
],
[
'title' => 'Use Blackboards to Coordinate Workflow',
'message' => 'Use blackboards to coordinate disparate facts and agents, while maintaining independence and isolation among participants.',
],
[
'title' => 'Estimate the Order of Your Algorithms',
'message' => 'Get a feel for how long things are likely to take before you write code.',
],
[
'title' => 'Refactor Early, Refactor Often',
'message' => 'Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.',
],
[
'title' => 'Test Your Software, or Your Users Will',
'message' => 'Test ruthlessly. Don’t make your users find bugs for you.',
],
[
'title' => 'Don’t Gather Requirements—Dig for Them',
'message' => 'Requirements rarely lie on the surface. They’re buried deep beneath layers of assumptions, misconceptions, and politics.',
],
[
'title' => 'Abstractions Live Longer than Details',
'message' => 'Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.',
],
[
'title' => 'Don’t Think Outside the Box—Find the Box',
'message' => 'When faced with an impossible problem, identify the real constraints. Ask yourself: “Does it have to be done this way? Does it have to be done at all?”',
],
[
'title' => 'Some Things Are Better Done than Described',
'message' => 'Don’t fall into the specification spiral—at some point you need to start coding.',
],
[
'title' => 'Costly Tools Don’t Produce Better Designs',
'message' => 'Beware of vendor hype, industry dogma, and the aura of the price tag. Judge tools on their merits.',
],
[
'title' => 'Don’t Use Manual Procedures',
'message' => 'A shell script or batch file will execute the same instructions, in the same order, time after time.',
],
[
'title' => 'Coding Ain’t Done ‘Til All the Tests Run',
'message' => '‘Nuff said.',
],
[
'title' => 'Test State Coverage, Not Code Coverage',
'message' => 'Identify and test significant program states. Just testing lines of code isn’t enough.',
],
[
'title' => 'English is Just a Programming Language',
'message' => 'Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on.',
],
[
'title' => 'Gently Exceed Your Users’ Expectations',
'message' => 'Come to understand your users’ expectations, then deliver just that little bit more.',
],
[
'title' => 'Think! About Your Work',
'message' => 'Turn off the autopilot and take control. Constantly critique and appraise your work.',
],
[
'title' => 'Don’t Live with Broken Windows',
'message' => 'Fix bad designs, wrong decisions, and poor code when you see them.',
],
[
'title' => 'Remember the Big Picture',
'message' => 'Don’t get so engrossed in the details that you forget to check what’s happening around you.',
],
[
'title' => 'Invest Regularly in Your Knowledge Portfolio',
'message' => 'Make learning a habit.',
],
[
'title' => 'It’s Both What You Say and the Way You Say It',
'message' => 'There’s no point in having great ideas if you don’t communicate them effectively.',
],
[
'title' => 'Make It Easy to Reuse',
'message' => 'If it’s easy to reuse, people will. Create an environment that supports reuse.',
],
[
'title' => 'There Are No Final Decisions',
'message' => 'No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.',
],
[
'title' => 'Prototype to Learn',
'message' => 'Prototyping is a learning experience. Its value lies not in the code you produce, but in the lessons you learn.',
],
[
'title' => 'Estimate to Avoid Surprises',
'message' => 'Estimate before you start. You’ll spot potential problems up front.',
],
[
'title' => 'Keep Knowledge in Plain Text',
'message' => 'Plain text won’t become obsolete. It helps leverage your work and simplifies debugging and testing.',
],
[
'title' => 'Use a Single Editor Well',
'message' => 'The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.',
],
[
'title' => 'Fix the Problem, Not the Blame',
'message' => 'It doesn’t really matter whether the bug is your fault or someone else’s—it is still your problem, and it still needs to be fixed.',
],
[
'title' => '“select” Isn’t Broken',
'message' => 'It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.',
],
[
'title' => 'Learn a Text Manipulation Language',
'message' => 'You spend a large part of each day working with text. Why not have the computer do some of it for you?',
],
[
'title' => 'You Can’t Write Perfect Software',
'message' => 'Software can’t be perfect. Protect your code and users from the inevitable errors.',
],
[
'title' => 'Crash Early',
'message' => 'A dead program normally does a lot less damage than a crippled one.',
],
[
'title' => 'Use Exceptions for Exceptional Problems',
'message' => 'Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.',
],
[
'title' => 'Minimize Coupling Between Modules',
'message' => 'Avoid coupling by writing “shy” code and applying the Law of Demeter.',
],
[
'title' => 'Put Abstractions in Code, Details in Metadata',
'message' => 'Program for the general case, and put the specifics outside the compiled code base.',
],
[
'title' => 'Design Using Services',
'message' => 'Design in terms of services—independent, concurrent objects behind well-defined, consistent interfaces.',
],
[
'title' => 'Separate Views from Models',
'message' => 'Gain flexibility at low cost by designing your application in terms of models and views.',
],
[
'title' => 'Don’t Program by Coincidence',
'message' => 'Rely only on reliable things. Beware of accidental complexity, and don’t confuse a happy coincidence with a purposeful plan.',
],
[
'title' => 'Test Your Estimates',
'message' => 'Mathematical analysis of algorithms doesn’t tell you everything. Try timing your code in its target environment.',
],
[
'title' => 'Design to Test',
'message' => 'Start thinking about testing before you write a line of code.',
],
[
'title' => 'Don’t Use Wizard Code You Don’t Understand',
'message' => 'Wizards can generate reams of code. Make sure you understand all of it before you incorporate it into your project.',
],
[
'title' => 'Work with a User to Think Like a User',
'message' => 'It’s the best way to gain insight into how the system will really be used.',
],
[
'title' => 'Use a Project Glossary',
'message' => 'Create and maintain a single source of all the specific terms and vocabulary for a project.',
],
[
'title' => 'Start When You’re Ready',
'message' => 'You’ve been building experience all your life. Don’t ignore niggling doubts.',
],
[
'title' => 'Don’t Be a Slave to Formal Methods',
'message' => 'Don’t blindly adopt any technique without putting it into the context of your development practices and capabilities.',
],
[
'title' => 'Organize Teams Around Functionality',
'message' => 'Don’t separate designers from coders, testers from data modelers. Build teams the way you build code.',
],
[
'title' => 'Test Early. Test Often. Test Automatically.',
'message' => 'Tests that run with every build are much more effective than test plans that sit on a shelf.',
],
[
'title' => 'Use Saboteurs to Test Your Testing',
'message' => 'Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.',
],
[
'title' => 'Find Bugs Once',
'message' => 'Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.',
],
[
'title' => 'Build Documentation In, Don’t Bolt It On',
'message' => 'Documentation created separately from code is less likely to be correct and up to date.',
],
[
'title' => 'Sign Your Work',
'message' => 'Craftsmen of an earlier age were proud to sign their work. You should be, too.',
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment