If a software developer produces a YouTube video covering a programming subject as a tutorial and gives the code away at the end are they responsible for what someone does with the code? For example, if someone decides to use the code for a production purpose and the code does not perform as expected does the user of the code have any right to try and prosecute the developer of the code even though the page where the code was made available for download says it is available as is with no warranty? Also, does the developer need to put that disclaimer on every source code page available for download?
Altough I am not an expert on this. Here is what I usually do when I share my code to the world. I include a MIT license in my project or file. This clearly states that the software is delivered 'as is' and that the developer can not be held liable for any claim.
Copyright 2018 your-name
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
does the user of the code have any right to try and prosecute the developer of the code
The user can sue for that (and indeed for absolutely anything), but he wouldn't prevail. I don't like giving that answer, as it reminds me of the useless answer many sarcastic users give in online "law forums". But since you ask in terms of a user's "right to try", I needed to clarify this.
Is a software developer responsible for source code they give away for a tutorial?
No. You (or any developer sharing his or her code) are not liable for others' misunderstanding and/or lack of scrutiny of any tutorial code they use in Production, even if that source code was released by yourself. The legal jargon for this would be that the user(s) unreasonably relied upon the source code at issue.
Moreover, the fact that others need to copy/paste code from a tutorial suggests that they probably shouldn't be tweaking Production yet. It is widely known that code needs to be thoroughly tested in a non-production environment prior to moving it to Production. It is not the tutorial author's responsibility to foresee or prevent that chain of deficits of the person(s) who are in charge of that system.
The developer does not even need to include the disclaimer of "availability as is with no warranty". Those disclaimers were pertinent back then when educational materials on programming were in their beginnings. But nowadays someone complaining that Production got screwed up because he copy/pasted source code from some programming tutorial speaks more of his own ineptitude than anything else.