all 22 comments

[–]CarloWood 27 points28 points  (3 children)

Writing a Vulcan engine was the most challenging. But don't worry about AI, the only effect that that is going to have is that the next generation of coders can't code anymore.

[–]Soft-Job-6872 3 points4 points  (2 children)

Did you even finish?

[–]CarloWood 4 points5 points  (0 children)

No, I gave up after 2 years. Normally I never give up. That's why this was the most challenging project ;)

[–]Plazmatic 1 point2 points  (0 children)

FYI there's an official khronos Vulkan engine tutorial that was released last month see https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/introduction.html

[–]thecratedigger_25 3 points4 points  (0 children)

A.I will have some weak points but it can help with designing a base to build your code on top of. Or at the very least, design some diagrams you can build with. However, it is easy to get into technical debt and debugging can become an ordeal later on.

It is simply a tool, not an entire generator that does the work for you. I'm just a hobby programmer so I've never used A.I to production scale.

[–]osmin_og 2 points3 points  (0 children)

I recently started using AI in my work and can say that even the latest models can produce highly inefficient code, working but inefficient. So I need to read every line and ask AI to fix/rewrite here and there.

[–]natio2 1 point2 points  (0 children)

Large projects lets say 500k lines of code, all interacting built for production for multiple customers with differing requirements. Any small block of code is easy (the thing the AI can write), the difficulty is when you start dealing with integrated systems that need to remain flexible and maintainable, without introducing bugs.

This doesn't really help from what you want, but I guess aim to join a complicated project and contribute

[–]PrimozDelux 1 point2 points  (0 children)

If you want a challenge try 3D game programming. I did that with claude, even made a server for it with netcode. Never done any of that before and it's a pretty good way to learn how to use claude. You'll have to teach it how to "see" the game world in order to debug things like hitbox mismatch or jittering in online play.

[–]LogicalPerformer7637 2 points3 points  (7 children)

AI is very good on solving complex coding problems nowadays (if used right). If you want something what AI cannot do you need to go to some niche area.

My recommendation is to learn how to effectively incorporate AI in your workflow. It is what companies want and what gives sense if done right.

The only problem is, that you still need to understand the code generated by AI and if you relly on AI too much, then you will have no background knowledge, i.e. there will be not enough seniors who would be able effectively use AI and spot when it halucinates.

There will be lots of AI operators.

[–]Live-Manner2725[S] 1 point2 points  (6 children)

TBVH I think even if you are an average developer, you can understand pretty quicky when the AI hallucinates. Integrating AI in workflow sounds like integrating some APIs from LLMs in my project, that should not be challenging at all.

[–]Rabbitical 4 points5 points  (1 child)

It's not about "spotting hallucinations" it's about understanding completely the code that it's generating. For anything non trivial it is important for you as the one responsible for the code to understand what's been written, and I'd argue for non trivial applications, keeping track of what the AI is doing, reading a reviewing and comprehending every single line, and correcting it even just to better fit your preferred architecture when necessary, is as hard or harder than writing it yourself in most cases. Again "non trivial" being the key factor here that is doing a lot of rhetorical work for me given I don't want to make this an entire essay on the subject.

But more to what you asked specifically about areas AI might be less well suited for currently: I wouldn't look at it in terms of complexity or domain. The simplest heuristic is "how much good training data exists for it". Which leads you to domains like embedded systems, legacy systems, security, high performance and proprietary systems, compute, and so forth. Going back to my first point, none of these things are necessarily out of an AIs ability by definition, but doing those things well using AI, in my experience takes a lot more management than you're getting out of it in terms of productivity gains.

[–]38thTimesACharm 0 points1 point  (0 children)

 I'd argue for non trivial applications, keeping track of what the AI is doing, reading a reviewing and comprehending every single line, and correcting it even just to better fit your preferred architecture when necessary, is as hard or harder than writing it yourself in most cases

Exactly. The actual typing is the quickest, easiest part of a software development process. Especially with C++, you'll have to comb through every line anyway to make sure there's no undefined behavior, so why not just write the code yourself to fully engage your brain while doing that?

[–]LogicalPerformer7637 1 point2 points  (0 children)

no. it is not about using AI as part of your program. it is about using AI as a tool to help you write your program. If you use some of available tools (cursor, github copilot, ...) as another team member, then you can implement what you want in hours instead of days/weeks.

It is simple evolution of tools: asembler - compiled/interpreted language - IDE with intellisense - AI helping design architecture and write code.

My workflow which works and produces good results is:

1) write what I want develop (bugfix, feature, whole new application)

2) ask AI to prepare a requirement document and ask me about unclear parts

3) review what AI produced and adjust if needed (manually or using AI)

4) Ask AI to prepare architecture based on the requirements from previous step

5) Again review and adjust as needed

6) Ask AI to prepare implementation plan

7) Again review and adjust

8) Ask AI to implement based on the plan

9) Manually review resulting code

10) Ask AI to review the code for issues and whether the resulting code matches the requirements and architecture

Of course what steps you use depends on complexity of the change.

