ProgrammingJavascriptCareerProductivityGadgetsASP.NETWeb Design

How Developers Can Get Ahead of the Looming A.I. Race

Written by
Published on
Modified on
How Developers Can Get Ahead of the Looming A.I. Race

Almost on a daily basis now I read articles talking about tech companies downsizing and laying off it's dev workforce. Sometimes it's hundreds of developers and other times it's thousands. Much of this could, of course, just be seasonal as the year closes out or based on the market economy which is constantly in flux these days.

But I'm sure that at least some percentage of these layoffs are due to the growing number of A.I. companies selling software that promises to manage your companies daily operations for pennies on the dollar. Why pay a developer a full-stack salary, when company X can provide the same features with a monthly subscription.

On the positive side of things though, for every mass layoff that I read about online, I also read about a new A.I. company who's in the process of raising millions in venture capital.

And those millions, typically equate to new jobs in those particular sectors. So before you put away your mechanical keyboard and consider a career change, read about a few ways in which you can start to prepare for the eventual A.I. economy and workforce that is right around the corner.

Engineering prompts

And no, I do not mean "prompt engineer".

Most developers that I currently engage with still do not really use A.I. agents in their day to day work. If they hit any snags, whether logical in nature or a hard to debug error, they'll sit there and try to figure it out or head on over to Google for the potential answers.

And to be fair, I still pretty much do the same thing whenever I hit a snag. Until I remember that there's this artificial intelligence that can get me answers quicker than most search engines and that for the most part, is more up to date.

While this developer doesn't personally believe that people will be paid 6-figure salaries in the future to write a few sentences into a textarea, I do think that folks with the best prompts will have to work less and will also have better output, similar to having a newer textbook versus one that was written 20 years ago. Odds are, the newer book has a few details that might make things easier.

Prompts can range anywhere from a 10-word sentence all the way to 5 paragraphs of text. But to start things off simply, here are a few prompts that I myself use and that I've actually found useful in my day to day work.

Short form prompts

"Review this code and list the ways to optimize it"

"Audit this code and walk me through the steps"

"Analyze this code and look for flaws in security"

I mainly use these when working with external API code that I'm not very familiar with. ChatGPT does a surprisingly decent job at guesstimating intent based on keyword names and even based on expected output.

The interesting part here is that no matter how good you think your code is, there's always something that you could be doing differently. It might not, in the end, be the most ideal thing to do, but it does make you at least think about your code a bit more.

More importantly though, there are hundreds if not thousands of changes to programming languages and frameworks on a yearly basis, and it would be near impossible for any developer to keep up in real time with all of them.

In having ChatGPT analyze and offer suggestions to your code snippets, you might discover a new language feature that you were not aware of in the past. This has happened to me numerous times already and having the ability to simply ask for clarity on these new features instantly is a game changer.

Code optimization

As an example of code optimization, take the following pretty basic function that parses some decimal string and returns it with at most 2 decimal places.

var strDecimal = "3.14159265359"; // Your string decimal value
var numericValue = parseFloat(strDecimal);

if (!isNaN(numericValue)) {
  // Round the numeric value to two decimal places
  var roundedValue = numericValue.toFixed(2);

  // Convert the rounded string back to a numeric value
  var finalNumericValue = parseFloat(roundedValue);

  console.log(finalNumericValue); // This will output 3.14 as a number
} else {
  console.log("Invalid input"); // Handle the case where the conversion fails
}

And now prompting ChatGPT to optimize the code with the following:

"Can you optimize this code"

We get the following code back.

var strDecimal = "3.14159265359"; // Your string decimal value
var numericValue = parseFloat(strDecimal);

if (!isNaN(numericValue)) {
  var finalNumericValue = Math.round(numericValue * 100) / 100;
  console.log(finalNumericValue); // This will output 3.14 as a number
} else {
  console.log("Invalid input"); // Handle the case where the conversion fails
}

And we event get a brief explanation as to what was changed and why.

It should go without saying that you should always test any code that isn't your own to ensure that it works within the confines of your environment. This was a relatively simple example, but depending on the logical complexity and overall chunk of code, you could end up with drastic updates.

It should also be stated that you probably shouldn't provide any secret keys, API keys, tokens, etc in your prompts.

Long form prompts

Prompt sizes have grown exponentially since the early days of ChatGPT. And these days, your prompts can roughly be the size of 300 pages of a book. But realistically, most people will stick to 1 or 2 paragraphs for any given input.

Unlike the short prompts seen above, where you are essentially telling an A.I. agent to perform a certain task, longer strings typically include character traits and personality descriptions in order to set the foundation of the conversation going forward.

"Act as a full stack developer and create a database schema for a user registration system. Provide proper primary keys and PostgreSQL create scripts. Also create an Express js script that relies on pg to query this database...etc"

Once again, be mindful of code generated automatically and instantly and do the proper due diligence before implementing it on production. But for the most part, the prompt works and it generates the following.

It's not the most advanced or complete database, but it's a starting point. And this is really where you would want your first initial prompt to be as thorough as possible. If you need more columns, or more relations, state it in the prompt. If you have restrictions or need added security, mention it as well.

The initial prompt really just primes the entire conversation so that down the line you will get answers more akin to what you are expecting. It can take a bit more work to create longer prompts, and you might not get the results that you want in the beginning, but this is definitely good to figure out and to have in your collection for future use.

As I mentioned above, the goal isn't to be a "prompt engineer" per say, but more so to know how to engineer prompts as needed in order to do the job.

OpenAI API

It almost seems like at the very far end of pretty much anything technological, you always find a developer implementing some form of a RESTful API in their language of choice.

If one day we were to finally discover that our world is a complex simulation the likes of which no human can understand, I'd bet there's an API and a lone developer at the forefront.

The OpenAI API is really at the heart of what OpenAI is. And that's because millions of developers are using it daily in new and innovative ways that no one has seen before in order to create A.I. based applications.

So get familiar with the API as soon as possible and really see where it makes sense for your specific needs. To get started, head on over to the official OpenAI documentation page and set up your first hello world application.

Note that the difficult part here isn't so much in understanding the implementation code, because for the most part that's pretty straightforward:

import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const completion = await openai.chat.completions.create({
    messages: [{ role: "system", content: "You are a helpful assistant." }],
    model: "gpt-3.5-turbo",
  });

  console.log(completion.choices[0]);
}

main();

The challenge is mainly going to lie in deciding what you will create and how you will be keeping track of these conversation threads.

You'll also have to play around and experiment with the different models and various modalities such as speech and image recognition and so on and so forth.

Custom GPT's

I've written in the past about OpenAI's custom GPT feature and how anyone can use it to generate a tailored personality and experience for their specific use cases.

One way that I'm personally leveraging this feature is by creating GPT's that can walk me through new languages, frameworks, libraries and API's from the ground up.

Just recently for example I decided to turn this blog into a Progressive Web Application as it had been on my to do list for some time. I know the general gist of PWA's, but I've never really taken a deep dive into implementation.

And so I decided to create a GPT that would do just that.

"PWA Mentor" is a friendly and casual guide for learning Progressive Web Applications (PWAs), designed to make learning approachable and enjoyable for everyone, from novices to experienced developers. It will use a conversational tone to explain PWA concepts like service workers, offline capabilities, and performance optimization. The GPT will offer examples frequently to illustrate points, ensuring that theoretical concepts are grounded in practical application.

The resulting GPT was lacking in any deep technical explanations, but it was very much practical. And that's the one area that was hard to find in online tutorials. Much of the documentation found online was dozens of pages long and jumped around from concept to concept thoroughly explaining every single keyword in detail.

The custom GPT though was able to get me the code needed to set everything up in less than half an hour. And for me, that's really the hard part. Ideally I want to get to an MVP as soon as possible, and then once everything is in place, I can dive in to fine-tune.

And you can generate a custom GPT to teach you pretty much any concept that's new to you with as much (or as little) detail as you need.

You'll need the Plus plan enabled on ChatGPT in order to leverage this feature however, which may or may not be available as of this writing.

Interview practice

Regardless of your skills in A.I., you still need a company to pay you a set amount for those skills. And that means, you guessed it, interviews. And as far as I can tell, there's no robot that will get in your car and drive for 1-hour to a random location to sit in chair for an interrogation. Not yet anyway.

But there is a robot that will ask you random interview questions an then rate how well you answered.

"Can you be a technical interview coach focused on helping programmers land their next job. you will ask soft-skill and technical questions and rate how the person answers in details and offer suggestions."

The biggest benefit here is that you can customize your prompt to account for your particular skill level. You could even feed ChatGPT a job description that matches what you are applying to and have it generate the best questions possible for you specifically.

There are tons of online websites with various algorithms to solve in order to practice for your interviews. But so far, most of them don't walk you step by step through the entire solution.

Conclusion

The technical landscape is changing and changing rapidly these days. When A.I. was merely a whisper found on various online forums I would have said otherwise. I would have said that developers aren't going anywhere and that nobody could do the job better.

But change isn't necessarily a bad thing. It's just uncomfortable for some time until we figure things out. And we can definitely speed that process up by diving in now and working to stay ahead of the curve.

Walter Guevara is a software engineer, startup founder and currently teaches programming for a coding bootcamp. He is currently building things that don't yet exist.
#AI

Comments

No messages posted yet

Developer Poll

Q:

Stay up to date

Sign up for my FREE newsletter. Get informed of the latest happenings in the programming world.

Add a comment

Keep me up to date on the latest programming news
Add Comment

Stay up to date

Get informed of the latest happenings in the programming world.

No thanks