The AI Code Editor to Stay Ahead of the Curve

Cursor — you just can’t afford to ignore this IDE

Harshit Tyagi
9 min readAug 28, 2024

While I have been using Cusor for the last 3 months, the hype is now all over the internet showcasing its superb capabilities with Claude 3.5 Sonnet.

The excitement is well-founded, who wouldn’t like to have AI pair programmer that assists you, collaborates with you, and knows your entire project.

An IDE that understands your intent, not just your syntax. An IDE that learns your entire codebase, not just the file you’re working on.

The Buzz That Can’t Be Ignored

Cursor is setting the coding world ablaze. Twitter threads are exploding with praises.

To validate this, I

  • built a full stack app where I don’t know how to code frontend in react,
  • analysed datasets, created analytical dashboards,
  • reviewed commits in a github repo,
  • built the frontend of the my app by uploading an image,
  • tested on usual coding tasks like documentation, commenting, testing,
  • assessed if it can help me understand an entire open source project and help me contribute to it (my favourite part).

Besides the features,

  • I also compared it with other coding assistants,
  • evaluated the pricing and
  • what other use cases can you leverage this editor for.

If you want to follow a more visual version of this post, check out the video on my YT.

Firstly,

What is Cursor?

Cursor is an AI-powered code editor designed to enhance efficiency through intelligent features and seamless integration with existing workflows.

Unlike other AI extensions that integrate with existing editors, Cursor is a standalone fork of VS Code itself, allowing for deeper integration of AI and unique functionality.

It goes beyond autocomplete, anticipating your next move with their special tool called Cursor Tab.

Getting Started with Cursor

It’s very easy to start working with Cursor. You can download it from their website.

Since Cursor is actually a fork of VS code, so there is literally no learning curve when it comes to using the editor.

The 2 most important features that you should know is the AI-powered normal chat (cmd + L) and inline chat(cmd + K) where you can select the LLM you want to use, you can upload images in the normal chat, with cmd + enter you can add your entire codebase in context and ask questions on top of it.

So, how quickly can one develop a full-stack application today, get it up and running?

Building a full-stack app

I started building an application where I wanted to showcase all the ML case studies out of a database where I used the CSV file as my database.

Cursor offers this inline chat feature, you can hit cmd + K and this input widget pops up within your file that allows you to add instructions and prompt the model for your own use cases.

The most amazing thing is how easy it is to attach entire files to the context of your prompt.

I added the entire CSV file as the database for which the API had to be created. You can also upload schema, images of schema to write SQL queries to extract data.

I started building an API with multiple endpoints for different use cases.

And it did a great job of generating the code following best practices to define endpoints.

If there are any errors, Cursor makes debugging very easy, unlike copying the entire code in chatgpt and then toggling tabs, you can simply use the “Add to chat” or “Debug with AI” with buttons and have the issue resolved within the editor.

My API started running in under a minute.

After backend, I had to set up the frontend and it’s been a while since I coded in JS.

So I asked Cursor in their normal chat what I wanted, it returned all the steps and all I had to do was follow them step by step.

Just click and it runs the bash command to install all dependencies, click and the code gets added to your files.

Keep doing it for all the components.

Run your app, debug for issues by adding errors in the chat, make suggested changes and it starts running.

The time it took me to get this app running was 20 minutes which could easily be a couple of hours without the support.

Further, I wanted to improve the UI and I knew a website that I wanted my app to look like, so I took a screenshot of that website, uploaded it in the chat and asked Claude to update the frontend to look like the website in the screenshot.

My app now looks like this

Quite impressed with the results.

You can just keep shipping features within minutes now.

Analysing datasets in ipython notebook

Cursor has a lot to offer for Analysts and Scientists too, I picked a marketing campaign dataset, opened up an ipython notebook, started a jupyter server, added the instructions to analyse the data and yes, attached the file as well.

It not only helped in analysing data but generated the code in the form ipython cells where I simply had to click on Run Cell to add it to my notebook, mind blowing.

I tried adding markdown cells for documentation in between code cells but Cursor doesn’t differentiate between these cells so the markdown cells were also inserted as Python cells only. So, for now, you will have to turn these cells into markdown yourself.

Taking it a step further, jupyter notebooks are not for presenting, I asked Cursor to turn this notebook into a streamlit dashboard and see what it did.

