Hacker News new | past | comments | ask | show | jobs | submit login

My manager isn’t a programmer but uses ChatGPT to educate himself on a topic and attempts to read the code to see what’s happening before asking one of us if anything is still unclear.



You know, summarizing what code does in regular English via ChatGPT would be an interesting thing. Does it already do that?


It definitely can do this, though obviously it can details wrong here and there. For example:

    Describe what this code does in clear english: 

    from datetime import datetime
    import pytz

    utcmoment_naive = datetime.utcnow()
    utcmoment = utcmoment_naive.replace(tzinfo=pytz.utc)

    # print "utcmoment_naive: {0}".format(utcmoment_naive) # python 2
    print("utcmoment_naive: {0}".format(utcmoment_naive))
    print("utcmoment:       {0}".format(utcmoment))

    localFormat = "%Y-%m-%d %H:%M:%S"

    timezones = ['America/Los_Angeles', 'Europe/Madrid', 'America/Puerto_Rico']

    for tz in timezones:
        localDatetime = utcmoment.astimezone(pytz.timezone(tz))
        print(localDatetime.strftime(localFormat))


ChatGPT Response:

This Python code does the following:

  1. Imports two modules, datetime and pytz.
  2. Gets the current time in UTC using the datetime module and assigns it to a variable named 'utcmoment_naive'.
  3. Uses the pytz module to create a timezone-aware datetime object and assigns it to a variable named 'utcmoment'.
  4. Prints the values of the 'utcmoment_naive' and 'utcmoment' variables.
  5. Defines a date format to be used for printing local date and time.
  6. Defines a list of three timezones.
  7. Loops over the list of timezones and converts the UTC time to the local time in each timezone using the 'astimezone' method of the 'datetime' object and the 'pytz.timezone' method.
  8. Prints the local time in each timezone in the specified date format.
Overall, this code gets the current time in UTC, converts it to the local time in three different timezones, and prints the local time in each timezone in a specified format.


So you’re telling me if one writes a plug-in that integrates with source control checkins and provides these summaries plus an additional terser summary to nontechnical users, I wonder if companies would buy that?


The obvious problem with this is that you'd be sending all your (presumably proprietary) source code directly to ChatGPT, i.e. OpenAI, i.e. Microsoft, with a dubiously vague license to use it to improve the ChatGPT product.

I can't think of a single company I or someone I know has worked at that has a security department/person that would allow this. Maybe very small businesses wouldn't care that much?


> I can't think of a single company I or someone I know has worked at that has a security department/person that would allow this. Maybe very small businesses wouldn't care that much?

Well there are lots of open source companies where this isn't a concern. Even outside that lots of businesses use GitHub as a code repository just fine, and the GitHub tools can read your code to eg scan for security vulnerabilities.


I absolutely do not envy any team who would steal our source code. No, it’s not bad and is rather self-documented, but the amount is huge and it’s all inter-connected. What use can they extract from it?


Obfuscate the code, send to ChatGPT, then find replace the strange names in the summary with the normal ones ;)


Makes sense to me.

Add things like "summary of what each contributor did each week/month" at various levels of detail.

There is an evil and a less evil way to deploy this of course. I have had jobs where I had to provide monthly summaries of what I did this month. I would like to start with a chatgpt summary of all my commits and/or PR's over the month, before editing it, why not?


I mean Elon Musk would.


Correct


What did they do before ChatGPT? It's only been available for 3 months.


Mostly what he is trying to do is run queries on the database to export csvs. So mostly he would ask one of the devs to write a query and he would then save and tweak it himself. Now ChatGPT can mostly write these basic queries and cut down on the number of requests to devs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: