实测对比:Claude3在小项目编程中如何超越GPT-4

今天正好有个朋友找我帮忙,写个小程序,实现如下需求,

将一批图片文件按照excel中的格式进行文件名修改,原文件名要从excel中的F列获取,修改的文件名要从excel中的H列获取,大概就这么个需求,

我先将需求发给gp4,请看截图

gpt4解释得倒是很详细,可惜代码运行后不能没有达到需求。

这时,我想起了claude3,同样的需求我发给了claude3,(Opus模型,这个模型是最强大的).

不过它的代码,只改了我的第2行, 其他行没改,我继续问它

然后我运行它给的代码,这次运行正常了。下面是完整代码

cs 复制代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;

namespace foryutao
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string excelFilePath = @"C:\temp\123.xlsx";
            string folderPath = @"C:\temp\123\";

            Excel.Application excelApp = new Excel.Application();
            Excel.Workbook workbook = excelApp.Workbooks.Open(excelFilePath);
            Excel.Worksheet worksheet = workbook.Sheets[1];

            try
            {
                int lastRow = worksheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row;

                for (int i = 2; i <= lastRow; i++)
                {
                    string oldFileName = worksheet.Cells[i, 6].Value?.ToString();
                    string newFileName = worksheet.Cells[i, 8].Value?.ToString();

                    if (!string.IsNullOrEmpty(oldFileName) && !string.IsNullOrEmpty(newFileName))
                    {
                        string oldFilePath = Path.Combine(folderPath, oldFileName + ".jpg");
                        string newFilePath = Path.Combine(folderPath, newFileName + ".jpg");

                        if (File.Exists(oldFilePath))
                        {
                            File.Move(oldFilePath, newFilePath);
                        }
                    }
                }

                MessageBox.Show("文件重命名完成!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("发生错误:" + ex.Message);
            }
            finally
            {
                workbook.Close();
                excelApp.Quit();
            }
        
        }
    }
}

程序运行界面如下:

点这个按钮就可以实现这个功能。

结论:如果只是写个小项目或者小程序的功能,目前看下来确实是claude3比gpt4更强大,其他方面还没做比较,另外目前claude3太难注册了,分享一个网站给朋友们试用一下:

https://chat.lmsys.org/

一定要选opus模型,claude3有三个模型,只有opus是最强大的。

相关推荐
我是苏苏28 分钟前
C#高级:使用ConcurrentQueue做一个简易进程内通信的消息队列
java·windows·c#
Never_Satisfied2 小时前
C#获取汉字拼音字母方法总结
开发语言·c#
不绝1917 小时前
C#核心:多态
开发语言·c#
橙露8 小时前
C#在视觉检测中的优势:工业智能化转型的利器
开发语言·c#·视觉检测
学统计的程序员8 小时前
一篇文章简述如何安装claude code并接入国产智谱AI大模型
人工智能·ai编程·claude
sww_10268 小时前
智能问数系统(一):高质量的Text-to-SQL
java·人工智能·ai编程
爱说实话10 小时前
C# DependencyObject类、Visual类、UIElement类
开发语言·c#
TDengine (老段)10 小时前
TDengine C# 语言连接器进阶指南
大数据·数据库·人工智能·物联网·c#·时序数据库·tdengine
艺杯羹10 小时前
Trae vs. 传统AI编程工具:谁更适合你的开发场景?——深度对比与实战指南
团队开发·个人开发·ai编程·技术选型·开发效率·ai编程工具
a***592610 小时前
C++跨平台开发:挑战与实战指南
c++·c#