Rubber Ducky for Engineers - How to use ChatGPT as a Search Engine

by: Kira Corbett

There sits a yellow, small rubber ducky with a cowboy hat on. You know, the ones you might see at a carnival for some silly little game to win a prize of a giant stuffed unicorn.

Back in the office days, pre-COVID era, the rubber ducky was more than desk swag. The rubber ducky was a tool, and that tool would certainly go around the office. A fellow engineer would pick up the desk swag and place it on another engineer's desk. This was an initiative - sometimes to play ping-pong in the office - but mostly to invite another engineer to have a "rubber duck" session. A time to walk through ideas, brainstorm, and debug out loud. And I'm sorry if you got invited to a rubber duck session with me… because more often than not, the engineer who picked up the rubber duck would articulate their ideas out loud and come to their own solution to their bugs right then and there.

But due to a culture more comfortable with remote work, carrying a rubber ducky around the office is not as common anymore. Even in the office, people in meetings, "in the zone" writing code, etc. it was not always possible to just play ping-pong or debug through problems. That is why recently, I have started shifting to using ChatGPT and other AI text-generated tools to help me rubber duck through my code.

How AI Tools can be Used in Place of Search Engines

Adopting ChatGPT instead of a Google search is useful for many search reasons:

Informational

  • Personalized information based on direct context you provide
  • Summarized information
  • Links to more exact summarized information (think Stack Overflow!)

Debugging and Learning

  • Debugging with Q&A to help source and solve bugs in code
  • Mocking and creating fake data for APIs
  • Learning or formulating a plan to learn
  • Feedback, iteration, and writing

Other

  • Ideas and brainstorming
  • Entertainment
  • All-around personal assistant

There are many more reasons to why using an AI powered tool could be useful. In these ways, ChatGPT and related software offer more personalized, context-aware, and a total rubber duck.

The Three C's of AI - Clarity, Context, Constraints

  1. Clarity - be clear with your prompts and intentions by providing specific details to guide the AI. Be concise and use the least amount of words if possible.

  2. Context - provide examples or details to help the model understand.

  3. Constraints - guide with your purpose by limiting the output, length, format, and/or style.

Informational

Use a tool like Phind that is developer-specific or Perplexity that offers coding-specific summarizations.

Ask questions to help source more personalized information from forums like Stack Overflow, examples, and better documentation. These tools will help source forum questions more efficiently.

If you are not looking for forums, AI chats are still a great way to ask questions about analyzing information or look up how to refresh yourself on how to configure something for a project. Example: How do I set up a static website hosted by GitHub?

πŸ’‘ Tip: Don't forget to use the Three C's for writing more effective questions.

Debugging & Learning

Q&A to Help Source and Solve Bugs in Code

I have an error in my code. Given this error and my code below, could you help me understand the solution? Here is the error message in my code:

// Incorrect function 
myFunction() { if (true) { console.log('Hello World'; } }

image

Tools like Copilot or Cursor can be useful within your code environment to highlight and reference specific pieces of code in conjunction with other moving parts.

πŸ’‘ Tip: Rather than asking AI tools to give you code, consider asking questions about your code to help you "rubber duck" and think out loud. Sometimes stepping through this process helps you learn more about what is going on in your code. You can even prompt in your question to in a way that won't just spit out code and instead walk you through the solution e.g. "without giving me the answer, walk me through the steps to help me find the solution."

ChatGPT Response

Formulate a Plan to Crush Your Interviews

Using AI is also a great way to help consolidate ideas and formulate a plan to learn something new.

Example Prompt: Create a 30 day plan to study for technical coding interviews in JavaScript.

Example of Week 1 of 4 Response

Week 1: JavaScript Fundamentals & Problem-Solving Basics

Day 1-2: JavaScript Basics

Topics:

  • Variables, Data Types, and Operators
  • Functions (declaration, expression, arrow functions)
  • Scope and Hoisting

Practice:

  • Write simple functions (e.g., sum of two numbers, basic string manipulation).
  • Practice problems on LeetCode, HackerRank, or CodeSignal.

Day 3-4: Control Flow

Topics:

  • Conditional Statements (if, else, switch)
  • Loops (for, while, do-while)
  • Break and Continue

Practice:

  • Solve problems involving loops and conditions (e.g., FizzBuzz, prime numbers, factorial).

Day 5-7: Functions and Arrays

Topics:

  • Higher-order functions (map, filter, reduce)
  • Array methods (push, pop, shift, unshift, splice, slice)
  • Recursion basics

Practice:

  • Solve array manipulation problems (e.g., reverse an array, find the maximum element, filter even numbers).
  • Start working on basic recursion problems (e.g., factorial, Fibonacci sequence).

πŸ’‘ Tip: Be specific on what you want to learn, language(s), duration, subject, etc.

Building a Full Stack Application

Want to learn a new coding language? What about the best resources for cloud services? Or backend databases? How about the latest Full Stack tools? Or which services you should incorporate in your new project?

When learning something new or wondering what could be a reasonable approach to start with, it can be useful to rubber ducky with the AI bot. Sometimes there is just too much information on the web that I don't know where to start.

Let's say I am building a mountain bike app that recommends me the most used trail of the day. This would be a mobile app that requires users to login so that they can comment and update conditions of the trail. Thinking about the app, what are codebase options for mobile apps? What cloud services should I use? How should I deal with authentication. The list goes on. Using something like ChatGPT can help jumpstart your Google searches in an saturated forums.

Mountain Bike App Questions for ChatGPT

Now with this information, it helps me fine-tune my Google searching knowing what to look for rather than wandering around the internet with a rubber ducky head cut off.

πŸ’‘ Tip: When it is overwhelming on where to start on a project, consider discussing it with AI to jumpstart your ideas and receive summarized information to look into places to start.

Personal Assistants & Entertainment

No more co-workers to play ping-pong in the office with? Well at the end of the day these AI tools are largely based off of data and probability to guide the model to the next best answer so it can be quite entertaining to try and get more sentiment responses using AI as your personal assistant! I asked what ChatGPT thoughts about rubber ducks.

"So, yeah, rubber duckies are pretty awesome in their own way!"

Rubber Ducky ChatGPT Response

There are numerous ways as a web developer to use AI like a search engine. Most of the time, you receive personalized and summarized information. Even logical conversations stepping through bugs or learning something new. Even though rubber ducky talks in the office might be out of date, consider using AI as the ultimate office rubber ducky.

More Resources