IDE with LOCK text function from accidental modification.

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, I use CodeBlocks as an editor along side AS7. Just found a bug in my code where i removed one of the = signs in an if statement (foo == bar). Took me about 3 hrs to find it.

Anyone know of an editor that allows you to select and lock code sections? 

Codeblocks does have a minimize code sections function that hides code between brackets, im gonna start using it. 

 

 

~William

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Not an IDE as such but isn't this exactly what revision control systems are for?

 

The entire process in a nutshell ("nano" just invokes the editor I use)...

It is pretty clear to me from the git diff what changed ('=' removed)

 

So I can actually do pretty much what I like with the code as I know I can always monitor the changes or wind things back to the way they were. If I now "git checkout test.c" it will undo my rogue edit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Cliff suggested, version control is a must.  Check out TortoiseSVN for personal projects or TortoiseGIT for shared projects. 

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, i dive into Tortoise and or other version control software this weekend. I try to get in the habit of date/time stamping mid to end of day source file saves. Its not like altium designer though where every save creates a backup. 

~William

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vertamps wrote:
Its not like altium designer though where every save creates a backup.

If you like that feature then switch to a heavyweight java IDE such as Eclipse or Netbeans both of which have a local history backup. Of course you can diff against it.

 

Here is Netbeans in action for this feature:

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vertamps wrote:
I try to get in the habit of date/time stamping mid to end of day source file saves.

Top 10 free troubleshooting tools for Windows 10 - File History | InfoWorld

...

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

re local history in the NetBeans derivative MPLAB X :

Working with a File's Local History - Developer Help

 

edit: typo

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Dec 12, 2018 - 01:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vertamps wrote:
Just found a bug in my code where i removed one of the = signs in an if statement (foo == bar). Took me about 3 hrs to find it.
CppCheck plugin - CodeBlocks

though am uncertain that though Cppcheck matches doesn't catch the "=" for "==" defect (I didn't search Cppcheck's lists)

4 results for

linter site:codeblocks.org

12 results for

lint site:codeblocks.org

 

PC-lint Plus catches the defect.

Visual Studio will catch the defect.

 


cppcheck / Wiki / Home

...

We recommend that you enable as many warnings as possible in your compiler.

...

Online Demo - Cppcheck

PC-lint Plus Online Demo - Gimpel Software - The Leader in Static Analysis for C and C++ with PC-lint Plus

C6282 - Visual Studio | Microsoft Docs

warning C6282: Incorrect operator: assignment of constant in Boolean context. Consider using '==' instead

...

 

edits : strikethru, more linters

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Dec 12, 2018 - 01:16 PM