实测对比: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是最强大的。

相关推荐
金增辉1 小时前
基于C#的OPCServer应用开发,引用WtOPCSvr.dll
c#
悟乙己2 小时前
通过Claude 生成图片的prompt集锦(一)
prompt·claude·李继刚
赛丽曼3 小时前
Assistant API的原理及应用
人工智能·chatgpt
future14123 小时前
C#学习日记
开发语言·学习·c#
傻啦嘿哟4 小时前
Python 办公实战:用 python-docx 自动生成 Word 文档
开发语言·c#
win4r5 小时前
🚀 SuperClaude让Claude Code编程能力暴增300%!小白秒变顶尖程序员!19个专业命令+9大预定义角色,零编程经验也能开发复杂项目,完全碾
aigc·ai编程·claude
slowlybutsurely8 小时前
Cursor核心功能及开发实战
ai编程·cursor
码农飞哥9 小时前
能生成二维码的浏览器插件来了
ai编程·浏览器插件
唐青枫9 小时前
C#.NET log4net 详解
c#·.net