Well Paid Geek - ChatGPT can teach you how to code
I hope you haven’t forgotten me! It’s WellPaidGeek from Twitter. I haven’t sent an email out in over a year, but now I have switched to Substack (all subscribers moved across) and will be sending out emails covering learning to code and maximising your tech career, with a focus on JavaScript. And maybe TypeScript, if I’m feeling adventurous. Anyway, intro out of the way, let’s talk ChatGPT. It has been the talk of the internet recently. If you haven’t heard about it, it is a language based AI. This basically means it can understand human language, which makes it able to answer questions, almost as well as a human. It’s been loaded up with what seems to be all of the information on the internet, meaning it’s an expert on well… most things. It works by providing responses to ‘prompts’ given to it by you. Prompts are basically questions, or instructions. TLDR; ChatGPT is an API you can ask questions, and it comes up with really good answers on a wide range of topics. Check it out: You can ask it anything from “When did World War II begin” to, “Write 2000 words on the benefits of capitalism” to “Give me the HTML and CSS for the about me page of a portfolio site” and it comes up with pretty good responses for all of those. Recently, I’ve been using it to help me learn to program in Java (I have been doing Java*Script* for many years, now it’s time to tackle backend programming in Java). The reason it’s able to teach you to code and is better than googling for this purpose is:
Now I’ll show you how ChatGPT can teach you JavaScript, but it can be applied to any coding language. Firstly, ChatGPT cannot teach you to code on it’s own. First you will have to watch part of a tutorial, to pick up some basic knowledge. The next step is putting the knowledge into practice, and this is where many people fall over. With ChatGPT as your personal tutor, you don’t have to! In order to really learn how to code, you need to put knowledge into practice. To do this, I recommend CodeWars: It will give you coding challenges, with increasing levels if difficulty. It has a built in editor and tests that verify your code. I found this challenge:
You could just get ChatGPT to tell you how to do this by formulating it as a prompt:
It writes a good function in response, which is amazing. You can see how much more specific the code is than if we did a google search! It even gives a breakdown of how the function works. But just asking it to do all the work means we don’t learn much. The way I’ve been using it to learn Java is as follows:
So let’s imagine a high level pseudocode solution for this problem, then we can ask the Ai how to do bits of it in JavaScipt. The solution would be something like:
If you can get this far on your own, ChatGPT can help you code that solution. Let’s ask ChatGPT how to loop through the characters in a string:
It comes up with a few options, I like this one the best:
For each char, we need to check if it is a vowel. We could have multiple ifs, but would be easier if we had a list (array of vowels) and checked if the char was in the list.
ChatGPT tells me to use an array of strings for my list, then do
to check if the item is in the list. Now we can put it all together:
And CodeWars says that works! Computers teaching us how to program computers. What strange times we live in. |
Key phrases
Older messages
How to hunt down the best paid tech jobs
Sunday, June 12, 2022
I've sometimes been quoted my salary on Twitter only to be told, in no uncertain terms, that dev jobs in London don't pay that much. Not only is this simply not true, it goes further: I'm
Things are looking bad... What should devs do?
Wednesday, May 25, 2022
I don't want be a 'doomer' as many call them, but things aren't looking good. All across the western world, from the UK to the USA the economic situation is looking worse by the day.
Tech interviews suck
Friday, November 26, 2021
I haven't been looking for work, but with the recent employment boom recruiters have contacted me with a few offers that were too good not to interview for. I didn't get any of these. I
Welcome to the Well Paid Geek Newsletter
Thursday, October 7, 2021
Welcome to the Well Paid Geek email newsletter. If you weren't expecting to have been signed up to this newsletter, feel free to click the unsub link at the bottom! If you were expecting it, read
The simplest path to a Well Paid tech career in 2021
Thursday, October 7, 2021
About a month ago now a wrote a Tweet that blew up quite nicely: HTML & CSS => JavaScript => React => Get paid $$$ Although this sounds oversimplified, there is an important truth
You Might Also Like
Daily Coding Problem: Problem #1395 [Hard]
Thursday, March 28, 2024
Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Google. Implement an LRU (Least Recently Used) cache. It should be able to be
72 x $99 tickets left for virtual product conference (May 2)
Thursday, March 28, 2024
ACT FAST! ONLY 72 TICKETS AVAILABLE AT THE DISCOUNTED RATE OF $99! MAY 2, 2024 | ONLINE ACROSS THE WORLD Join product people from around the world on Thursday, May 2, for INDUSTRY, the #1 Virtual
⚙️ "I'm a GPT builder" 😎
Thursday, March 28, 2024
Plus: Elon's Grok will be available to all
🔒 The Vault Newsletter: March issue 🔑
Thursday, March 28, 2024
Get the latest business security news, updates, and advice from 1Password. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏
📑 Discover The Power of AI With UPDF — 63% Off For a Limited Time
Thursday, March 28, 2024
Digitally Read/Sign/Edit/Summarize PDFs Seamlessly. Available Now at a Huge Discount! How-To Geek Logo March 28, 2024 Tired of Dealing With PDFs? Try AI-Powered UPDF With the Biggest Discount of the
Issue 310 - New Autopark looks awesome!
Thursday, March 28, 2024
View this email in your browser If you are just now finding out about Tesletter, you can subscribe here! If you already know Tesletter and want to support us, check out our Patreon page Issue 310 - New
Programmer Weekly - Issue 199
Thursday, March 28, 2024
View this email in your browser Programmer Weekly Welcome to issue 199 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "Optimization hinders evolution.
wpmail.me issue#660
Thursday, March 28, 2024
wpMail.me wpmail.me issue#660 - The weekly WordPress newsletter. No spam, no nonsense. - March 27, 2024 Is this email not displaying correctly? View it in your browser. News & Articles What's
New attack targets Apple devices
Thursday, March 28, 2024
Eufy's new Mach S1 Pro; Using VR in a car; April solar eclipse FAQ -- ZDNET ZDNET Tech Today - US March 28, 2024 placeholder New password reset attack targets Apple device users - what to do if it
Web Tools #558 - ImageKit Review, JS Libraries, Git/CLI Tools, Jamstack
Thursday, March 28, 2024
WEB VERSION Issue #558 • March 28, 2024 The following is a paid product review for ImageKit's Video API, a developer-friendly toolkit for real-time video optimizations and transformations, to help