How I Use AI to Boost My Productivity As a Programmer

Table of Contents

AI: A Tool To Empower, Not Replace

A major topic of discussion currently is whether AI poses a threat to jobs in graphic design and art. I believe that an important factor is being overlooked during these conversations. Graphic designers and artists are, first and foremost, creative forces.

AI is simply a tool, an extension of the capabilities its users have. The vision and creativity of a graphic designer or an artist cannot be engineered solely through prompts; they stem from their unique personal experiences and understandings.

Similarly, I believe that AI will not replace software engineers, but rather serve as a tool that enhances the output software engineers produce.

In this blog post, I’ll highlight the various ways I have used different LLM models to enhance my productivity by cutting down the time I would have otherwise spent on certain tasks.

Use Cases

Data

Data Creation

One way I’ve improved my productivity is by using AI to create dummy data for various purposes.

The first of these is generating dummy data for a new database table. This is useful in situations where you need to test an API that interacts with a new table in the system.

A prompt for this use case could look like this:

Using the below SQL `CREATE TABLE` statement, generate 10 `INSERT` statements using dummy data.

Make the generated data relevant to the name of the column it's being generated for.

SQL Query:


CREATE TABLE EmployeeDetails (
    EmployeeID INT PRIMARY KEY AUTO_INCREMENT,
    FirstName VARCHAR(50) NOT NULL,
    LastName VARCHAR(50) NOT NULL,
    EmailAddress VARCHAR(100) UNIQUE NOT NULL,
    PhoneNumber VARCHAR(20),
    HireDate DATE NOT NULL,
    DepartmentCode CHAR(5) NOT NULL,
    JobTitle VARCHAR(100),
    Salary DECIMAL(10, 2),
    LastPerformanceReview TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Another data creation method involves generating JSON objects, often needed for testing new APIs. You can provide a set of variables (like class fields) and ask the AI to create a corresponding JSON object with relevant dummy data.

A prompt for this use case might be:

Using the below set of Java class variables, generate a sample JSON object.

Make the generated data relevant to the name of the variable it represents.

Variables:
private int employeeID;
private String firstName;
private String lastName;
private String emailAddress;
private String phoneNumber;
private Date hireDate;
private String departmentCode;
private String jobTitle;
private double salary;
private Timestamp lastPerformanceReview;

Data Sorting

Another way AI can be utilized in your workflow is to sort lists of data into a specific order for various use cases.

A prompt for this could look like:

Sort the list of strings below into alphabetical order.

List:
[
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]",
  "[email protected]"
]

Data Comparison

Lastly, AI can be used to compare two datasets. This can be useful when you need to check large outputs for discrepancies, such as comparing JSON responses from an old API versus a newly refactored one.

This is particularly useful when the keys (field names) within the data might differ between the two versions, even if the underlying values should be the same.

A prompt for this use case might be:

Compare the two JSON objects below and verify that their corresponding values match.

Note that the keys (field names) in the JSON objects use different naming conventions (e.g., camelCase vs. snake_case), but the data should correspond.

JSON 1:
{
  "metadata": {
    "schemaVersion": "1.0"
  },
  "data": [
    {
      "EmployeeID": 987,
      "FirstName": "Elara",
      "LastName": "Vance",
      "EmailAddress": "[email protected]",
      "PhoneNumber": "+1-555-123-4567",
      "HireDate": "2023-03-10",
      "DepartmentCode": "DEV",
      "JobTitle": "Software Developer II",
      "Salary": 95000.00,
      "LastPerformanceReview": "2025-02-15T11:00:00-05:00",
      "emergencyContact": {
        "name": "Marcus Chen",
        "relationship": "Friend",
        "phone": "+1-555-987-6543"
      },
      "skills": ["Python", "Django", "PostgreSQL", "REST APIs", "AWS"],
      "projects": [
        {"name": "Project Chimera", "startDate": "2023-06-01", "endDate": "2024-05-30", "role": "Backend Developer"},
        {"name": "Data Pipeline Init", "startDate": "2024-07-15", "endDate": null, "role": "Data Engineer"}
      ]
    }
  ]
}

JSON 2:
{
  "metadata": {
    "schema_version": "1.2"
  },
  "data": [
    {
      "employee_id": 987,
      "first_name": "Elara",
      "last_name": "Vance",
      "email_address": "[email protected]",
      "phone_number": "+1-555-123-4567",
      "hire_date": "2023-03-10",
      "department_code": "DEV",
      "job_title": "Software Developer II",
      "salary": 95000.00,
      "last_performance_review": "2025-02-15T11:00:00-05:00",
      "emergency_contact": {
        "name": "Marcus Chen",
        "relationship": "Friend",
        "phone": "+1-555-987-6543"
      },
      "skills": ["Python", "Django", "PostgreSQL", "REST APIs", "AWS"],
      "projects": [
        {"name": "Project Chimera", "start_date": "2023-06-01", "end_date": "2024-05-30", "role": "Backend Developer"},
        {"name": "Data Pipeline Init", "start_date": "2024-07-15", "end_date": null, "role": "Data Engineer"}
      ]
    }
  ]
}

Code Generation & Automation

Class Creation

Generating class definitions (like Java POJOs or data classes) from JSON objects is a very useful application. Compared to dedicated programs written for this purpose, AI allows you to quickly make on-the-fly changes or specify requirements for the generated output, such as using specific annotations.

A prompt for this use case could look like:

Using the JSON object below, create a Java class.

Use Spring Boot and Lombok annotations (like `@Data`, `@NoArgsConstructor`, `@AllArgsConstructor`) and avoid generating explicit getter and setter methods. Ensure nested objects are represented as separate classes if appropriate.

JSON:
    {
      "EmployeeID": 987,
      "FirstName": "Elara",
      "LastName": "Vance",
      "EmailAddress": "[email protected]",
      "PhoneNumber": "+1-555-123-4567",
      "HireDate": "2023-03-10",
      "DepartmentCode": "DEV",
      "JobTitle": "Software Developer II",
      "Salary": 95000.00,
      "LastPerformanceReview": "2025-02-15T11:00:00-05:00",
      "emergencyContact": {
        "name": "Marcus Chen",
        "relationship": "Friend",
        "phone": "+1-555-987-6543"
      },
      "skills": ["Python", "Django", "PostgreSQL", "REST APIs", "AWS"],
      "projects": [
        {"name": "Project Chimera", "startDate": "2023-06-01", "endDate": "2024-05-30", "role": "Backend Developer"},
        {"name": "Data Pipeline Init", "startDate": "2024-07-15", "endDate": null, "role": "Data Engineer"}
      ]
    }

Basic Script Creation

You can also create simple scripts for various tasks. These scripts might perform simple actions like modifying file names within a directory and its subdirectories, or extracting specific information from a dataset (e.g., finding certain tags in XML files).

A prompt for a file renaming script could be:

Create a bash script that goes through every directory within a given path and renames files from a `dd-mm-yyyy` format to a `YYYYMMDD` format. The script should take the target directory path as an argument.

ETL Processes

When developing ETL (Extract, Transform, Load) processes, you often need to generate code (like database insert statements or object population logic) based on the data source. Manually writing code to map data source fields to object properties or database columns can be time-consuming, especially when dealing with many fields and null checks.

AI can speed this up. For instance, you can ask it to generate Java code to populate an object from a map (representing a row of data), including handling potential null values.

A prompt for this might look like:

Using the following CSV column headers, generate Java code that populates an instance of the `CustomerOrder` class below using data from a `HashMap<String, String> rowData`.

Ensure the code handles potential null or missing values from the `rowData` map gracefully, setting corresponding class fields to null (or default values for primitives if appropriate) if the source value is absent or null. Parse data types correctly (e.g., String to Integer/Double/Date).

Headers: `CustomerID,FirstName,LastName,Email,PhoneNumber,AddressLine1,AddressLine2,City,State,ZipCode,Country,OrderDate,TotalAmount`

Java class:
public class CustomerOrder {
    private Integer customerId;
    private String firstName;
    private String lastName;
    private String email;
    private String phoneNumber;
    private String addressLine1;
    private String addressLine2;
    private String city;
    private String state;
    private String zipCode;
    private String country;
    private Date orderDate;
    private Double totalAmount;
}

Table Creation

Table creation is another useful use case. You might have a JSON object or a Java class definition and need to generate the corresponding SQL CREATE TABLE statement for your database.

Here, you can provide the JSON object or Java class and prompt the AI to create the SQL script. You could even ask for both the SQL and a corresponding data class (like a Java POJO).

A prompt for this use case:

Using the below JSON object, generate:

1. An SQL `CREATE TABLE` statement suitable for a relational database (e.g., PostgreSQL or MySQL). Define appropriate column types, constraints (like NOT NULL, UNIQUE), and consider primary/foreign keys if implied. Handle nested objects/arrays appropriately (e.g., potentially separate tables).
2. A corresponding Java class using Spring Boot and Lombok annotations (like `@Data`, `@Entity`, `@Table`, `@Id`, `@Column`).