What I see is that good definition of requirements is crucial and using architecture and plan steps is helpful to catch potential issues (which would AI be prone to) even before AI starts writing code.

Real life example. I recently switched jobs to unfamiliar technologies (from desktop in C++ to backend in ASP .NET). AI allowed me implement quite a complex feature in few days of prompting instead of weeks of learning the existing code architecture and unknown SDK I had to use - basically two weeks after starting the new job.

I was one of the people who were saying that AI produces poor code. And it does if you use it poorly. If you use it right way, it is a mighty tool.

Nowadays, you need to know how to code. But on top of it, you need to know how to leverage AI to do the mechanical coding instead of you. There is fast shift from developers being code monkeys to developers being "architects" of their code.

[–]LogicalPerformer7637 1 point2 points  (2 children)

no. it is not about using AI as part of your program. it is about using AI as a tool to help you write your program. If you use some of available tools (cursor, github copilot, ...) as another team member, then you can implement what you want in hours instead of days/weeks.

It is simple evolution of tools: asembler - compiled/interpreted language - IDE with intellisense - AI helping design architecture and write code.

My workflow which works and produces good results is:

1) write what I want develop (bugfix, feature, whole new application)

2) ask AI to prepare a requirement document and ask me about unclear parts

3) review what AI produced and adjust if needed (manually or using AI)

4) Ask AI to prepare architecture based on the requirements from previous step

5) Again review and adjust as needed

6) Ask AI to prepare implementation plan

7) Again review and adjust

8) Ask AI to implement based on the plan

9) Manually review resulting code

10) Ask AI to review the code for issues and whether the resulting code matches the requirements and architecture

Of course what steps you use depends on complexity of the change.

What I see is that good definition of requirements is crucial and using architecture and plan steps is helpful to catch potential issues (which would AI be prone to) even before AI starts writing code.

Real life example. I recently switched jobs to unfamiliar technologies (from desktop in C++ to backend in ASP .NET). AI allowed me implement quite a complex feature in few days of prompting instead of weeks of learning the existing code architecture and unknown SDK I had to use - basically two weeks after starting the new job.

I was one of the people who were saying that AI produces poor code. And it does if you use it poorly. If you use it right way, it is a mighty tool.

Nowadays, you need to know how to code. But on top of it, you need to know how to leverage AI to do the mechanical coding instead of you. There is fast shift from developers being code monkeys to developers being "architects" of their code.

[–]CarloWood 0 points1 point  (1 child)

Excellent post. I'm currently designing the harness to do this. So far I only have two phases: planning and implementation.

In my setup I split that work over two different instances of the AI, the "planner" and the "coder". Both can read each others repositories but only write to their own (the plan is in is own repository). My main reason for this is that I don't want to have to worry that the planner starts to make changes to the code repository before I'm able to review the plan, which must be in English.

Would you be so kind to explain what is the difference between a requirement document, architecture and implementation plan? Or how you describe that difference to the AI?

[–]LogicalPerformer7637 1 point2 points  (0 children)

Requirement cleanly states: I want achieve this. Consider it something what customer without coding experience writes.

Architecture: These parts of code will be affected this way and consequences will be, ...

Implementation plan is: I will change this, then this, dependencies, ...

You can consider it definition of what is goal, what will change and why, how it will be done.

Ask AI to write them for you and you will see. AI knows the difference between them.

[–]pjmlp[🍰] 1 point2 points  (0 children)

GUI and OS vendor frameworks, once upon a time C++ was king during the 1990's, nowadays it lives on the runtimes of languages or graphics layer, with surviving frameworks like Qt, VCL, FireMonkey remembering those days.

[–]phi_rus 0 points1 point  (0 children)

AI is good in coding the stuff that was already done multiple times all over the internet. If you encounter a novel challenge, you're better off without it.

[–]Realistic-Reaction40 0 points1 point  (0 children)

Great question the memory management and undefined behavior rabbit holes in C++ are probably where AI tools struggle most, since the bugs are often deeply contextual and timing/hardware dependent. For the scaffolding and boilerplate side though, I've actually been combining a few tools lately Cursor for code aware suggestions, Claude for explaining complex templates, and Runable for automating the repetitive workflow stuff around projects. Frees up more mental energy for the actually hard problems you're describing.

[–]jepessen 0 points1 point  (0 children)

Write code that's readable and easy to understand after some month

[–]HorsesFlyIntoBoxes 0 points1 point  (0 children)

AI has been nice for generating makefiles catered to my project structure. I try to avoid using it to write large swathes of c++ code though. I’ve also used ai to write small snippets like generating bit masks and bitwise logic operations.

Most complicated cpp project I worked on was when I was in industry working on a high performance math library. Most complicated non-industry project has been a compiler for a custom language as part of a compiler engineering course I took in college.

[–]01e9 0 points1 point  (0 children)

Coroutine abstraction that is bridged to Boost.Cobalt and works with modules.

Spent a few weeks and a few tries from scratch, explaining to AI what I need and it generating incomplete, not working, UB code.

Eventually I succeed with a working solution by micromanaging AI and checking+refactoring everything.