A full-blown dashboard with side panel, filters, visualisations, complete analysis, who needs a slide deck when you can give people an interactive dashboard to play around with.

Amazing.

Usual coding tasks

Obviously, since the underlying model is Claude 3.5 Sonnet, you can very easily achieve tasks like

  • testing the code with unit and integration tests, here I tested my API endpoints,
  • documenting, adding comments in your code — I used it to add inline comments or simply ask AI to add docstrings to functions,
  • interpreting and reviewing the code.

Review the code

Cursor also provides reviewing capabilities.

If you have a git repo in your workspace, you can ask to review the working state of the project, review the diff from main for a PR or review a commit.

I asked Cursor to review a particular commit in my github repo and it searched through all the referenced files in the commit and highlighted the issues.

This feature significantly saves time and substantially improves the quality of code reviews.

Contributing to open source

Another use case I wanted to evaluate was how good is it when contributing to open source projects because that is something which has very high barrier to entry especially if the project is difficult and has a huge codebase, understanding how it works can take weeks without AI

I cloned this open source RAG framework and asked Cursor to explain the entire code base to me, it did great, now I can simply pick the issue, add it to the chat, design the solution for it and start contributing to projects I understand.

I will share more if and when I get a couple of PRs merged but I most certainly believe this should be way easier now.

How this changes the game for aspiring engineers

As AI tools become more prevalent, the bar for standout projects will inevitably rise. To remain competitive, focus on:

  • Developing strong fundamental programming skills
  • Cultivating creativity in problem-solving; think of value your project offers.
  • Understanding complex systems and architectures
  • Honing your ability to innovate and think critically

A solid foundation in programming fundamentals is crucial. My prior experience with JavaScript and React, acquired years ago, proved invaluable when working with Cursor.

This background knowledge enabled me to effectively communicate with the AI, accurately describe issues, and provide the necessary context to resolve bugs efficiently. Without this foundation, leveraging AI tools like Cursor to their full potential would be significantly more challenging.

By leveraging Cursor as a complementary tool to your skills and knowledge, you can enhance your productivity while continuing to grow as a developer.

Cursor vs other AI code Assistants

The most advanced code assistant that we all are aware of is GitHub copilot and many of us have this question, How is Cursor better than GitHub Copilot?

So, the analogy that I’ve developed to explain this difference is Apple vs Other Android Phones companies.

Just like Apple offers a seamless ecosystem that helps you do almost everything easily, Cursor provides a more integrated experience. You know how people often buy iPhones because they already have MacBooks or iPads?

Cursor is similar. It’s built on top of VS Code, which many of us already use. But they’ve created a standalone IDE with much tighter AI integration. You can use AI between lines, debug more easily, even manually select files to add context and they developed Cursor tab for intelligent code suggestions which was previously called copilot ++.

Cursor Tab (Copilot++) is an enhanced version of GitHub copilot, their model is trained on sequences of small diffs, and can see the edits you have made in the last few minutes at inference-time. This makes the model feel much smarter. Cursor Tab is also given the ability to actually edit your code, not just predict insertions, so that a single Tab can get you to exactly where you want to be.

From the blogs and videos that I’ve seen, Sourcegraph Cody is probably the only Assistant that comes close to Cursor because of its ability to handle large-scale projects with extensive contextual awareness.

I won’t be able to say more as I’ve not tried other assistants myself at this point. More soon.

Pricing

While you can directly use your own Anthropic or OpenAI API keys to use their LLMs directly in Cursor and if you’re using Cursor on a daily basis with long files in context, you will end up spending more via APIs.

Buying their Pro subscription is a good deal here. I have a yearly subscription.

You should try it out with your own API keys or even with the free trial you’ll be able to get a sense of what you can achieve with Cursor and if this is a tool worth investing in.

Conclusion

And that’s it. These are very interesting times and products like Cursor do raise the bar. With AI evolving, the distance between your imagination and reality is getting shorter and shorter with tools like Cursor.

I will continue to share more interesting use cases and ideas you can develop, make sure you’re subscribed. Like if you found this insightful, share your experience in the comments, share it with your programmer friends.

Video version of this post

--

--

Harshit Tyagi
Harshit Tyagi

Written by Harshit Tyagi

Director Data Science & ML at Scaler | LinkedIn's Bestselling Instructor | YouTuber

Responses (5)