JSON:
    {
      "EmployeeID": 987,
      "FirstName": "Elara",
      "LastName": "Vance",
      "EmailAddress": "[email protected]",
      "PhoneNumber": "+1-555-123-4567",
      "HireDate": "2023-03-10",
      "DepartmentCode": "DEV",
      "JobTitle": "Software Developer II",
      "Salary": 95000.00,
      "LastPerformanceReview": "2025-02-15T11:00:00-05:00",
      "emergencyContact": {
        "name": "Marcus Chen",
        "relationship": "Friend",
        "phone": "+1-555-987-6543"
      },
      "skills": ["Python", "Django", "PostgreSQL", "REST APIs", "AWS"],
      "projects": [
        {"name": "Project Chimera", "startDate": "2023-06-01", "endDate": "2024-05-30", "role": "Backend Developer"},
        {"name": "Data Pipeline Init", "startDate": "2024-07-15", "endDate": null, "role": "Data Engineer"}
      ]
    }

Similarly, you can use an SQL CREATE TABLE statement to generate code files necessary for database interaction within your application framework. For example, using a framework like Spring Boot, you can generate JPA Entity classes and Repository interfaces from an SQL table definition.

A prompt for this:

Using the below SQL `CREATE TABLE` statement, generate the corresponding Spring Boot JPA Entity class (using Lombok annotations and appropriate JPA annotations like `@Entity`, `@Table`, `@Id`, `@Column`, `@GeneratedValue`) and a Spring Data JPA Repository interface for it.

