Go Down

Topic: Death of a 6000 line project (Read 2071 times) previous topic - next topic

mmkhmmkh

Jun 20, 2016, 09:41 pm Last Edit: Jun 21, 2016, 10:06 pm by mmkhmmkh
Hello.
Recently , i was done a complex project with arduino . it was nearly 6000 lines . last time , i just replaced all Serial.print with //Serial.print to comment out all serial commands , and then ... Death !
Some functions are disappeared ! some are half disappeared ! and my code and my project is DEATH .
unfortunately , i dont have any backup of my project , ... .

Did anyone before me do a replace on a 6000 line code ?!
What is happening here ?!

Qdeathstar

#1
Jun 20, 2016, 09:47 pm Last Edit: Jun 20, 2016, 09:49 pm by Qdeathstar
Well, the compiler doesn't move or alter the code You type into ide... So it should be where you left it, usually in the last place you'd look.


it will automatically save everytime it compiles, so that an be annoying some time, but you can disable that.

A creaking creeping shadow
stiff against the freezing fog
glares at a tickless watch.

Time has failed him -- all things shall pass.

sarouje

Sorry to hear that. Just commenting some lines will not cause these kind of issues. Try opening the ino file in a notepad an check again.

Always use Source control.
Sony Arouje
http://sonyarouje.com

[Please don't send Personal Messages for any Technical question, use forum instead.]

CrossRoads

Poor code backups or management on your part does not imply the IDE is a toy.
I've never seen it crash and wipe out whole sections. I do manually save after making big updates just in case, with new version names so I can back up to an earlier version if the changes I made are not working out for what I was trying.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

larryd

#4
Jun 20, 2016, 10:03 pm Last Edit: Jun 20, 2016, 10:05 pm by LarryD
Sorry you lost work.

I use SyncBack for automatic backups daily X2.
One goes to my internal hard drive D and one to a table top network drive.
Once a week I run the program with an USB drive.
Then swapping this USB drive with a similar one that sits in a off site safety deposit box.

You learn.

http://www.2brightsparks.com/syncback/sbpro.html

They have a free version:
http://www.2brightsparks.com/freeware/index.html
.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

AWOL

#5
Jun 20, 2016, 10:13 pm Last Edit: Jun 20, 2016, 10:20 pm by AWOL
I don't use the IDE much - doesn't it have a ctrl-Z / undo?
Or is the undo depth limited?

rmartins

Hello.
Recently , i was done a complex project with arduino . it was nearly 6000 lines . last time , i just replaced all Serial.print with //Serial.print to comment out all serial commands , and then ... Death !
Some functions are disappeared ! some are half disappeared ! and my code and my project is DEATH .
unfortunately , i dont have any backup of my project , ... .

Did anyone before me do a replace on a 6000 line code ?!
Arduino IDE Programmers ! What you are doing there ?!

So , ... , Is Arduino IDE just a TOY ?!!! WTF is happening here ?!
Sorry for your work lose..
I have a project that have more than 7000 lines of code, and I never have this kind of problem!
By the way, my entire project don't have all 7000 lines in one single ino file, I use about 32 separated files each one with your own functions!
Is your project had all the 6000 lines in one single file ?

DrAzzy

#7
Jun 20, 2016, 10:19 pm Last Edit: Jun 20, 2016, 10:35 pm by DrAzzy
I'd wager that you fatfingered the find line?

Assuming ctrl+Z isn't able to save you, you're probably SOL.

I put everything I care about into a github repo, so as long as I remember to commit changes regularly, I don't have to worry about losing data, and can go back to an old version easily.

Re: multiple files - I thought there was some issue with the 1.6.6+ IDE and multiple files?
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

J-M-L

Sorry to hear... Take that has an opportunity to start afresh with new ideas from all the learnings of first version... Usually a version 2 is so much better... (And run back-ups)
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

PaulMurrayCbr

I use git and github. Using some sort of code repository system is just basic infrastructure for any working programmer. You need to learn to use git - you'll come to love it. It'd be nice if it were integrated into the IDE, but that's quite a bit of work.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

pert

Some functions are disappeared ! some are half disappeared ! and my code and my project is DEATH .
Were you using code folding: https://github.com/arduino/Arduino/issues/4845?

Re: multiple files - I thought there was some issue with the 1.6.6+ IDE and multiple files?
I use multiple files(tabs) on every project and can't think of any offhand.

+1 for using git or other version control program. It's a bit of work to learn but definitely worthwhile if you're writing a 6000 line program. I have found it actually makes me a better programmer to have to break my work into logical commits.

Robin2

+1 for using git or other version control program. It's a bit of work to learn but definitely worthwhile if you're writing a 6000 line program.
Using CTRL-C or drag-n-drop to make a backup copy of the program directory is also pretty simple.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

J-M-L

My Mac is connected to a time machine, so incremental backups happen automatically. I also back up to the cloud in the background. that saved me a few times - or at least helped not start from scratch again.

agree source control is the way to go if you are doing anything serious. nice feature request for the IDE...
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

mmkhmmkh

#13
Jun 21, 2016, 10:00 pm Last Edit: Jun 21, 2016, 10:06 pm by mmkhmmkh
First , Thanks to all for replying to my topic .

Sorry to hear that. Just commenting some lines will not cause these kind of issues. Try opening the ino file in a notepad an check again.

Always use Source control.
Yes . I then opened it in notepad . it was same and corrupted.


Sorry you lost work.

I use SyncBack for automatic backups daily X2.
One goes to my internal hard drive D and one to a table top network drive.
Once a week I run the program with an USB drive.
Then swapping this USB drive with a similar one that sits in a off site safety deposit box.

You learn.

http://www.2brightsparks.com/syncback/sbpro.html

They have a free version:
http://www.2brightsparks.com/freeware/index.html
.
Thanks , i will use it from now .

I don't use the IDE much - doesn't it have a ctrl-Z / undo?
Or is the undo depth limited?
Yes , i undo it , but it undoes for about 10 times , not more . the replacement was about 100 lines.

Sorry for your work lose..
I have a project that have more than 7000 lines of code, and I never have this kind of problem!
By the way, my entire project don't have all 7000 lines in one single ino file, I use about 32 separated files each one with your own functions!
Is your project had all the 6000 lines in one single file ?
Thanks , Yes . all the 6000 lines are in one single file ! ( also there are approximately 2000 lines in other files ... )

I'd wager that you fatfingered the find line?

Assuming ctrl+Z isn't able to save you, you're probably SOL.

I put everything I care about into a github repo, so as long as I remember to commit changes regularly, I don't have to worry about losing data, and can go back to an old version easily.

Re: multiple files - I thought there was some issue with the 1.6.6+ IDE and multiple files?
No, it was just replace "Serial.print" with "//Serial.print"

I use git and github. Using some sort of code repository system is just basic infrastructure for any working programmer. You need to learn to use git - you'll come to love it. It'd be nice if it were integrated into the IDE, but that's quite a bit of work.

My program is not open source and is not public usable ! I know that it was my fault , because i didnt make any backups from it , and its not what i usually do ...



Were you using code folding: https://github.com/arduino/Arduino/issues/4845?
I use multiple files(tabs) on every project and can't think of any offhand.

+1 for using git or other version control program. It's a bit of work to learn but definitely worthwhile if you're writing a 6000 line program. I have found it actually makes me a better programmer to have to break my work into logical commits.
This is the point ! yes , i use code folding . and every functions that is corrupted was folded .


YES , something like this : https://github.com/arduino/Arduino/issues/4845

Last night , i retyped all of my fuctions that was deleted . so my code is complete again.

Thanks to everyone,
and Sorry for my bad english ,
MMKH .

pert

yes , i use code folding . and every functions that is corrupted was folded
That's a really terrible bug, sorry to hear it bit you so badly. It's a shame the developers haven't put priority on fixing it. At the very least they should remove the option to use code folding until it's fixed. The other annoying bug with code folding is everything unfolds every time you switch tabs.

Go Up