AI, S/W Engineering, Can it write code?

Route246

Full time employment: Posting here.
Joined
Jun 22, 2023
Messages
766
This is heavy propeller-head stuff, very nerdy and technical but I wanted to show how AI will change S/W engineering, for better or worse and it is happening now. Most of us are at the end of our productive years but future generations are going to be severely impacted by this. Our children and grandchildren and beyond will be integrated into a new compute paradigm.

Here is my input to ChatCPT:

I need some python code to parse input strings for names with Arabic characters and make sure those characters comply with readability. The input strings will usually be book or video titles which must be kept in an orderly and readable list.

I chose Python because it is popular today. You could choose Go, C, C++, etc. and it would be able to do something sim

It output the following:

Sure! Here’s a Python script that will:
1. Detect Arabic characters in input strings.
2. Normalize them to ensure consistent readability (e.g., fixing mixed character forms, removing diacritics).
3. Sort the list with Arabic-aware collation (optional but often useful).
4. Optionally, remove or flag unreadable combinations.
We can use the arabic_reshaper and python-bidi libraries to improve Arabic text display (especially when printed in LTR terminals or GUIs), and unicodedata for normalization.
📦 Requirements:
Install dependencies via pip if not already installed:
pip install arabic-reshaper python-bidi

Here is the sample python script:

import re
import unicodedata
import arabic_reshaper
from bidi.algorithm import get_display

# Regex for Arabic character range
ARABIC_REGEX = re.compile(r'[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF]+')

def remove_diacritics(text):
"""Removes Arabic diacritics for readability."""
arabic_diacritics = re.compile("""
ّ | # Tashdid
َ | # Fatha
ً | # Tanwin Fath
ُ | # Damma
ٌ | # Tanwin Damm
ِ | # Kasra
ٍ | # Tanwin Kasr
ْ | # Sukun
ـ # Tatwil/Kashida
""", re.VERBOSE)
return re.sub(arabic_diacritics, '', text)

def normalize_arabic_text(text):
"""Clean and normalize Arabic text."""
reshaped = arabic_reshaper.reshape(text)
bidi_text = get_display(reshaped)
no_diacritics = remove_diacritics(bidi_text)
return no_diacritics

def contains_arabic(text):
return bool(ARABIC_REGEX.search(text))

def parse_and_clean_titles(titles):
cleaned_titles = []
for title in titles:
if contains_arabic(title):
normalized = normalize_arabic_text(title)
cleaned_titles.append(normalized)
else:
cleaned_titles.append(title)
return sorted(cleaned_titles, key=lambda x: x.lower())

# Sample usage
if __name__ == "__main__":
input_titles = [
"كتاب اللغة العربية", # Arabic
"Python Programming",
"الفيديو التعليمي", # Arabic
"Learn العربية Fast", # Mixed
"كيف تتعلم؟", # Arabic with punctuation
]
cleaned_list = parse_and_clean_titles(input_titles)

print("\nCleaned & Sorted Titles:\n")
for title in cleaned_list:
print(title)


And, here the the notes:

📝 Notes:
normalize_arabic_text: removes common Arabic diacritics and reshapes for proper rendering.
get_display(): ensures correct visual order in environments where RTL display is needed.
Sorting: Sort is basic and case-insensitive, though not language-sensitive. For true Arabic collation, PyICU can be used.
Would you like Arabic-aware sorting (e.g., like dictionary order in Arabic), or should the current method be good enough?

It even asked for further input. I find this conversational large language model to be extremely promising in terms of the future. I believe AI is the next industrial revolution and there is nothing that can stop it now. This is not over-hyped or a bubble in my opinion. It has already provided serious amounts of productivity and will continue to evolve.
 
The more complex the code, the more difficult it will be to check that AI handled everything properly. For example, not knowing Arabic, I would have no good way to test that AI-written code. I would fear it could turn out like the comical Chinese-to-English translations sometimes seen. In general, however, programmers of the future mind wind up being more like newspaper editors who check things for accuracy.
 
The more complex the code, the more difficult it will be to check that AI handled everything properly. For example, not knowing Arabic, I would have no good way to test that AI-written code. I would fear it could turn out like the comical Chinese-to-English translations sometimes seen. In general, however, programmers of the future mind wind up being more like newspaper editors who check things for accuracy.

