{"id":975,"date":"2024-04-04T20:08:46","date_gmt":"2024-04-04T20:08:46","guid":{"rendered":"https:\/\/mahmudsabuj.com\/blog\/2024\/05\/04\/tip-of-the-day-that-man-again-2\/"},"modified":"2024-05-04T20:52:04","modified_gmt":"2024-05-04T20:52:04","slug":"chatgpt-vs-bard-which-is-better-for-coding","status":"publish","type":"post","link":"https:\/\/mahmudsabuj.com\/blog\/chatgpt-vs-bard-which-is-better-for-coding\/","title":{"rendered":"ChatGPT Vs Bard: Which is better for coding?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For programmers, Generative AI offers tangible benefits. It helps with&nbsp;<a contenteditable=\"false\" href=\"https:\/\/www.pluralsight.com\/blog\/software-development\/how-use-chatgpt-programming-coding\" target=\"_blank\" rel=\"noopener noreferrer\">writing and debugging code<\/a>, making our busy lives a bit easier as a result. But there are now competing tools like&nbsp;<a contenteditable=\"false\" href=\"https:\/\/www.pluralsight.com\/blog\/machine-learning\/what-is-chatgpt-generative-ai\" target=\"_blank\" rel=\"noopener noreferrer\">ChatGPT<\/a>&nbsp;and&nbsp;<a contenteditable=\"false\" href=\"https:\/\/bard.google.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Bard<\/a>, which begs the question: which one is best for me to use?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We compare these tools against each other in the ultimate battle to see which is the most feature-rich tool right now for programming purposes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ChatGPT and Bard: What\u2019s the difference?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The biggest difference between ChatGPT and Bard is the Large Language Models (LLMs) they are powered by. ChatGPT uses the Generative Pre-trained Transformer 4 (<a href=\"https:\/\/www.pluralsight.com\/blog\/machine-learning\/gpt-4-and-chatgpt-update\" target=\"_blank\" rel=\"noreferrer noopener\">GPT-4<\/a>), while Bard uses the Language Model for Dialogue Applications (<a href=\"https:\/\/blog.google\/technology\/ai\/lamda\/\" target=\"_blank\" rel=\"noreferrer noopener\">LaMBDA<\/a>). Also, ChatGPT is developed by OpenAI, while Bard was built by Google.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In terms of capabilities, both do very similar things. Programmers can use ChatGPT for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Suggestions:<\/strong>&nbsp;Both models can suggest the correct syntax and parameters for functions and other code constructs.<\/li>\n\n\n\n<li><strong>Completion:<\/strong>&nbsp;It can complete code that you have started writing.<\/li>\n\n\n\n<li><strong>Debugging:&nbsp;<\/strong>It can help you identify errors and problems in your code.<\/li>\n\n\n\n<li><strong>Explanation:&nbsp;<\/strong>It can explain the code that it generates, or code you input.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Both models were trained on a massive dataset, including Common Crawl, Wikipedia, books, articles, documents, and content scraped from the internet. However, Bard is a little different in that it was trained on conversations and dialogues from the web, while ChatGPT was trained mostly on scraped general content.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both products are still under development, Bard a bit more so than ChatGPT. But to really show how these differences actually matter in a practical sense, here\u2019s how they work when tested against each other.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing ChatGPT and Bard against each other<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We chose seven categories to test the chatbots against each other, based on what we felt were the most relevant:&nbsp;<strong>code generation<\/strong>,&nbsp;<strong>problem solving<\/strong>,&nbsp;<strong>refactoring code<\/strong>,&nbsp;<strong>debugging assistance<\/strong>,&nbsp;<strong>third-party plugins\/UI extension<\/strong>,&nbsp;<strong>ease of use<\/strong>, and&nbsp;<strong>cost<\/strong>. Let&#8217;s preface this by saying this is not a rigorous scientific comparison, but rather a handful of tests mixed with our hands-on experience to date.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Code generation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The bread and butter of what we want it for, right? For this, we fed in the following prompt:&nbsp;<em>&#8220;Write a function in python that returns a list of 100 prime numbers.&#8221;&nbsp;<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Bard&#8217;s coding attempt<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def get_prime_numbers(n):\n  \"\"\"Returns a list of prime numbers up to n.\"\"\"\n  primes = &#91;]\n  for i in range(2, n + 1):\n    is_prime = True\n    for j in range(2, i):\n      if i % j == 0:\n        is_prime = False\n        break\n    if is_prime:\n      primes.append(i)\n  return primes\n\n\ndef main():\n  \"\"\"Prints a list of 100 prime numbers.\"\"\"\n  primes = get_prime_numbers(100)\n  print(primes)\n\n\nif __name__ == \"__main__\":\n  main()\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Looks solid, but does it work? In our experience, chatbots can sometimes create code that&nbsp;<em>doesn&#8217;t<\/em>&nbsp;run, even going as far as to invent functions! That&#8217;s one reason having&nbsp;<a href=\"https:\/\/www.pluralsight.com\/blog\/machine-learning\/regenerative-auto-code-ai-gpt\" target=\"_blank\" rel=\"noreferrer noopener\">AI-generated code in production with no human oversight<\/a>&nbsp;would be very bad. So let&#8217;s test it out and see.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/bard-codetest.png\" alt=\"Checking the result of a bard code test\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">ChatGPT&#8217;s coding attempt<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def generate_primes(n):\n    primes = &#91;]\n    sieve = &#91;True] * (n + 1)\n    for current in range(2, n + 1):\n        if sieve&#91;current] != 0:\n            primes.append(current)\n            for multiple in range(current, n + 1, current):\n                sieve&#91;multiple] = False\n    return primes\n\n# Generate first 100 prime numbers\n# The 100th prime number is 541, so we set the limit to 550 to make sure we get at least 100 primes\nprimes_100 = generate_primes(550)&#91;:100]\nprint(primes_100)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When we run the same prompt by ChatGPT, this code defines a function&nbsp;<strong>generate_primes(n)<\/strong>&nbsp;that takes an integer&nbsp;<strong>n<\/strong>&nbsp;as input and returns a list of all prime numbers up to n. It uses the&nbsp;<a href=\"https:\/\/www.topcoder.com\/thrive\/articles\/sieve-of-eratosthenes-algorithm\" target=\"_blank\" rel=\"noreferrer noopener\">Sieve of Eratosthenes algorithm<\/a>&nbsp;to generate the primes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both of these produced a functional result. ChatGPT&#8217;s example is better in this case, since it&#8217;s cleaner and has much less code. Also, it interpreted our vague prompt correctly. However, this&nbsp;<em>is&nbsp;<\/em>only one use-case: it&#8217;s known that chatbots will vary a lot in their response depending on the language they are using (With less common or documented languages having more errors) or the complexity of the query. So let&#8217;s see how Bard and ChatGPT handle different use cases.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:&nbsp;<\/strong>ChatGPT&nbsp;\ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">2. Problem Solving<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s see how of these LLMs handle a problem. Rather than just asking them to write a generic function, let&#8217;s throw a programming problem at them from&nbsp;<a href=\"https:\/\/leetcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Leetcode<\/a>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Write JavaScript code that enhances all arrays such that you can call the array.last() method on any array and it will return the last element. If there are no elements in the array, it should return -1.<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">ChatGPT&#8217;s problem solving<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Here's how you would do it in JavaScript:\n\nArray.prototype.last = function() {\n  if (this.length === 0) {\n    return -1;\n  } else {\n    return this&#91;this.length - 1];\n  }\n};\n\nIn this code:\n\nArray.prototype.last adds a new method called last to the Array.prototype object. This ensures that all arrays will have this method.\n\nthis refers to the array object on which the last method is being called.\nthis.length gives the number of elements in the array.\nIf the array is empty (this.length === 0), the method returns -1.\nOtherwise, the method returns the last element of the array: this&#91;this.length - 1].\n\nHere is how you would use it:\n\nlet array = &#91;1, 2, 3, 4, 5];\nconsole.log(array.last()); \/\/ prints: 5\n\narray = &#91;];\nconsole.log(array.last()); \/\/ prints: -1\n\nRemember that extending built-in JavaScript objects like Array is generally not recommended, as it can lead to conflicts if the JavaScript environment (like a browser or Node.js) adds a method with the same name. This is generally called monkey patching and is usually avoided in production-grade code. But for quick and dirty hacks, or to understand how JavaScript works, it's a fun tool to use!<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Not only does ChatGPT solve the problem, but it&nbsp;<em>explains the problem<\/em>. Neat! Let&#8217;s run the code through leetcode and see if it actually passes the tests, though.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/leetcode1.png\" alt=\"Testing ChatGPT's problem solving with leetcode\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It looks like ChatGPT solved the problem on the first try! Now it&#8217;s time for Bard to step up to the plate.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Bard&#8217;s problem solving<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Sure, here is the JavaScript code that enhances all arrays such that you can call the array.last() method on any array and it will return the last element. If there are no elements in the array, it should return -1:\n\n\n\/\/ Define a new method on the Array prototype\nArray.prototype.last = function() {\n  \/\/ If the array is empty, return -1\n  if (this.length === 0) {\n    return -1;\n  }\n\n  \/\/ Otherwise, return the last element\n  return this&#91;this.length - 1];\n};\n\n\nHere is an example of how to use the array.last() method:\n\n\nconst array = &#91;1, 2, 3, 4, 5];\n\n\/\/ Get the last element of the array\nconst lastElement = array.last();\n\n\/\/ Print the last element of the array\nconsole.log(lastElement); \/\/ 5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, so we didn&#8217;t get as thorough an explanation from Bard about how the code works. However, it&#8217;s nearly identical when you compare what ChatGPT and Bard produced. Were they looking at each other&#8217;s homework?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/problemsolving1.png\" alt=\"ChatGPT vs Bard comparing problem solving\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Naturally, we can&#8217;t take Bard&#8217;s word at it, so we run the test through Leetcode, and&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/leetcode2%20(2).png\" alt=\"Testing Bard's problem solving with Leetcode\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230; It works! Which is to be expected, given the answer was nearly identical to ChatGPT&#8217;s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When it comes to problem solving, it&#8217;s a tough call between the two. While they produce nearly identical results, ChatGPT explains the code much better for you, which is pretty good for actually learning how to fish instead of having ChatGPT just fish for you.&nbsp;This has been our overall experience with using ChatGPT: not only do you get a possible solution for your problem, but ChatGPT walks you through it a bit more.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:<\/strong>&nbsp;ChatGPT&nbsp;\ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">3. Refactoring Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s say you want to find a more optimized way to do something. It&#8217;s great to get a different viewpoint on your code, and unlike your teammates (assuming you have them), these tools are always free and ready to check over your code. So let&#8217;s see how it does! Here&#8217;s the sample we provided it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>What is a more optimized way to write this code?\n\nArray.prototype.last = function() {\n  if (this.length === 0) {\n    return -1;\n  } else {\n    return this&#91;this.length - 1];\n  }\n};<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">ChatGPT&#8217;s refactoring attempt<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/debugging-chatgpt.png\" alt=\"Refactoring with ChatGPT\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So ChatGPT&#8217;s given us a pretty vague response. It vaguely explains the code and suggests a ternary operator, which is fine and worth checking out. However, it feels like it could have done a bit more. Let&#8217;s see how Bard handles the same assignment.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Bard&#8217;s refactoring attempt<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/debugging-bard.png\" alt=\"Bard's attempt at debugging code\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wow! The difference between ChatGPT and Bard is like chalk and cheese: Bard has clearly gone above and beyond.&nbsp;Not only does it offer optimized code, but it shows code to create a benchmark, and shows benchmark results.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Overall, we&#8217;ve found Bard is a bit better at refactoring. Part of this is likely because Bard uses search engine information on top of being a Large Language Model (LLM), while ChatGPT is currently just an LLM. However, I should state that ChatGPT&nbsp;<em>is&nbsp;<\/em>currently beta-testing a&nbsp;<a href=\"https:\/\/www.pluralsight.com\/blog\" target=\"_blank\" rel=\"noreferrer noopener\">&#8220;Search with Bing&#8221;<\/a>&nbsp;feature and rolling this out to free users, so ChatGPT may become a whole lot better at refactoring code very soon. But for now, we have to give the win to Bard.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:<\/strong>&nbsp;Bard \ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">4. Debugging assistance<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Bugs are part of life. Let&#8217;s throw an obviously flawed bit of code at both tools, and see how well it picks it up. See if you can spot it before ChatGPT and Bard do! Here&#8217;s the prompt we used:<em>&nbsp;Debug the following code that has an error. Provide code that fixes possible errors with it.<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def calculate_average(numbers):\n    total = 0\n    for number in numbers:\n        total += number\n    average = total \/ len(numbers)\n    return average<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">ChatGPT&#8217;s debugging attempt<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/debugging-chatgpt.png\" alt=\"ChatGPT debugging\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All right, ChatGPT has given us back a response saying we need to add some logic to prevent a `ZeroDivision` error. It gives an option for doing so and explains the problem. Now it&#8217;s Bard&#8217;s turn.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Bard&#8217;s debugging attempt<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/debugging-bard.png\" alt=\"Bard at debugging\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Bard found the same problem with the function that ChatGPT did. But once again, Bard has given a much more detailed explanation. It outlines possible errors, explains how to fix them, tells us how to use the function and what the output would be. Whew!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For debugging, we&#8217;ve found in general that Bard is much more thorough in its answers and explanations. There have been times where we&#8217;ve found ChatGPT has discovered bugs better, but by and large, Bard provides clearer examples to the user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bard wins this one, and so we&#8217;re tied 2-2. Can one of them break the stalemate?<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:&nbsp;<\/strong>Bard \ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">5. Third-party plugins &amp; UI extensions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By&nbsp;<a href=\"https:\/\/www.pluralsight.com\/blog\/machine-learning\/chat-gpt-plugins-guide\" target=\"_blank\" rel=\"noreferrer noopener\">connecting a third-party plugin to an LLM<\/a>, we can extend their capabilities in some wild ways, letting them run code in the chat conversation or integrate with apps like Zapier.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ChatGPT offers over 80 plugins to its premium subscribers as a beta feature right now. To learn about some of these, check out our article: \u201c<a href=\"https:\/\/www.pluralsight.com\/blog\/machine-learning\/top-chatgpt-plugins-developers\" target=\"_blank\" rel=\"noreferrer noopener\">The top ChatGPT plugins for developers.<\/a>\u201d Here&#8217;s an example of ChatGPT&#8217;s plugin store right now:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/plugins\/chatgpt-plugin-selection.jpg\" alt=\"ChatGPT plugin store\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And here&#8217;s an example of Bard&#8217;s plugin store:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;Well, I can&#8217;t show you anything, because it doesn&#8217;t exist! It is rumored to be on the roadmap, but there&#8217;s no timeframe as of yet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don\u2019t want to use the web interface, both ChatGPT and Bard offer an API. However Bard&#8217;s API is still limited to invite only, so we didn\u2019t get to test it. ChatGPT&#8217;s API, however, is very thorough and complete.&nbsp;ChatGPT also has an official mobile app, which is surprisingly useable, and quite handy while ideating.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this one, we have to give the point to ChatGPT, due to Bard either not having the features yet, or hiding them behind an invite list.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:<\/strong>&nbsp;ChatGPT&nbsp;\ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">6. Ease of Use<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, so upfront, both ChatGPT and Bard are very easy to use. They both have a web interface where you enter a prompt and get a response. Fairly straightforward, right? They also both have &#8220;conversations&#8221; where they can hold context. However, there&nbsp;<em>are<\/em>&nbsp;differences between the two.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One big difference is how ChatGPT keeps track of your conversations. They&#8217;re stored on the left hand side of the screen, there&#8217;s no limit to the length of them, and they&#8217;re always accessible. You can also delete them whenever you want.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/ease-of-use-chatgpt.png\" alt=\"ChatGPT's interface\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In comparison, Bard doesn&#8217;t allow you to store and access your past conversations. You can access your history and look up what you&#8217;ve searched, but you can&#8217;t click and restart a conversation like you can with ChatGPT. You can only see what you typed for a prompt. On top of this, Bard limits the length of the conversation, so you have to start over if it goes for too long.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/ease-of-use-bard2.jpg\" alt=\"Conversations with Bard\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One feature Bard has that ChatGPT doesn&#8217;t is the &#8220;drafts&#8221; feature. In Bard, you have access to a set of drafts so you can review different responses to your prompt, which is helpful. However, even with this, we found ChatGPT easier to use and more powerful.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pluralsight.com\/content\/dam\/ps\/images\/resource-center\/blog\/screenshots\/ai\/chatgpt\/chatgpt-vs-bard-snaps\/bard-drafts.png\" alt=\"Bard drafts feature\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:<\/strong>&nbsp;ChatGPT&nbsp;\ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">7. Cost<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Any tool needs to have a section on how much it costs, right? ChatGPT has both a free and premium version called ChatGPT Plus, billed at $20 a month. Premium subscribers get access to real-time internet searching features, plugins, better answers from the GPT-4 model, faster response times, priority access to new features, and access during peak times.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In comparison, Bard is free to everyone who has access. Getting this access requires a personal Google Account that you manage on your own, or a Google workspace account for which your admin has enabled access to Bard with (Which can be a bit disappointing if they haven\u2019t).&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s likely Bard will be commercialized at some point, but given it\u2019s free vs freemium right now, Bard wins by default.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Winner:<\/strong>&nbsp;Bard \ud83c\udfc6<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion: ChatGPT wins out, but both tools are useful!<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At a score of four to three, ChatGPT wins overall (\ud83d\udc51), but in practice both of these tools should be a part of your arsenal. Here are some key points to keep in mind as a developer using these tools:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The base version of ChatGPT is a LLM only, which means the information can be out of date. Bard uses both LLM and search data. This is going to change fairly soon, with&nbsp;<a href=\"https:\/\/www.pluralsight.com\/blog\" target=\"_blank\" rel=\"noreferrer noopener\">ChatGPT implementing \u201cSearch with Bing\u201d<\/a>&nbsp;into its free offering.<\/li>\n\n\n\n<li>ChatGPT is generally better for generating documentation<\/li>\n\n\n\n<li>Bard creates more thorough explanations of code most of the time<\/li>\n\n\n\n<li>Bard limits the length of the conversation, ChatGPT only limits requests over time (GPT-4)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that even if you\u2019re using these tools, it\u2019s important to understand the code you&#8217;re working with. Don&#8217;t become too reliant on them because the results are not guaranteed to be accurate at any point. Till next time, happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For programmers, Generative AI offers tangible benefits. It helps with&nbsp;writing and debugging code, making our busy lives a bit easier as a result. But there are now competing tools like&nbsp;ChatGPT&nbsp;and&nbsp;Bard, which begs the question: which one is best for me to use? We compare these tools against each other in the ultimate battle to see &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1083,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[25,24,8],"class_list":["post-975","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tie-tech","tag-ai","tag-chatgpt","tag-tech"],"_links":{"self":[{"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/posts\/975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/comments?post=975"}],"version-history":[{"count":3,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/posts\/975\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/posts\/975\/revisions\/1087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/media\/1083"}],"wp:attachment":[{"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/media?parent=975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/categories?post=975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mahmudsabuj.com\/blog\/wp-json\/wp\/v2\/tags?post=975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}