I'm Not Afraid of AI

Dec 17, 2022 5:01 pm

Read Time: 3.5 minutes


After seeing the 1000th post this week about how AI is going to replace our jobs — the topic for this week's newsletter was obvious.


I don’t think that our jobs are in danger anytime soon, but AI is the future.


If you don’t learn how to use it you will be left in the dust compared to anybody who does. That’s just the nature of progression.


One of my favorite things that Naval said about AI on Twitter:


image


The way I interpret this is:

AI is not becoming “human”

It pushes the definition of “human” to new heights


It will make us better.


When I started programming, having tools like this would have saved me from banging my head on the desk. I spent countless hours Googling until my fingers fell off because I didn’t know what I didn’t know.


You can’t Google what you don’t know. AI changes this completely.


If you are new to programming — pay attention to AI.


The past few weeks I have been using ChatGPT and it is changing the game. Let’s talk about some good ways to use AI to augment your work.


I’m going to break this down into three ways that AI can help you code.


  1. How do I do this?
  2. Finish this for me!
  3. Save me the energy."


I will mention two AI coding tools in this issue.

  • ChatGPT
  • GitHub Copilot


Both are linked at the bottom.


Let's jump in.


1. How Do I Do This?

You need AI to show you how to code something that you don’t know how to do but can describe in English.


Examples:


- How do I make a call to the Twitter API to get a user's post?

- How do I make a login system in firebase?

- How to make an element wider in CSS?


Here’s what I got when I asked ChatGPT to write code that fetches tweets in Python:


image


Pretty cool, huh?


Of course, this won’t always be spot on but it serves a great place to start a better Google search.


After one question I have a basis point:

- I know the tweepy library exists

- I know I need a consumer key, consumer secret, access token, and access token secret


Within 10 seconds I have a couple of pieces of problem-specific information that I didn’t know before.


Next time you have a generic question and need more context try out AI first. The results have been shocking.


2. Finish this for me!

You’re writing something and want to ask the AI To finish it for you


- Throw an error if this thing is less than 100

- Check if the sentiment of this text is positive

- Get the time difference between these two things in milliseconds


The second one is featured on the home page of Github Copilot (linked at the bottom)


This is best for tedious tasks:

- Writing a switch statement for every possible value of an enum

- Writing Regex to check something specific

- Any kind of date/time validation


3. Show me how.

You want AI to show you how to do something you know exactly what to do, but aren’t sure how.


- Show me how to do this complex regex

- Truncate a string in Python

- Format a DateTime in Java

- Flip an array in C#


Nobody is paying you as a programmer to write code

They are paying you to know how to solve problems with code


This just makes your life way easier.


No more Googling “How to match any decimal in Regex”


Take this example:

”I need to decode this base64 string, remove special characters, and check if the text includes ‘admin’ in Python code”


In the past:

  1. Google “how to decode base64 in python”
  2. Google “how to remove special characters in python string”
  3. Google “how to check if a string includes another string in python”
  4. Piece together all that information in your head to make a few functions


With AI:

1. Ask “How do I decode this base64 string, remove special characters, and check if the text includes ‘admin’ in Python code”


image


brb I just soiled my trousers.


If this doesn’t get you fired up I don’t know what will.


____________________


That’s all for this week!


If you ever have any questions:

  • Connect with me on LinkedIn
  • Add a message saying “From the Newsletter” (I will accept)
  • Shoot me a DM


Best of luck out there!


Liam

Comments