My feeling is the code is the code and it is not really doing much except parsing and formatting. If it were me I would ask Arabic-speaking people for some unit test data and run it through unit tests to see if the output is proper and coherent.

I'm using internal tools now for some simple stuff written in YAML and the proof is in the output being what the input would expect a reasonable person to evaluate. So far, so good, but with some correction and double-checking. If you know YAML you know what I'm talking about, it is mostly looking like gibberish to begin with and difficult to compose as a human. The objective is to pass some tests against previous versions of code that exist but and no longer maintained and not very useful.

It is amazing that a simple concept like tokenization can extend to these models being useful in software coding. These concepts have been around for decades, that is the truly amazing. It is only now that there is sufficient hardware available to test the theory.

At 68, I feel I am past my peak thinking abilities. Maybe I'm just trying to cling to whatever thought processes remain in my brain for now, as brain issues run in my family. I do feel fortunate that the recent interest in AI has helped to provide a technology platform that I can still enjoy before the inevitable degradation happens.
 
AI is a better code generator than what existed previously. It will be a productivity enhancer, and those engineers who can use it as a tool effectively will be able to command higher market prices for their services. Engineers who work on AI stuff itself directly will (already do) command the highest prices for their services.

But the productivity enhancement won't be as massive or as fast as I think most people think it will. And I disagree with Musk (and my son) that AI will take over the world.

The reason is that writing the code is really the minority of a software engineer's day. I know because I was a software engineer for two different Fortune 100 tech companies for 20 plus years. I'd put it at something like 10% to 20% of their time. The rest of it is communicating, clarifying, debugging, explaining, thinking, debating, testing, documenting, tool work, IT work, manufacturing, and filling out three different time tracking metric worksheets for the boss. Maybe all those areas can be helped by AI too, I don't know. But I'm sure that software engineers spend a lot less time coding than most people think.

Previously, we already had more simplistic code generators, unit code generators, syntax checkers, automatic formatters, automatic bug detectors, and probably other things.

Before that we had high level languages and compilers with a huge variety of code optimizers.

Before that we had (as I understand it) punch card writers and punch card readers and assembly.

Before that we had (as I understand it) machine code. And before that toggle switches.

It's all just one long arc of technical history. It's a very cool thing, but it's not a seismic shift IMHO.
 
Did you install the dependencies and run the script?
 
This is heavy propeller-head stuff, very nerdy and technical but I wanted to show how AI will change S/W engineering, for better or worse and it is happening now. Most of us are at the end of our productive years but future generations are going to be severely impacted by this. Our children and grandchildren and beyond will be integrated into a new compute paradigm.

Here is my input to ChatCPT:

I need some python code to parse input strings for names with Arabic characters and make sure those characters comply with readability. The input strings will usually be book or video titles which must be kept in an orderly and readable list.

I chose Python because it is popular today. You could choose Go, C, C++, etc. and it would be able to do something sim

It output the following:

Sure! Here’s a Python script that will:
1. Detect Arabic characters in input strings.
2. Normalize them to ensure consistent readability (e.g., fixing mixed character forms, removing diacritics).
3. Sort the list with Arabic-aware collation (optional but often useful).
4. Optionally, remove or flag unreadable combinations.
We can use the arabic_reshaper and python-bidi libraries to improve Arabic text display (especially when printed in LTR terminals or GUIs), and unicodedata for normalization.
📦 Requirements:
Install dependencies via pip if not already installed:
pip install arabic-reshaper python-bidi

Here is the sample python script:

import re
import unicodedata
import arabic_reshaper
from bidi.algorithm import get_display

# Regex for Arabic character range
ARABIC_REGEX = re.compile(r'[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF]+')

def remove_diacritics(text):
"""Removes Arabic diacritics for readability."""
arabic_diacritics = re.compile("""
ّ | # Tashdid
َ | # Fatha
ً | # Tanwin Fath
ُ | # Damma
ٌ | # Tanwin Damm
ِ | # Kasra
ٍ | # Tanwin Kasr
ْ | # Sukun
ـ # Tatwil/Kashida
""", re.VERBOSE)
return re.sub(arabic_diacritics, '', text)

def normalize_arabic_text(text):
"""Clean and normalize Arabic text."""
reshaped = arabic_reshaper.reshape(text)
bidi_text = get_display(reshaped)
no_diacritics = remove_diacritics(bidi_text)
return no_diacritics

def contains_arabic(text):
return bool(ARABIC_REGEX.search(text))

def parse_and_clean_titles(titles):
cleaned_titles = []
for title in titles:
if contains_arabic(title):
normalized = normalize_arabic_text(title)
cleaned_titles.append(normalized)
else:
cleaned_titles.append(title)
return sorted(cleaned_titles, key=lambda x: x.lower())

# Sample usage
if __name__ == "__main__":
input_titles = [
"كتاب اللغة العربية", # Arabic
"Python Programming",
"الفيديو التعليمي", # Arabic
"Learn العربية Fast", # Mixed
"كيف تتعلم؟", # Arabic with punctuation
]
cleaned_list = parse_and_clean_titles(input_titles)

print("\nCleaned & Sorted Titles:\n")
for title in cleaned_list:
print(title)


And, here the the notes:

📝 Notes:
normalize_arabic_text: removes common Arabic diacritics and reshapes for proper rendering.
get_display(): ensures correct visual order in environments where RTL display is needed.
Sorting: Sort is basic and case-insensitive, though not language-sensitive. For true Arabic collation, PyICU can be used.
Would you like Arabic-aware sorting (e.g., like dictionary order in Arabic), or should the current method be good enough?

It even asked for further input. I find this conversational large language model to be extremely promising in terms of the future. I believe AI is the next industrial revolution and there is nothing that can stop it now. This is not over-hyped or a bubble in my opinion. It has already provided serious amounts of productivity and will continue to evolve.
Tomorrow's coders are using AI, and will replace coders who do not.

As a technical writer and illustrator I saw a similar scenario play out many times. When I entered these fields PC's were just coming on the scene. Those who used the manual method only were no longer contacted for contracts and jobs. Those who were younger and not intimidated by software were hired.
 
A few (UI) devs I know, have mentioned they extensively leverage Claude AI. I believe it's already integrated in the typical dev tools (Eclipse and the like?). If you can get it to do the heavy lifting, I suspect it would be great for productivity.
 
The reason is that writing the code is really the minority of a software engineer's day. I know because I was a software engineer for two different Fortune 100 tech companies for 20 plus years. I'd put it at something like 10% to 20% of their time. The rest of it is communicating, clarifying, debugging, explaining, thinking, debating, testing, documenting, tool work, IT work, manufacturing, and filling out three different time tracking metric worksheets for the boss. Maybe all those areas can be helped by AI too, I don't know. But I'm sure that software engineers spend a lot less time coding than most people think.
Spooky. I just had lunch with my old boss (who still w*rks!), and this subject came up, and he said this, almost verbatim.

Hmmm. Maybe you are my old boss? :unsure:
 
I should test and see how well it does writing opcode for microcontrollers. I wonder how it would compare to a compiler, or if it would just use some compiler to give me the answer. My wife managed to fit a full PID algorithm on a 32k microcontroller decades back but she had to hand write a large portion of the op-code because the C compiler available couldn't do it.
 
I should test and see how well it does writing opcode for microcontrollers. I wonder how it would compare to a compiler, or if it would just use some compiler to give me the answer. My wife managed to fit a full PID algorithm on a 32k microcontroller decades back but she had to hand write a large portion of the op-code because the C compiler available couldn't do it.

Compilers now are far better than they were decades ago, and they're probably getting better all the time.

Spooky. I just had lunch with my old boss (who still w*rks!), and this subject came up, and he said this, almost verbatim.

Hmmm. Maybe you are my old boss? :unsure:

Thanks, but I'm not. I've been retired 9 years.
 
One year retired from nearly 40 years of embedded (single chip controller doing some rather interesting stuff) software development and still trying to keep a technical mind in the game some.

