As us developers are learning new languages and overcoming problems, preparing for board exams, and competetive exams, another danger, which in itself is something that gives every single programmers in their nights sleep, is slowly gaining power.

Well, it is not Sauron from Lord of the Rings or Lord Voldemort from Harry Potter, it is AI from well: the programming world. But is AI a big problem now? Or it is something that can be avoided? That is what we will discuss now.

Well, as we know, and this is for sure, AI can code. But the question is, can it solve problems? Can it, in the coming period replace software engineers and programmers? Lets try using statistics. Lets take a pretty easy problem: finding the output but with a twist. So, this is a pretty easy code to find the output of:

The code is:
System.out.println("Hi " + "my name is " + "arjan")

Lets see how different AI's respond to this.
Chat Gpt:
Hi my name isarjan
Gemini AI:
Hi my name isarjan

As we can see, AI can understand code, and run it to find the output, but evidently, it does not have interview level or for that matter even basic level skills. If you look closely, there is no semicolon at the end of the code, making it impossible to be run. A JAVA compiler would show this:

ERROR!
`

`
Main.java:6: error: ';' expected
System.out.println("Hi " + "my name is " + "arjan")
^
1 error

=== Code Exited With Errors ===
`
`
This excerpt has been taken from Programiz online compiler.

So, as we can see, AI is definitely flawed. But a good programmer would have noticed the flaw right away. If someone was to feed that in an interview, and the other guy punch it into ai, rejection letters not so far from your house my friend! But what about Artificial Intelligence's problem solving skills? We shall see that. Lets take a very simple problem:
Check whether a number is a perfct number or not. We shall take samples from Chat GPT, Gemini AI, and one of the best programming AI, Blackbox AI.
Results:
**_Chat GPT:

`import java.util.Scanner;

public class PerfectNumber {
    // Method to check if the number is perfect
    public static boolean isPerfectNumber(int number) {
        int sum = 0;

        // Find divisors and calculate the sum of divisors
        for (int i = 1; i <= number / 2; i++) {
            if (number % i == 0) {
                sum += i;
            }
        }

        // If the sum of divisors equals the number, it's a perfect number
        return sum == number;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Ask user for input
        System.out.print("Enter a number: ");
        int number = scanner.nextInt();

        // Check if the number is perfect
        if (isPerfectNumber(number)) {
            System.out.println(number + " is a perfect number.");
        } else {
            System.out.println(number + " is not a perfect number.");
        }

        scanner.close();
    }
}`

Result: The code works.

Gemini AI:

`import java.util.Scanner;

public class PerfectNumberChecker {

    // Function to check if a number is a perfect number
    public static boolean isPerfectNumber(int number) {
        // A perfect number is a positive integer that is equal to the sum of its proper divisors
        // (excluding the number itself).
        if (number <= 1) {
            return false; // 1 and numbers less than 1 are not perfect numbers
        }

        int sum = 1; // Initialize sum with 1 because 1 is a divisor of every number
        // Iterate from 2 up to the square root of the number.  This optimization
        // is based on the fact that if 'i' is a divisor of 'number', then
        // 'number/i' is also a divisor.  We only need to iterate up to the square root
        // to find all divisor pairs.
        for (int i = 2; i * i <= number; i++) {
            if (number % i == 0) {
                if (i * i == number) {
                    sum += i; // If i is the square root, add it only once
                } else {
                    sum += i + (number / i); // Otherwise add both i and number/i
                }
            }
        }

        return sum == number; // Check if the sum of divisors equals the number
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter a number: ");
        int num = scanner.nextInt(); // Get the number from the user

        // Check if the number is a perfect number and print the result
        if (isPerfectNumber(num)) {
            System.out.println(num + " is a perfect number.");
        } else {
            System.out.println(num + " is not a perfect number.");
        }

        scanner.close(); // Close the scanner to prevent resource leaks.  Good practice!
    }
}`

Results:
This code works as well.

Blackbox AI:

import java.util.Scanner;

public class PerfectNumberChecker {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter a positive integer: ");
        int number = scanner.nextInt();

        if (isPerfectNumber(number)) {
            System.out.println(number + " is a perfect number.");
        } else {
            System.out.println(number + " is not a perfect number.");
        }

        scanner.close();
    }

    public static boolean isPerfectNumber(int num) {
        if (num <= 0) {
            return false; // Perfect numbers are positive integers
        }

        int sum = 0;

        // Find all divisors and sum them
        for (int i = 1; i <= num / 2; i++) {
            if (num % i == 0) {
                sum += i;
            }
        }

        // Check if the sum of divisors equals the number
        return sum == num;
    }
}

Results:
Works

Now, if we see the code, they are nothing but huge chunks of code. Yes, they work, yes they take input by the terminal, but this is surely, and evidently, not the simplest or the fastest way to solve this problem. So, Yes, Artificial Intelligence, can ofcourse solve problems, but evidently it cannot devise effective solutions for the problem, which is one of the important characteristics of A programmer. Also, one of the most important characteristic difference between a programmer and Artificial Intelligence is work pressure, and the time taken to complete work. We have seen CEO's of companies say AI will replace humans because of their advantage in that field. But that lies in vain, if the problem is itself not solved in an efficient way. This leads me to believe that Artificial Intelligence is not yet ready to overtake humans... but still not far behind.

The truth is, by the time Artificial Intelligence at the current time is not yet advanced to the level by which it can succeed humans in programming and problem solving. AI has a long way to go, and till then, who knows humans themselves might be developed enough to be better.