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

It's the same with copilot; you have to know how to implement things to implement things with copilot (for the most part), but when you are a programmer and you could write the code, then you know the prompt to write to generate 10+ lines of code for 1 comment of text all day long. Especially for data transformation, copilot has been a real magic tool; if you put in a comment:

      /*
      this functions transforms this json from: 

      { 
          ... some complex structure in json 
      }
 
      to this json: 
   
      {
          ... some different structure in json 
      }
 
      */
... copilot comes up with the function that takes in the first and spits out the latter. Even if the fieldnames do not match etc, it usually 'guesses' right what fits on what (so it does have some context from it's learning phase what 'looks alike' or 'might be the same thing'. Example: I had a structure with firstName: string, lastName: string and a target structure with name: string; it just did name: firstName+' '+lastName, which was indeed what I wanted. But it comes up with more intricate stuff as well that is pretty much surprising (too human basically).

What is another bonus; if you generated function transfromAtoB(a: A) above, then you only have to do:

      /*
      do the reverse of function transfromAtoB, accept json structure B as input and return structure A
      */ 
And it'll come up with the reverse.

It's not hard to write yourself, but it's boring and error prone (some of these structures are huge). Now I press tab a bunch of times, and run the tests to see if it worked. I am also not that worried i'm infringing someone's open source code; this is all way to custom to look like anything else. That's where this shines; things where it verbatim copies something, you should've been using a library anyway.

Statically typing and using typescript definitely works better than other combinations I have tried (C# was pretty bad last I tried it, JS is good but often subtly wrong because of type issues).




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

Search: