Coding Showdown: Gemini Advanced vs. ChatGPT 4
Image created using OpenAI's Image Generator Tool.

Coding Showdown: Gemini Advanced vs. ChatGPT 4

This weekend, I explored using both Google Gemini Advanced and OpenAI ChatGPT 4 as coding companions for a common Python dataset transformation task - combining old and new reports. This is to share my impressions.

TLDR

In terms of handling coding tasks: both Gemini Advanced and ChatGPT 4 are closely matched in performance. They are particularly useful if you have some coding basics but need assistance in recalling specifics while quickly assembling a functional solution. However, for more complex or optimised solutions, be prepared to provide detailed requirements and examples to either model.? However, ChatGPT still has slight edge as far as coding is concerned.

In terms of speed of responding to prompts, Gemini Advanced boasts a speed advantage. This is likely due to Google's expertise in scaling cloud hardware for inference (producing responses).

Detailed Observations

Overall, Gemini and ChatGPT deliver similar performance, especially when used for general, objective-based tasks—they typically require some adjustments right out of the gate. However, the primary distinction between them lies in their stylistic approaches. Gemini's code tends to adhere more closely to development principles, even though such rigor wasn't necessary for my basic use case. Generally, neither tool provides completely flawless code on the first try.

It was an intriguing experience testing with a prompt that had very specific requirements. Here are the final prompt and outputs from both Gemini and ChatGPT: Gemini | ChatGPT.? You can see (if you checked the links) my prompt was detailed to the extent that it resembled pseudocode, complete with examples of a pandas dataframe (basically tabular structure in python - imagine excel table).

Above, I've provided the final version of the prompt response where ChatGPT performed flawlessly. Getting there was a process that involved several attempts. You can compare this to a similar earlier prompt, detailed here: ChatGPT conversation, which required additional iterations to reach a solution. In this earlier prompt you can see ChatGPT generated code that included a redundant dataframe, an unnecessary step, and used a deprecated function. However, after resubmitting the prompt some time later, the result was flawless.

Gemini Advanced initially wrote code that functioned but didn't meet the requirements — it didn't remove redundant rows. After I pointed out the issue, Gemini revised the code to produce the correct output. Although it successfully generated working code in two steps, it did not utilise efficient string processing functions. Additionally, for some reason, it packaged the code into a function, possibly adhering to the principles of object-oriented programming.

Lastly, I observed that although Gemini is significantly more advanced than Bard, it occasionally loses context compared to ChatGPT. However, this does not happen often.

Overall, both tools are excellent choices for piecing something together when you understand the principles but lack proficiency.

I’m keen to hear about your experiences with these or other GenAI tools. Drop a comment or link to your own posts below!

KIRAN KUMAR R

Open for Freelance work | Zepto | Ex - Flipkart | Ex - Kudzu | Mechatronics Engineer

7 个月

Thank you Maksym Hlushko for the great review! I am going with Gemini Advance, which can integrate seamlessly with other Google products.

Vincent Chibueze

Full Stack Developer | ICT Solutions Specialist | Python | React.

8 个月

I really enjoyed your review. Thanks for sharing. I already have a project to work on and considering which generative ai to use for assistance. I think I will go with Chatgpt4 with what I've learnt from your review.

Patrick Rojo

E-commerce & Digital Transformation Executive | Strategy | Marketplace | Product & Technology | ex-Falabella | ex-Rocket Internet (Linio)

10 个月

good review, thanks for sharing

要查看或添加评论,请登录

Maksym Hlushko的更多文章

社区洞察

其他会员也浏览了