>Don’t ever let would-be consulting clients pay you for code that you write.A similar piece of advice is in the often-submitted article by Patrick McKenzie.[1]
The common idea is that instead of being just a "code monkey", you position yourself higher up the value hierarchy to be more of a "solutions provider".
In my observations of programmers that successfully sell consulting vs earning a W-2 salary, both articles leave out the dispositions and natural inclinations of the reader. This affects how easy it is to move up the value hierarchy.
To do high-value consulting, one has to take an honest self-assessment:
1) Do you like to be somewhat entrepreneurial and "hustle" for work? (Some programmers would prefer to be given a set of defined tasks and then be left alone rather than scout for new jobs and projects. The act of "selling yourself" to prospective clients is uncomfortable.)
2) Do you accept that there can be cycles of feast or famine because of downtime between freelance contracts? (Some programmers would rather have the predictability of steady paycheck rather than stress over contracts and chasing Accounts Payable for past-due payments.)
3) Do you find "solving business problems" more interesting than programming languages? (E.g. some folks are more interested in Python 3 vs Python 2 differences or studying Lisp macros -- rather than tackling the domain knowledge and complexities of modernizing a hospital billing system, or the code to monitor container ship logistics, etc. The coder views the business stuff as boring but programming languages as interesting.)
Once you've done the "know thyself" exercise, you can then analyze how various types of "consulting" is sold in the marketplace and where to position your services.
If you're just a generalist programmer in (e.g. C++/Java/Python), it will be difficult to sell that as "consulting" to companies. You have to go up the value chain and sell "solutions". This is easier if you have expertise in a specific business niche that interests you. As for examples of selling general consulting that covers the spectrum from "bodyshop of programmers" to "solutions providers", that would companies like Infosys (India H1B), Pivotal Labs, Thoughtworks, Accenture, IBM Global Solutions.
Some exceptions to selling small scale "consulting" without being a being a solutions provider would be web freelancing and maybe cybersecurity auditing. Otherwise, generalist programmers either need to work for the solutions providers above, or become a solution provider themselves, or find contract gigs on marketplaces like Upwork and Dice. However, selling your programming skills on Upwork is the probably the opposite of the advice given in the 2 essays.
[1] https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-pr...