0

I was recently laid off and have been applying to jobs. I have been adding more code to public repos on sites like GitHub. I started using AI such as ChatGPT to help write some code. While I wouldn't feel comfortable copying the whole program, I have used it for things such as coming up with tests cases or comparing my solution to the one it gives.

Where should the line be drawn when it comes to using code generated by AI to get an interview? As long as I can explain what it does, should I include it in my portfolio?

I realize this is a subject that is actively evolving, one place I interviewed with preferred its workers use AI to its fullest extent including having it write as much code as possible that ends up in production.

10
  • 3
    Yes, just make sure you can understand it and can explain it. But do practice without using AI, for most good companies, you'll be tested in an environment that doesn't give you much in terms of auto-completion and auto-suggestions. Commented Mar 19 at 1:21
  • 2
    Be aware that AI is just as good at generating bad examples as good ones. If you want to use it as a brainstorming assistant, that's not entirely unreasonable. But remember that you are responsible for vetting, and maintaining, anything you put your name on
    – keshlam
    Commented Mar 19 at 3:37
  • 5
    My best advice to you is stop using ChatGPT to write code. Code written by ChatGPT is trivial to identify. As a manager I would never hire anyone that had ChatGPT code in their GitHub repository
    – Donald
    Commented Mar 19 at 14:54
  • Well, as your manager you would likely soon get fired becasue your whole department is replaced by Devin ;) Seriously, the world is changing while you write this. Look up Devin in google (Devin AI programmer), demos on X. Limited as heck, but in half a year... OUCH.
    – TomTom
    Commented Mar 19 at 15:23
  • 5
    @TomTom Get back to me when the AI systems can identify missing requirements, and can understand the implications of what those requirements are. And then layer over that dealing with people who don't speak your language, or share your culture, and have differing ideas about what is important. (And for that latter part machine translation does not work very well at all - been there, done that).
    – Peter M
    Commented Mar 19 at 16:22

3 Answers 3

5

I believe that letting a machine learning model generate code can assist a programmer, but that it doesn't and probably won't ever be able to replace programming skill. Yet, trying to sell ML-generated code as ones own can be a feasible way to bullshit oneself through an application process without actually having the expertise and skill that are required in real-world software development.

So as a hiring manager looking at a portfolio I would expect the machine-generated code to be clearly marked as such through comments. If I suspected that parts of the portfolio are machine-generated but not clearly marked, then I would interpret this as an applicant who can't actually program trying to swindle their way into a job and reject them.

Assuming the applicants portfolio clearly shows which parts are from the ML model and which parts are written by them, I would focus my attention on the parts that are not ML-generated. I would also take a cursory glance at the ML-generated code to see if there are any obviously bad parts in it an experienced programmer would have rejected. However, what I have seen so far in ML code is that the code often looks fine at first glance and only shows some serious WTFs when taking a very close look. So if it's a lot of ML-generated code, then I would probably not spend too much time on it.

So should you include ML-generated code in your portfolio? Yes, but:

  • Do not consider it a substitute for your own code. It should only be there to demonstrate that you know how to integrate machine learning models in your workflow.
  • Make sure it's clearly visible which parts were written by you and which parts were generated by the ML model.
3
  • Personally, I use AI to code a lot, and I find that debugging existing code that "sort of works" is much faster than spending a huge amount of time building out all the extra things. I do notice that I'm now doing extensive amount of code review from the AI because it's just so good at making up bullshit. I do set a time limit though, and if I can't get anything useful in an hour, I drop it and go back to digging through APIs and real documentations. You'll need to be able to competently do the latter before relying on AI though. And people can tell.
    – Nelson
    Commented Mar 20 at 3:48
  • How would you know if code is written by AI? For example can you tell if this was function reverseString(str) { return str.split("").reverse().join(""); }
    – GlaceBuff1
    Commented Mar 21 at 5:00
  • 1
    @GlaceBuff1 As I wrote: "trying to sell ML-generated code as ones own can be a feasible way to bullshit oneself through an application process". If one wants to build a github repository of ML-generated code then they can just discard anything where the ML model generates bullshit. You only notice the incompetence of a person like that when you give them an assignment their ML model can't solve or confront them with high-level challenges like software developers encounter them in the real world which are too complex and specialized to be covered by their model's training data.
    – Philipp
    Commented Mar 21 at 8:12
1

Where should the line be drawn when it comes to using code generated by AI to get an interview?

If you are asked to show your own code, you should not use code written by somone else and you should not use AI-generated code. If there is any question about that in your mind, just ask if it's okay to show code that was generated by AI, and follow their instructions.

If you want to include AI-generated code in a public repository, make sure you label it clearly.

1
  • 1
    And make sure you fully understand how it works and how to develop it further. Otherwise you're just demonstrating your limitations.
    – keshlam
    Commented Mar 19 at 14:21
-2

Where should the line be drawn when it comes to using code generated by AI to get an interview?

Well, unless you are having access to Devin and use it to write your programs - what AI writes are smaller routines under your guidance, so it is a tool. This is particularly true if you use ChatGPT - MS Copilot in Visual Studio can see more of your code than you copy/paste in, but ChatGPT is totally under guidance.

This likely will change in a couple of years - sorry, months. I mentioned Devin, look up the Demos, it is the first AI complex designed to work as semi-independent programmer, doing research, reading spec, possibly asking for clarification and even in one example sending an email to developers of an open source library asking for some clarification. Now, that is still buffy as heck, and more a 0.1 version, but in a couple of months - it may be the one that makes sure you are not even talked to in an interview as there is no interview.

But for now, AI is a reflective tool that takes off a lot of boilerplate and is good to find bugs easily, to write specific snippets fast (I hate regex - AI is good to make a regex out of examples under manual check). As such, just mention how AI helps you and you prefer to use AI as some sort of "copilot" - if even.

And then hope Devin does not go on in the speed of the last months because then - there is no job soon enough.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .