If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

AI as a teaching tool


I have been playing around with https://beta.openai.com/playground and the snip is a little example of what it can do. This really suits my preferred learning style where I can take something that works and then modify it until it breaks and then learn why it broke and how to fix that.
I feel quite optimistic about AI as a learning tool, I would like to read the thoughts of others

AceGorgiousCoenJanFDADA_universevictorklixtoArv

Comments

  • This is awesome !

    I am really eager to witness all the new people who will jump into the programming bandwagon and all the new interactions it will bring, thanks to this new technology !

    I think it raises the same questions as the text-to-image machine learning algorithms. Like the potential biases (For example, you did not ask the bot to set the first cube as active, why did it add that last line ?) and the origin of the input data set. But this will absolutely be an invaluable tool in the future for anyone working in the field.

    Also, and here I'm talking to the AI >< please don't use comments that much when you write in python. If you name your variables, functions and classes well, you shouldn't have to use one-liner comments that often :)

    Nigel
  • @Gorgious

    Also, and here I'm talking to the AI >< please don't use comments that much when you write in python. If you name your variables, functions and classes well, you shouldn't have to use one-liner comments that often :)

    Maybe you already know this book 'Clean Code' , but a senior colleague lend it me:

    https://www.bol.com/nl/nl/f/clean-code/9200000033313462/
    In one chapter, it describes exactly what you are saying here. My addition would be I also learned from this book, only use comments when they are strictly necessary, you have source control for comments. And naming variables should be very explicit, rather than an abstract i, x. or whatever. :-)

    Back on topic,
    This AI is extemely cool, at my company we had a hackathon a few weeks ago. Some developers were exploring AI. So much potential and it sparked ethical discussions as well.

    Nigel
  • @Nigel said:
    I have been playing around with https://beta.openai.com/playground and the snip is a little example of what it can do. This really suits my preferred learning style where I can take something that works and then modify it until it breaks and then learn why it broke and how to fix that.
    I feel quite optimistic about AI as a learning tool, I would like to read the thoughts of others

    Apparently, their https://chat.openai.com/chat has now really let people see how far this can go in the past few days. The prospect of having really well tuned AI as a valuable coding assistant is how, well, not just a prospect anymore. It would really be nice to see this result in a significant productivity boost for devs and hopefully, much better / efficient code bases.

  • @Gorgious @Coen wheres the love for comments gone guys!? ?. Maybe I’m one of the few, but I think good comments are never detrimental to good code. Think scientific papers, jupyter notebooks etc. Sure, you could write clean formulas, present the results accurately but a good comment goes a long way to make code readable, even if it’s your own.

    CadGiru
  • All I can say as a novice, clear comments is the first step to understanding what is going on, especially when written in plain language.

  • @vpajic @Nigel Personal opinion: I think fact that AI generates it with comments is a plus, but when I write my own I also prefer Uncle Bob's solution mentioned (to do not comment it at all, but rather name things in a readable way, and pack it into small methods). But I guess that's just personal preferences :)

    Nigel
  • @vpajic I think systematic comments are fine for beginners, for teachers, or for people who don't understand english well enough to infer what the keywords mean. I'm not against them, but I don't think it's a good idea to use them 1-1 for each line of code. I would avoid using comments to describe what the code does, but rather use them to describe the intent of the code. In general, the intent of a function or a class never changes, but the inner workings may change from time to time. I would avoid using numbers in comments, since these force you to maintain a double-ledger when you tweak your code further down the line.

    The big problem I see with them is that they're disconnected from the code and the actual computation of the program. They're paratext, and as such they can go stale, be wrong, miss some parts of your script, refer to a part that was removed, be copy/pasted without changing their values, etc. The program won't care if the textual information is not valid, but if you as a programmer or a user trust a comment to understand what some piece of code does, you run the risk of being misled in the wrong direction, or not understand what side-effects it may have.

    As an example here in this piece of code, the comment # Create 6 cubes is a bit misleading. The code it refers to is creating 6 cubes, sure, but it is also changing their dimensions, AND setting them apart by a certain distance, AND changing the active object 6 times, AND renaming them. (And updating the UI accordingly). If I had to use a comment, I would maybe rephrase it like # Create and setup cubes according to the input parameters or something like that. In reality I would put it in a function and call it create_cubes(instances, dimensions, spacing): :)

    Sorry for detracting the discussion from the point of the topic. For now I don't think this tool (in this current form) will directly help confirmed developers, but it will indirectly have an impact by bringing in new blood, new ideas, generate hype in mainstream media, etc.

    As a code-completion assistant, devs will spend less time looking up the docs or figuring how to use the API or correcting menial bugs like a forgotten comma or parenthesis, which is awesome.

    As a code generation program, for now, it seems it understands how to stack primitive shapes together to create various bigger shapes, and it also seems to understand what it is doing, according to the systematic comments, which is also awesome as a starting point because that's how most people start writing scripts and playing with the API.

    I'm so eager to see what the next step is :)

    NigelCoenJesusbill
Sign In or Register to comment.