OpenAI has unleashed two incredible AI tools that are currently all the rage. Whereas most of the buzz is centered around its incredible ChatGPT, its dataset pales in comparison with its bigger sibling GPT-3. In short, ChatGPT is very well suited for human-like conversations and GPT-3 provides more accuracy.
Both are incredible tools that can write poems, stories, essays, and even code. All this has a lot of people concerned since it raises the question of whether humans are redundant in a world where AI is more powerful each day.
Others already see ways in which they can use these tools to enhance their work. Many developers are currently using these to improve their code or even code from scratch. This is because both ChatGPT and GPT-3 can be tasked with developing software and making assessments over code.
For instance, I have asked ChatGPT the following: Develop Python code for a simple calculator. This is what ChatGPT replied:
Sure! Here is a simple calculator that can perform addition, subtraction, multiplication, and division:
def calculator(num1, operator, num2):
if operator == "+":
return num1 + num2
elif operator == "-":
return num1 - num2
elif operator == "*":
return num1 * num2
elif operator == "/":
return num1 / num2
else:
return "Invalid operator"
print(calculator(2, "+", 3))
print(calculator(5, "-", 1))
print(calculator(4, "*", 5))
print(calculator(9, "/", 3))
It even went on to explain the different parts of the code:
“This code defines a function calculator that takes in three arguments: num1, operator, and num2. The function first checks the value of the operator and then performs the corresponding arithmetic operation on num1 and num2. I hope this helps! Let me know if you have any questions or if you'd like to see any other examples.”
Pretty amazing, huh? So, developers have been trying to further enhance the capabilities of ChatGPT for specific purposes, just like what Nicolae Rusan did with error.tips.
Auto-fixing code with error.tips
ChatGPT is very powerful when asked to perform tasks. However, it’s not real-time. This is what Nicolae Rusan set out to accomplish with error.tips. This tool was developed using OpenAI’s ChatGPT to provide real-time assistance when coding.
Using it is effortless, too. All you need to do is code, and the AI will give suggestions and error-solving tips. The app is currently not open to the public, and you need to request access to use it.
That said, there’s a Demo version available where you can paste your code, and the error message you get. Error.tips will then analyze the code and offer possible explanations for the error. It uses a smaller dataset than the real-time version, but it’s still incredibly helpful.
Another major feature is that no matter the programming language you use, error.tips has you covered. I’ve tried some broken Javascript code, and it gave a provably correct answer, stating that its degree of confidence was high.
Its developer is still deciding on important design aspects, for instance, how to integrate it in your dev flow, and analyzing what prompts give the best solutions. Even though it’s still under development, it’s an incredible tool you can try for free on its official website.
Thank you for being a Ghacks reader. The post Speed up your coding with AI appeared first on gHacks Technology News.
0 Commentaires