TubeSum ← Transcribe a video

ChatGPT Tutorial for Developers - 38 Ways to 10x Your Productivity

0h 28m video Published Jan 13, 2023 Transcribed Aug 5, 2026 P Programming with Mosh
Beginner 28 min read For: Software developers of all levels, especially beginners, looking to leverage AI tools for productivity.
AI Trust Score 72/100
⚠️ Average / Some Fluff

"Delivers on the promise of 38 ways to boost productivity, but some examples are repetitive and the title oversells the '10x' claim."

AI Summary

This tutorial introduces ChatGPT, an AI language model by OpenAI, and demonstrates how developers can leverage it to boost productivity. The video covers general use cases like learning, writing emails, and generating contracts, as well as specific coding examples in Python, JavaScript, HTML/CSS, SQL, and more. It emphasizes that while ChatGPT is a powerful tool, it has limitations and should not replace human judgment.

[00:01]
Introduction to ChatGPT

ChatGPT is an AI tool by OpenAI, released in November 2022, that gained 1 million users in 5 days. It can generate text, code, and answer questions, making it a game-changer for developers.

[02:19]
How ChatGPT Works

ChatGPT uses a language model trained on large text data to understand and generate human language. It offers different models: GPT-3 for natural language and Codex for code, trained on billions of lines of GitHub code.

[03:39]
Limitations of ChatGPT

ChatGPT can generate incorrect, harmful, or biased information. It's not a substitute for human expertise; code generated may be functional but not optimal. Use it as a productivity tool, not a source of absolute truth.

[05:00]
General Use Cases

ChatGPT can recommend books, explain concepts, write shell commands, generate business ideas, and draft legal contracts. It provides detailed answers and can be customized with follow-up questions.

[09:15]
Job Application Help

ChatGPT can write resumes and cover letters, and act as a technical interviewer. It remembers conversation context, allowing follow-up questions for clarification.

[12:19]
Python Coding Examples

ChatGPT can write Python functions, explain code, analyze time complexity, generate unit tests, suggest improvements (e.g., list comprehensions), and convert code between languages.

[16:50]
Frontend Development Examples

ChatGPT can generate HTML/CSS for UI components, add interactivity with JavaScript, and rewrite code using Tailwind CSS. It can also help debug errors and create React components.

[22:11]
Backend Development Examples

ChatGPT can build APIs with Node/Express, integrate databases like MongoDB, and convert code to TypeScript or Python FastAPI. It can also generate SQL queries for database operations.

ChatGPT offers endless possibilities for developers to increase productivity, from writing code to generating documentation and preparing for interviews. However, it's essential to use it as a supplement to human expertise, not a replacement.

Mentioned in this Video

Tutorial Checklist

1 04:05 Go to chat.openai.com and sign up for an account.
2 04:18 Log in and access the main chat interface.
3 05:00 Start with general questions like 'What are the top three books for learning Java?'
4 06:29 Ask for shell commands, e.g., 'Write a bash command to find all JPEG files and write them to a text file.'
5 07:12 Ask for git commands, e.g., 'How do I know how many lines of code I've committed?'
6 07:24 Generate business ideas, e.g., 'I want to make a revolutionary online shopping app, give me some good names.'
7 08:08 Ask for contracts, e.g., 'Write a contract for hiring a graphic designer with specific terms.'
8 09:15 Generate a resume, e.g., 'I have 3 years of experience in HTML, CSS, JavaScript. Write a resume for me.'
9 10:17 Write a cover letter, e.g., 'I'm applying for a frontend engineer role at some company. Write a cover letter.'
10 10:46 Act as an interviewer, e.g., 'Act as a technical interviewer and ask me five questions about JavaScript.'
11 11:43 Write emails, e.g., 'Write an email to my boss asking for a raise.'
12 12:19 Write Python functions, e.g., 'Write a Python function for generating a random password.'
13 12:35 Ask for explanations of code, e.g., 'What does this expression do in this code?'
14 13:05 Ask about time complexity, e.g., 'What is the time complexity of this function?'
15 13:33 Generate unit tests, e.g., 'Write unit tests for this function.'
16 14:10 Ask for code improvements, e.g., 'How can I improve this code?' (paste code)
17 15:12 Convert code between languages, e.g., 'Convert this Python code to JavaScript.'
18 15:39 Generate dummy data, e.g., 'Generate dummy data for a table called customers.'
19 16:16 Request data in JSON format, e.g., 'I don't need a Python script, just give me the data in JSON.'
20 16:34 Create a Python class, e.g., 'Create a Python class for storing these objects.'
21 16:50 Generate HTML/CSS, e.g., 'Write the HTML and CSS code for displaying a card.'
22 17:48 Customize UI, e.g., 'Add a button below the card.'
23 18:04 Add hover effects, e.g., 'When I hover over the card, I want it to slightly slide up.'
24 18:39 Rewrite using Tailwind CSS, e.g., 'Can you rewrite this code using Tailwind CSS?'
25 19:28 Add interactivity, e.g., 'When I click on the button, send an HTTP request to /api.'
26 19:43 Replace fetch with axios, e.g., 'Instead of fetch API, use axios.'
27 20:18 Debug errors, e.g., 'I got this error: Cannot read property bar of undefined. What does it mean?'
28 21:10 Create React components, e.g., 'Create a React component for displaying a card.'
29 21:39 Refactor props, e.g., 'Destructure the props parameter.'
30 22:11 Build APIs, e.g., 'I need an API built with Express.js to return a list of products.'
31 22:51 Integrate databases, e.g., 'Modify the code to retrieve products from MongoDB.'
32 23:19 Use TypeScript, e.g., 'Use TypeScript in this implementation.'
33 23:39 Generate API with Python, e.g., 'Generate this API using Python and FastAPI.'
34 24:22 Write SQL queries, e.g., 'Write a SQL query to generate a table called products with four columns.'
35 24:57 Specify column types, e.g., 'Write a SQL query to generate a table with these columns: ID integer, title string, etc.'
36 25:46 Write retrieval queries, e.g., 'Write a query to retrieve the top five customers in Manhattan.'
37 26:58 Join tables, e.g., 'Revise this query and join the customer table with the orders table to find top spenders.'

Study Flashcards (10)

When was ChatGPT released and how fast did it gain 1 million users?

easy Click to reveal answer

It was released in November 2022 and gained 1 million users in just 5 days.

00:43

What are the two main types of language models offered by ChatGPT?

medium Click to reveal answer

GPT-3 models for natural language and Codex for code generation.

02:59

What is a key limitation of ChatGPT mentioned in the video?

easy Click to reveal answer

It can generate incorrect, harmful, or biased information, and code may not be optimal.

03:39

How can you ask ChatGPT to generate a SQL query for a table with specific columns?

medium Click to reveal answer

Specify the column names and types, e.g., 'ID of type integer, title of type string, category of type integer, unit price of type float, image URL of type string.'

24:57

What is the time complexity of the example function in the video?

medium Click to reveal answer

Linear time complexity.

13:33

How can ChatGPT help with job applications?

easy Click to reveal answer

It can write resumes, cover letters, and act as a technical interviewer.

09:15

What is the benefit of using ChatGPT's conversation memory?

medium Click to reveal answer

It remembers previous context, allowing follow-up questions for clarification.

11:12

What does ChatGPT suggest to improve a for loop that filters a list?

medium Click to reveal answer

Use a list comprehension, which is a one-liner for the same logic.

14:56

How can you get dummy data in JSON format from ChatGPT?

easy Click to reveal answer

Ask for the data directly, e.g., 'I don't need a Python script, just give me the data in JSON.'

16:16

What is the purpose of the Codex model?

easy Click to reveal answer

It is specifically trained to understand and generate code.

03:12

💡 Key Takeaways

📊

ChatGPT's rapid adoption

Illustrates the unprecedented speed of adoption compared to Netflix and Instagram.

00:43
⚖️

Limitations of ChatGPT

Important caveat that AI is not a substitute for human judgment.

03:39
🔧

List comprehension suggestion

Demonstrates ChatGPT's ability to suggest more efficient code patterns.

14:56
🔧

Tailwind CSS rewrite

Shows how ChatGPT can adapt code to different frameworks and libraries.

18:39
💡

SQL join optimization

Highlights the importance of being specific in prompts to get desired results.