SQL Statement:
CREATE TABLE EmployeeDetails (
    EmployeeID INT PRIMARY KEY AUTO_INCREMENT,
    FirstName VARCHAR(50) NOT NULL,
    LastName VARCHAR(50) NOT NULL,
    EmailAddress VARCHAR(100) UNIQUE NOT NULL,
    PhoneNumber VARCHAR(20),
    HireDate DATE NOT NULL,
    DepartmentCode CHAR(5) NOT NULL,
    JobTitle VARCHAR(100),
    Salary DECIMAL(10, 2),
    LastPerformanceReview TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Repetitive Code Generation

Similar to the ETL example, AI can generate repetitive code segments. For instance, this could be generating a series of similar function calls within a switch statement where most parameters are identical except for one that varies based on the case.

A prompt for this use case:

From the list of strings below, create a Java `switch` statement (using the enhanced switch expression if possible). Each `case` should call the function `process_item` mentioned below.

All function inputs are the same except for the `item_type` parameter, which should take the value from the corresponding `switch case`. Assume the switch operates on a variable named `itemKey`.

List of cases: `["apple", "banana", "cherry", "date"]`

Function call signature: `process_item(String item_type, int quantity)`

Example usage inside switch: `process_item(item_type=X, quantity=5)` where X is the case value.

URL Generation

Let’s imagine you need to test two APIs that use the same conceptual path parameters but expect them in a different order or format within the URL path. You have an example URL for the first API and want to construct the URL for the second API using the parameter values extracted from the first. Instead of manually copying and pasting each parameter value, you can ask the AI to generate the second URL for you.

A prompt for this use case:

Create the second URL (URL2) by extracting the necessary path parameter values from the first URL (URL1) and placing them into the structure of URL2.

URL1 (Source of values): `/api/v3/processing-modules/data-analysis/complex-calculations/results/batch-id-47b9f2a8-c6d1-4e53-a017-9923d5678ef0/sensor-readings/time-series/2025-04-01T15:20:30Z/aggregated-hourly`

URL2 (Target structure with placeholders): `/data-analysis/results/batch-id-{batchId}/time-series/{timestamp}`

Identify `batchId` and `timestamp` from URL1 and insert them into URL2.

Web Frontend & CSS

Effect Creation

AI can help create various CSS effects. These could range from simple effects like text glows or shadows to generating animation code snippets, perhaps using libraries like Framer Motion or just plain CSS keyframes.

A prompt for this use case:

Create a CSS class named `text-glow` that applies a subtle blue glow effect to text elements it's applied to.

CSS Modification

AI can also assist with modifying existing CSS, like altering an animation’s behavior.

A prompt for this use case:

Given the CSS animation below, modify the `@keyframes moveRight` rule. Add the effect that the item completes a full 360-degree rotation (`transform: rotate(360deg)`) during the final moments of its move to the right (e.g., between 90% and 100% of the animation duration), while still reaching the final `left` position.

CSS:
.moving-item {
  width: 50px;
  height: 50px;
  background-color: blue;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  animation: moveRight 3s linear infinite alternate;
}

@keyframes moveRight {
  0% {
    left: 0;
    transform: translateY(-50%) rotate(0deg); /* Start rotation state */
  }
  100% {
    left: calc(100% - 50px);
    transform: translateY(-50%) rotate(0deg); /* End rotation state (to be modified) */
  }
}

.container {
  width: 500px;
  height: 100px;
  position: relative;
  border: 1px solid #ccc;
  margin: 20px auto;
}

Graphics & Image Manipulation

Image Modification

There might be cases where you have an SVG image and need to make programmatic modifications, such as rotating it or changing colors, directly within the SVG code. AI models can sometimes assist with generating the modified SVG code.

A prompt for this use case:

Given the SVG code below, make the following modifications to the SVG structure:

- Rotate the entire image 45 degrees counter-clockwise around its center.
- Change the background color (assuming there's a background element like a `<rect>`) to teal. If no background exists, add one covering the viewBox.

SVG:

Algorithm & Problem Solving

Algorithm Suggestion

One thing that I personally love using AI models for is helping me figure out an appropriate algorithm to solve a problem. Often, the solution I’m considering can be implemented more efficiently using an established algorithm optimized for that kind of task.

In these situations, I don’t ask the model for complete code, but rather to suggest suitable algorithms and data structures based on the problem specification.

A prompt for this use case might look like this:

Problem: We need to build a system that efficiently processes a large stream of log entries. Each log entry is a string with a specific format: `[timestamp] [log_level] [component] [message]`. We need to be able to filter these log entries based on multiple criteria (e.g., timestamp range, specific log levels, originating component, keywords in the message) and output the matching entries in chronological order.

Desired Solution Approach: We envision a pipeline where incoming log entries are parsed and then passed through a series of filter stages. Each filter stage checks a specific criterion. Log entries passing all active filters will be collected and sorted by timestamp before output.

Prompt: Given this desired solution approach, please suggest established algorithms and data structures suitable for the following parts of the process within a Java application:

1. Parsing: Efficiently parsing log entry strings to extract fields.
2. Filtering: Implementing filter stages for various criteria (timestamp, level, component, keywords). How to handle multiple active filters efficiently?
3. Storage: Temporarily storing filtered log entries before sorting.
4. Sorting: Sorting collected log entries chronologically by timestamp.
5. Streaming: Handling a continuous stream of log entries efficiently (non-blocking if possible).

For each suggestion, briefly explain its core principle and why it's well-suited for that part of the pipeline. Focus on algorithmic/data structure suggestions, not full code.

Approach Enhancement

Similarly, you can describe your current approach to solving a problem and ask the AI for alternative methods that might be more efficient or scalable.

A prompt for this use case:

Our current approach to calculating user risk scores involves processing a batch of user records sequentially. For each user:

1. Initialize score to zero.
2. Iterate through a predefined set of risk rules.
3. For each rule, check if the user's attributes meet the rule's conditions.
4. If conditions are met, update the user's score based on the rule's weight/logic.
5. The final score is determined after checking all rules for that user.
6. Repeat for all users.

This means every user is evaluated against every rule individually.

Given this algorithm, what are alternative algorithmic approaches or data structures that could improve efficiency, especially considering scalability as the number of users and rules grows?

Please suggest alternatives (e.g., rule engines, data-driven evaluation, parallelization, optimized data structures for rules/users), explaining how they might offer performance benefits over the described sequential approach. Focus on high-level concepts and their potential efficiency gains.

Closing Thoughts

AI is a powerful tool for enhancing the productivity of professionals across various fields. Based on my personal experience, I don’t believe current AI models are capable of replacing all aspects of an employee’s responsibilities. Rather, they serve as excellent resources that can significantly cut down the time required for various tasks, freeing up professionals to focus on more complex, creative, or strategic work.

This post highlighted various ways I’ve used these models to boost my own productivity, and I hope it serves as a helpful guide for other developers looking to leverage these tools effectively.

Related Posts

Unlock your potential with the Structured Ambition Framework. This guide shows you how to transform big dreams into actionable plans using Obsidian, helping you set yearly visions, break them down into manageable tasks, and maintain consistency through journaling and reflection.

Read More

Understanding the interplay between technical and business goals is crucial for software developers. This blog discussed how business-driven decisions may seem technically illogical but often aim to balance organizational efficiency, resource management, and value creation.

Read More

Struggling with problem-solving as a developer? This post dives into common pitfalls and shares practical approaches to help you tackle challenges more effectively

Read More