I just finished creating my first main application in C # / Silverlight. As a result, the total number of lines was more than 12,000 lines of code. Given this, the php / javascript application was rewritten, which I created 2 years, which was more than 28,000 lines. I am really proud of my achievement.
After reading many questions and answers here on stackoverflow and other sites on the Internet, I followed the advice of many posters: I created classes, procedures, etc. for things that I would copy and paste a year ago; I created logic to define complex functions; make sure there are no crazy hidden characters (tabs are used instead of tabs); and a few more things; post comments if necessary (I have a lot of comments).
My application consists of 4 tiles laid out horizontally that control user elements in each fragment. You can have from one to four sectors loaded at any time. If you once downloaded a fragment, the slice occupies the entire artboard ... if you have 2 downloaded, each takes half, 3 seconds, 4 per quarter.
Each of these sections represents (for this example) light control. Each slice has 3 sliders in it. Now that I have encoded the functionality of the sliders, I used the switch / case statement inside a public function that would run the command on the specified slice / slider. This did for some duplicated code, but I did not see around it, since each fragment was named differently. So I would do slice1.my.commands (); slice2.my.commands (); etc.
My question to you is how to clear my code even further? (Unfortunately, I cannot post any of my codes). Is there any way to do this repetition from my code?
source
share