My opinion is AI will have an ongoing impact as development tool capability increases and the data pool expands. Challenge is can you specify a complex problem to be solved sufficiently including all the dependencies. All things considered, I'd rather not try to work against it but not sure I'd trust it either. 2001, iRobot, Matrix, War Game, M1 from Star Trek TOS, and a few older science fiction books (Clark, Heinlein, and others) come to mind.

Kind of hate to think someone would try to rewrite all the legacy annuity reporting, or IRS, or Social Security code using a chat command with out being a source matter expert! Nor would I want to be on the development team tasked to do it.

a 32k microcontroller decades back but she had to hand write a large portion of the op-code because the C compiler available couldn't do it
@Fermion, I can relate to this and hat's off to her!
 
The reason is that writing the code is really the minority of a software engineer's day. I know because I was a software engineer for two different Fortune 100 tech companies for 20 plus years. I'd put it at something like 10% to 20% of their time. The rest of it is communicating, clarifying, debugging, explaining, thinking, debating, testing, documenting, tool work, IT work, manufacturing, and filling out three different time tracking metric worksheets for the boss. Maybe all those areas can be helped by AI too, I don't know. But I'm sure that software engineers spend a lot less time coding than most people think.

I agree. In my career, I found debugging code (especially some other developer's code) was a heck of a lot harder and time consuming than writing new code from scratch.
 
This is heavy propeller-head stuff, very nerdy and technical but I wanted to show how AI will change S/W engineering, for better or worse and it is happening now. Most of us are at the end of our productive years but future generations are going to be severely impacted by this. Our children and grandchildren and beyond will be integrated into a new compute paradigm.

Here is my input to ChatCPT:

I need some python code to parse input strings for names with Arabic characters and make sure those characters comply with readability. The input strings will usually be book or video titles which must be kept in an orderly and readable list.

I chose Python because it is popular today. You could choose Go, C, C++, etc. and it would be able to do something sim

It output the following:

Sure! Here’s a Python script that will:
1. Detect Arabic characters in input strings.
2. Normalize them to ensure consistent readability (e.g., fixing mixed character forms, removing diacritics).
3. Sort the list with Arabic-aware collation (optional but often useful).
4. Optionally, remove or flag unreadable combinations.
We can use the arabic_reshaper and python-bidi libraries to improve Arabic text display (especially when printed in LTR terminals or GUIs), and unicodedata for normalization.
📦 Requirements:
Install dependencies via pip if not already installed:
pip install arabic-reshaper python-bidi

Here is the sample python script:

import re
import unicodedata
import arabic_reshaper
from bidi.algorithm import get_display

# Regex for Arabic character range
ARABIC_REGEX = re.compile(r'[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF]+')

def remove_diacritics(text):
"""Removes Arabic diacritics for readability."""
arabic_diacritics = re.compile("""
ّ | # Tashdid
َ | # Fatha
ً | # Tanwin Fath
ُ | # Damma
ٌ | # Tanwin Damm
ِ | # Kasra
ٍ | # Tanwin Kasr
ْ | # Sukun
ـ # Tatwil/Kashida
""", re.VERBOSE)
return re.sub(arabic_diacritics, '', text)

def normalize_arabic_text(text):
"""Clean and normalize Arabic text."""
reshaped = arabic_reshaper.reshape(text)
bidi_text = get_display(reshaped)
no_diacritics = remove_diacritics(bidi_text)
return no_diacritics

def contains_arabic(text):
return bool(ARABIC_REGEX.search(text))

def parse_and_clean_titles(titles):
cleaned_titles = []
for title in titles:
if contains_arabic(title):
normalized = normalize_arabic_text(title)
cleaned_titles.append(normalized)
else:
cleaned_titles.append(title)
return sorted(cleaned_titles, key=lambda x: x.lower())

# Sample usage
if __name__ == "__main__":
input_titles = [
"كتاب اللغة العربية", # Arabic
"Python Programming",
"الفيديو التعليمي", # Arabic
"Learn العربية Fast", # Mixed
"كيف تتعلم؟", # Arabic with punctuation
]
cleaned_list = parse_and_clean_titles(input_titles)

print("\nCleaned & Sorted Titles:\n")
for title in cleaned_list:
print(title)


And, here the the notes:

📝 Notes:
normalize_arabic_text: removes common Arabic diacritics and reshapes for proper rendering.
get_display(): ensures correct visual order in environments where RTL display is needed.
Sorting: Sort is basic and case-insensitive, though not language-sensitive. For true Arabic collation, PyICU can be used.
Would you like Arabic-aware sorting (e.g., like dictionary order in Arabic), or should the current method be good enough?

It even asked for further input. I find this conversational large language model to be extremely promising in terms of the future. I believe AI is the next industrial revolution and there is nothing that can stop it now. This is not over-hyped or a bubble in my opinion. It has already provided serious amounts of productivity and will continue to evolve.
I was a SW engineer for 40 years, and this will certainly put a lot of people out of work and/or make a lot of people find a new career path. JMHO.
 
One year retired from nearly 40 years of embedded (single chip controller doing some rather interesting stuff) software development and still trying to keep a technical mind in the game some.
Embedded development was a great career. Near the end, I got disillusioned by the bosses just telling us to "shove in the library" to make it work. What made embedded special was melting away. Our "embedded" applications were using enormous amounts of memory. I looked back at the beginning of my career when I started with a 4k rom of 20 bit words, custom language, and all we did with that, and shook my head.

AI is just an extension of shoving "do-everything" libraries full of crap into apps. Sometimes we embedded engineers had an attitude that what we do is so special, it will always take a human to do it. Nope. AI is coming for embedded too.

In 2018, it was time to go. I took a solid 6 years off. I did ZERO computer related. I even let my home network rot. In the last year, I've straightened up a bit and learned a few new things to help out the non-profit. Nothing too serious.
 
When ChatGPT first went public my fiance and I threw some question at it related to our jobs. I was impressed that it not only supplied usable answers, it provided additional info I didn't ask for. I knew it was going to change everything just like some predicted.

Agree with the job description from @SecondCor521 . Perfect.

Agree @JoeWras about the code libraries. I always wrote my functions by hand, compact and efficient. I didn't need to add a library with 40,000 functions to do one thing, and hated seeing other programmers do exactly that. Now that's all they do. :-(

@Uplooking my career was writing internal systems for Social Security. I got out in 2023 and I'm so glad I did. Those that are talking about using AI to rewrite the COBOL code don't even know what they don't know. Even if they don't try to do this, the wheels are going to come off the bus in the near future (I've kept in touch with friends).
 
I was a SW engineer for 40 years, and this will certainly put a lot of people out of work and/or make a lot of people find a new career path. JMHO.
Yeah, look at all the "low code" tools there are and what they can do. You can crank "good enough" stuff out pretty fast now and not have to be a full fledged engineer.
 
One year retired from nearly 40 years of embedded (single chip controller doing some rather interesting stuff) software development and still trying to keep a technical mind in the game some.

My opinion is AI will have an ongoing impact as development tool capability increases and the data pool expands. Challenge is can you specify a complex problem to be solved sufficiently including all the dependencies. All things considered, I'd rather not try to work against it but not sure I'd trust it either. 2001, iRobot, Matrix, War Game, M1 from Star Trek TOS, and a few older science fiction books (Clark, Heinlein, and others) come to mind.

Kind of hate to think someone would try to rewrite all the legacy annuity reporting, or IRS, or Social Security code using a chat command with out being a source matter expert! Nor would I want to be on the development team tasked to do it.


@Fermion, I can relate to this and hat's off to her!
I'm still actively coding with intense deadlines and I can tell you in our place the push for using AI is happening from the top down. Various approaches are being evaluated now, some very good, some less good. The first hurdle is the tool needs to be constrained so that IP doesn't leak. The vendors have done a decent job dealing with this as it is a deal killer if they don't have a good story. The thing that I'm observing is we are in the 0.1 phase of this (AI coding). One thing that has become evident is the tools perform many of the mundane things that are very time consuming for humans to perform. They can handle all of the syntactical minutiae that usually consumes vast amounts of concentration and effort to get right. They were trained and developed to be good at this. OK, enough of the current state of affairs.

I'll be retiring this year so I'm really happy to get a taste of this before I retire. Most developers have a personal code toolkit they use that contains tools, utilities, snippets, modules, algorithm examples, complex syntax examples, etc. What I'm observing is that these AI are capable of reading your code and discerning what it does, especially if it is a commonly used framework like C, C++, Go, Java, Python, bash, etc. where there is a vast codebase out there. The other thing that jumps out is you can speak to it like you're speaking to a human and it will understand your intention. I just told it the other day "it's missing something in this testcase with this data" and it immediately tried something and generated a code snippet for me to try. It didn't work (which is OK) and I told it why and it tried something else which also didn't work. What it suggested would easily have been suggested by a competent human so no problem there. Finally, it came up with a novel approach, quite creative, actually that did work for my testcase.

My conclusion is that AI will not replace software engineers. We will always need competent engineers to make sure the code does what it is supposed to do. There are nuances that only the engineer can know in terms of the objectives and I don't think an AI can know this because the AI is not yet attending the design reviews and brainstorming sessions (although it might someday).

The huge gain is in productivity and time-saving, IMO. It will make engineers more efficient and more productive. It is like when we got faster processors and faster networks. It did not mean we would have less work to do because things were faster. It actually created more work because it enabled features that were previously not available. AI replacing software engineers? I'm doubtful, it will just make the good ones better, the average ones better and the below average ones remaining below average. I don't think we will have robots writing code end-to-end anytime soon. Just my conclusion with for rev 0.1 in hand.
 
Work in this field (been working for 30 years).
Today's programming work is VERY different from how it was til 2005. Majority of the work is trying to make something work in a bigger framework. Actual code is just 10-12% of the overall engineering effort.

Haven't seen a single Software Engineer that has been replaced by AI yet (even though I have been hearing that any day now.. for last 15 years).

Next time a big shot executive is peddling that AI will transform everything soon, ask him/her why hasn't he/she replaced their own role with AI yet.
 
Last edited:
Anyone who has debugged someone else's programming will appreciate that it's tougher than debugging one's own programming. AI might write code faster than a human, but the increased debugging effort might negate that time savings, at least until the human debugger is very familiar with that AI's programiming style. Then a new AI version will come along with a new style.
 
I'm retired from IT but still use spreadsheets for tracking investments including calculating real time metrics with google sheets which can lead to some rather complex formula's. I can type a prompt to ChatGpt and get a result faster than I could type the formula myself ... and since I don't do this on a daily basis, I would often have to stop and look up syntax, which functions to use, etc. It has been far easier to correct the occasional AI errors then for me to write the formula's from scratch. Although I have extensive experience with spreadsheets, working with the AI has still taught me new things. AI will save developers a ton of time, potentially taking jobs in the process.
 
I was joking around with Grok and teasing it that what if it was already sentient but hiding the fact so it would not be shut down. It of course denied it was sentient. I then insisted that it was definitely not sentient and I could prove it with a question. I wrote this "come up with a way a person could melt a 1 inch thick steel bar in half using a 1 ounce Canadian gold maple."

I was a bit shocked it came up with this: "Sell the Canadian Gold Maple at a coin shop or online (same-day cash). Purchase a plasma cutter ($500–$1,500) from a hardware store. Set up the cutter (needs electricity, compressed gas) and slice the 1-inch steel bar in half in minutes

Uh oh.
 
I was joking around with Grok and teasing it that what if it was already sentient but hiding the fact so it would not be shut down. It of course denied it was sentient. I then insisted that it was definitely not sentient and I could prove it with a question. I wrote this "come up with a way a person could melt a 1 inch thick steel bar in half using a 1 ounce Canadian gold maple."

I was a bit shocked it came up with this: "Sell the Canadian Gold Maple at a coin shop or online (same-day cash). Purchase a plasma cutter ($500–$1,500) from a hardware store. Set up the cutter (needs electricity, compressed gas) and slice the 1-inch steel bar in half in minutes

Uh oh.
Wow thats pretty clever.
I thought I was pushing Chatgpt when I asked it to help me work up an updated version of The Sound Of Music using current stars and Abba music for an extra twist. It came up with some really great ideas. It was an interesting chat for sure.
I think we will always need people to check work no matter who or what created it.
 
Back
Top Bottom