26:58

[00:01] in this tutorial you're going to learn all about what chat GPT is how it works and most importantly how you can use it to boost your productivity as a software developer as a season developer and teacher let me tell you chat GPT is a

[00:15] game changer you don't want to miss out on don't take my word for it just watch on don't take my word for it just watch this video and see for yourself my name is msh hamadani and I'm super excited to be bringing you this

[00:28] tutorial on chat PT I've helped millions of people learn to code and become professional software Engineers through this Channel and my online school code with.com if you're new here make sure to subscribe so you never miss a video so

[00:43] what exactly is chat GPT and how does it work chat jpt is a Cutting Edge AI tool created by open AI it was released in November 2022 and gained 1 million users in just 5 days in comparison it took Netflix 3 and 1/2 years and Instagram 2

[01:00] and a half months to get the same number of users chat gbt is an advanced language model that can understand and generate text you can use it to create content for your website write articles emails tweets cover letters and so on

[01:14] a number of different programming languages like python JavaScript HTML CSS and much much more you can use it to generate dummy data write unit tests translate text or code from one language to another you can use it to explain

[01:29] code for example if there's a piece of code you don't understand you can ask it and it will explain to you like a patient teacher but I have to be honest sometimes it explains too much chat GPT can also help you learn and remember

[01:42] things faster for example you can give it some text and have it ask you a bunch of questions it can also prepare you for job interviews you can have it improve your resume write a cover letter for you and also interview you like an

[01:55] interviewer now do you think chat GPT is going to take your job let me know in the comments ments below the reality is whether you like it or not chat GPT is here to stay in this tutorial I'm going to show you how to use it to get more

[02:07] creative and get things done a lot faster I'll be showing you various examples for different programming languages both for beginners and experience developers but before we dive into that let's take a moment and

[02:19] into that let's take a moment and understand how chat GPT Works chat GPT uses a type of artificial intelligence called a language model a language model is a type of software that is designed to understand and generate human

[02:32] language it does this by looking at a large amount of Text data and learning the patterns and rules of a language for example if the language model is trained on a lot of English texts it will learn about the grammar and structure of

[02:46] English as well as the meanings of words and how they are used in different contexts once the language model has learned about the language it can then be used to generate text in that language now chat GPT provides different

[02:59] language models mod for different purposes gpt3 models which are designed to understand and generate natural language like English and codecs which are specifically trained to understand and generate code these models are

[03:12] trained on billions of lines of code publicly available on GitHub they're mostly capable in Python but they're also pretty good in a bunch of other also pretty good in a bunch of other languages like HTML CSS JavaScript

[03:24] typescript Ruby SQL and more now before we look at specific examples remember chat GPT like any tool has limitations it might sometimes generate incorrect harmful or biased information so don't take whatever it tells you as a silver

[03:39] bullet don't use it to learn to code because the code that is generated is not guaranteed to be right it might be functional but it might not be the best way to code so in a nutshell chat GPT is a powerful tool that can help you be

[03:52] more creative and efficient but it's not a substitute for human expertise and judgment so that's the theory part now let's move on and see chat GPT in action let's move on and see chat GPT in action so head over to chat. open.com if you

[04:05] don't have an account sign up it takes only a minute once you have logged in you're going to see the main screen with an input box to talk to chat GPT there is also a Chrome extension and a desktop application available if you don't want

[04:18] to use the web interface I'll put the links down below this video all right forward I'll be showing you various use cases for different programming languages we'll start off with some general purpose questions that apply to

[04:31] anyone regardless of the programming languages and tools they use you will see how you can use chat GPT to learn new things write shell scripts get commands start a business write legal documents and so on once we cover the

[04:45] basics then we'll dive into specific examples for front end backend and database development I will show you examples using HTML CSS JavaScript examples using HTML CSS JavaScript typescript python SQL and more

[05:00] now here's my first question what are the top three books for learning

[05:13] has given us a very comprehensive and detailed answer now here we can ask more detailed questions for example we can ask questions about the first book so we ask questions about the first book so we can ask what are the key takeaways from

[05:27] can ask what are the key takeaways from head first Java you can see that this book teaches you about object-oriented programming Java

[05:41] fundamentals threading and concurrency GUI programming and so on now we can also ask more general questions like how do I become a frontend

[06:00] to become a front-end developer you need to know the basics of HTML CSS and JavaScript you should practice building websites then you should learn a front end framework like react angular View and so on you should also know about

[06:15] Version Control Systems like git GitHub and so on this is pretty much the same answer you will find on every website that gives you a road map to become a front-end developer now let's look at more specific examples we can ask chat

[06:29] PT to write a shell command for us for example we can say write a bash command to find the name of all JPEG files in a directory and write them all to a text

[06:42] directory and write them all to a text file take a good with Linux commands you can easily find the final instruction you should

[06:55] use to solve that problem but what is beautiful about chat GPT is that it also explains how this command Works line by line piece by piece we can also have chat GPT right git commands for us for example we can ask how do I know how

[07:12] many lines of code I've committed to a git

[07:24] get creative for example let's say you want to start a business you can have chat GPT generate app or website names for you for example we can say I want to make a revolutionary online shopping app give

[07:39] revolutionary online shopping app give me some good app like shop e Swift cart streamline and so on I think this list is pretty damn good

[07:54] you don't need to use the exact same wording to talk to chat GPT you can ask any questions you want in your own way now if you have used this tool before let us know in the comments below the interesting questions you have asked so

[08:08] we can all learn and Inspire each other we can also ask chat GPT to write contracts for us here's an example I want to hire a graphic designer to design my website we have agreed that they will deliver the first

[08:24] agreed that they will deliver the first draft in two weeks and offer three iteration ations free of charge any iteration after will be charged at $50

[08:36] iteration after will be charged at $50 an hour WR a contract for us so the more details we give to chat GPT the better response we'll

[08:49] look this is a pretty damn good contract to start with of course you don't want to take this as is and use it in the real world without first passing it by a real lawyer that that's why earlier I told you that chat GPT is not a

[09:02] replacement for humans at least not at the moment it's just a way to increase your productivity and get things done in less time now if you're applying for a job there are a number of ways chat GPT can help you for example you can have it

[09:15] write a resume for you here we can say I have 3 years of experience coding in have 3 years of experience coding in HTML CSS and JavaScript write a resume for me of course we can give it more details we can explain our education

[09:30] level our past projects and so on but look at what we get with this simple prompt all right take a look so chat GPT created a basic

[09:45] layout that includes our name address phone number email some objective summary technical skills and it has already listed all the related web Technologies so we have HTML CSS JavaScript jQuery bootstrap we didn't

[10:01] mention any of this but it assume that we have these skills it also included a section about professional experience including past projects as well as education certifications and so on again it's a great starting point now let's

[10:17] say you're applying for a front-end developer role you can ask chat GPT to write a cover letter for you that you can email to that company so we can say I'm applying for a frontend engineer Your Role at some company write a cover

[10:33] Your Role at some company write a cover letter for comprehensive cover letter beautifully written in perfect English how good is

[10:46] that now let me show you another fun one we can have chat GPT ask you interview questions we can say act as a technical interviewer and ask me five questions

[10:58] about JavaScript take a questions that are often asked in technical interviews now let's say you

[11:12] don't know the answer to the first question you can ask a followup question so the beauty of chat GPT is that it remembers everything you have told it in this conversation thread so here we can say what is the answer to the first

[11:27] say what is the answer to the first question again we get a very comprehensive detailed answer we can also ask chat GPT to help you write emails for example we can say write an email to my boss asking

[11:43] for a raise I've worked at this company for two years and company for two years and successfully delivered several projects successfully delivered several projects on time

[12:03] myself it would take me 10 to 15 minutes if not longer I got the answer in just seconds all right now let's look at a few examples involving code we'll start with using python by writing a command line tool we can say write a python

[12:19] line tool we can say write a python function for generating a random piece of code beautifully highlighted with explanation of how it works now if

[12:35] there's a part of this code that you don't understand you can always ask follow-up questions for example we can ask what this expression does in this ask what this expression does in this code so we can ask what does four in I

[12:49] range of length do in this code take a couldn't be better now we can also ask computer science questions like what is

[13:05] computer science questions like what is the time complexity of this function now if you're not familiar with this concept time complexity is a way to explain how large inputs impact the performance of an algorithm it's really beyond the

[13:19] scope of this tutorial I've covered it in detail in my data structures course in case you're interested so let's see what we get

[13:33] function's time complexity is linear now let's take this to the next level we can ask chat GPT to write unit test for this function so write unit test for this

[13:53] hand it would take me probably 20 to 30 minutes if not longer of course we should always use our own judgment to make sure that the tests are correct but point and it really saves us a lot of time we can also ask chat GPT for ideas

[14:10] to improve our code for example here on w3schools.com we have this piece of python code where we use a for Loop to iterate over a list of fruits if the fruit has a in it then we add it to a new list I'm going to copy this code and

[14:26] give it to chat GPT to see how we can improve this code so take a look how can improve this code so take a look how can I improve this code now here we should hold shift and then press enter so we go to the next line now we paste our code

[14:40] to the next line now we paste our code and then press enter to submit the absolutely amazing one thing I love here is that chat jpt is suggesting to use a

[14:56] list comprehension which is a oneliner for implementing the same logic of this code we're not going to get into details here we can also ask chat GPT to convert our code from one language to another for example we can say convert

[15:12] another for example we can say convert this python code to seconds our code was converted to JavaScript and down below we have all

[15:27] the details about how the code works we can also use chat GPT to generate dummy data for example we can say generate dummy data for a table

[15:39] called customers each customer should have an ID first name last name and

[15:55] python script for generating dummy data but what if you want want the actual data not a python script we can say I don't need a python script just give me don't need a python script just give me the

[16:16] represented using the Json format now we can take this to the next level and say can take this to the next level and say create a python class for storing these create a python class for storing these objects

[16:34] python class called customer along with how we can use this class to store a list absolutely beautiful now if you're a front end developer you can ask chat jpt to generate some HTML markup for you and

[16:50] this is where examples get more and more interesting for example we can say write interesting for example we can say write the HTML and CSS code for displaying a

[17:08] markup here we have a div with the class of card inside the div we have an image then we have the card content inside this div we have the card title and card description really really good and right below that we have all the CSS we need

[17:24] to display a beautiful card of course we probably need to customize this but again this is a great starting point now we can stop here or we can customize this further for example we can say add a button below the card

[17:48] now we have a new markup right under the card description we have a new div with the class of card action and inside this div we have a button beautiful now we also have more styles for this button we have the plain Styles as well

[18:04] as the styles for the hover effect now let's take this to the next level we can let's take this to the next level we can say when I hover my mouse over the card say when I hover my mouse over the card I want the card to slightly slide

[18:24] should use the hover pseudo class and the translate function y to slide the card up beautiful I love it it's also suggesting an alternative solution using box Shadow so it's pretty up to speed with CSS features now let me show you

[18:39] something really cool we can ask chat GPT to rewrite this code using Tailwind CSS if you're not familiar with Tailwind it's a CSS library that has gained a lot of popularity lately so here we can say can you rewrite this code using Tailwind

[18:57] can you rewrite this code using Tailwind CSS but with the utility classes that come with Tailwind CSS so we don't have to

[19:11] create CSS classes anymore now here we can get more creative and see what other UI libraries are supported next we can bring some JavaScript to the mix and make this interactive so we can say when I click on the button send an HTTP

[19:28] I click on the button send an HTTP request to/ API generated code so chat GPT is suggesting to use the fetch API that is supported

[19:43] in pretty much most modern browsers but I personally don't like to use the fetch API so I'm going to customize this further and say instead of the fetch API use axus which is a library for sending HTTP requests now take a

[20:06] instructions for installing axus using npm or yarn as well as a modified example using axis beautiful we can also ask chat GPT to help us with compile

[20:18] time or runtime errors here is an example let's say as part of writing some JavaScript code we got an error saying uncut type error cannot read saying uncut type error cannot read property let's say bar of undefined

[20:32] JavaScript code has probably come across this Arrow so we can copy paste the error message here now chat GPT explains exactly what this error is and how we exactly what this error is and how we can potentially solve

[20:51] instead of Google now we can also throw react here and make the example more interesting so we can say create a react component so we can say create a react component for displaying a

[21:10] happening here so up here we have an example of a function component for displaying a card now I personally don't like to have a parameter called props it would be nicer to destructure this parameter and grab individual properties

[21:25] like title description and so on if you're not familiar with this concept not going to do a lot of fancy JavaScript stuff in this video this is just to open your eyes to the possibilities so let's take this to the

[21:39] possibilities so let's take this to the next level and say destructure the props parameter so the beautiful thing about chat GPT is that it remembers our chat GPT is that it remembers our conversations so let's go

[21:58] implement of the card component with the props parameter destructured all right now let's move on and look at a few examples involving backend development for example we can ask chat jpt to build an API for us with

[22:11] node and express so here we can say I need an API built with express.js to return the list of products each product should have

[22:24] products each product should have attributes like ID title description attributes like ID title description price and image

[22:37] implementation in this implementation we have an area of products stored in memory and we have an API end point exposed at this URL I don't want to have an area of products in memory I want this products to be stored in a mongod

[22:51] this products to be stored in a mongod DP database so here we can say modify DP database so here we can say modify the code and retrieve the product from a mongod DB or a MySQL or a postgress whatever

[23:04] database now we get a new implementation where products are retrieved from a mongodb database using the Library here it

[23:19] of these parameters is not clear because this code is just plain JavaScript now we can improve this implementation and use typescript so we can say use use typescript so we can say use typescript in this

[23:39] the same web server implemented using typescript now let's say you're a python developer you don't want to use JavaScript so here we can say generate JavaScript so here we can say generate this API using Python and fast API which

[23:53] is another library for building apis using python so implementation our products are stored in memory again we can talk to chat GPT

[24:10] and customize this further all right now let's look at a few examples involving databases this one is pretty interesting so I'm going one is pretty interesting so I'm going to say write a SQL query to generate a

[24:22] to say write a SQL query to generate a table called products with four columns note that I'm not specifying the column names and types here I'm just saying I want a product table with four columns see what

[24:41] enough to know that quite often products have attributes like ID title description and price if this is not what you want you can always specify the name and type of each column for example we can say write a SQL query to generate

[24:57] a table called products with these columns now here you press shift and enter so we go to the next line and on each line we can list a column we can say ID of type integer title of type string category of

[25:15] integer title of type string category of type integer unit price of type float and image URL of type string and you don't necessarily have to put the type right after that you can specify the type so chat GPT doesn't have a

[25:30] particular syntax you have to follow because it can understand human table we have columns like ID title category unit price and so on we can

[25:46] also use chat GPT to write queries for retrieving or updating data for example here we can say write a query to retrieve the top five customers in manhatt P note that we don't currently have a table called customers so we're

[26:02] just asking chat jpt to write a query to retrieve the top five customers in retrieve the top five customers in Manhattan take a

[26:16] has assumed that we have a table called customers with these columns ID name address and City if our customer table has a different schema we need to specify that ahead of time so we specify the name name and type of each column

[26:29] then we ask chat GPT to write a query to retrieve the top five customers now look at this query in this query we're simply selecting customers who are located in Manhattan so in this query the customers are sorted by their ID in descending

[26:44] order and the top five are returned this is not what we really want what we want is the top customers who have spent the most so we need to be more specific with our prompt so we need to tell chat GPT to do a join with the orders table to

[26:58] find out how much each customer has spent then it should grab the top five customers who have spent the most so we can say revise this query and join the

[27:10] can say revise this query and join the customer table with the orders table to find out how much each customer has spent then pick the top five who have spent the most and again here we can specify the schema of the orders table

[27:27] specify the schema of the orders table as well so let's go assuming that we have two tables customers with these columns and orders

[27:41] with these other columns and based on this schema it has revised our query to retrieve the top five customers who have spent the most so that's it guys there are endless ways to get creative and use chat GPT I hope you found this video

[27:55] helpful if you enjoyed it please give it a like and subscribe for more videos like this also let me know in the comment section what interesting questions you have asked chat GPT I would love to hear from you so thanks

[28:07] for watching and I will see you in the next video

More from Programming with Mosh

View all

⚡ Saved you 0h 28m reading this? Transcribe any YouTube video for free — no signup needed.