|
What you try to do - LEARN or CONVERT???????
|
|
|
|
|
BOTH!
They are not mutually exclusive.
It is far better to kill 2 birds with one stone that one bird with 2 stones.
|
|
|
|
|
If I got it correctly, you wanna... study C#? Then FIRST you need to learn C# and THEN convert code. And hardly there is any converter except your head.
|
|
|
|
|
I recommend
- StyleCop.Analyzers
- CodeCracker for C# ( Extension )
- and use the VS CodeAnalysis.
Those give a good insight about how things should be done. Don't take every rule as required, but instead think how it suits your project. The help articles are great at explaining why and how and when.
Write UnitTests. When you convert Methods, you may want to try them anyway. And trying them by clicking through the software and creating the situations every time you want to test something is a sisyphus work. The Addon AxoCover can show you which branches of codes are used in the test cases.
A lot of devs are "yeah making tests takes time and i dont have it", and yes it takes time if you write them afterwards. Write them instead of playground console apps and wasting time by clicking though the ui. If you notice a class can not be tested, because it requires a lot of other classes, your class may be not that good.
Oh and good luck, sir!
|
|
|
|
|
I'm currently in the last phase of converting a ~250.000 line project from VBA (!) to C# and I agree that re-writing it as a functional clone would have been the better way.
But here is how I did it:
1. VBA -> VB6 (not your issue but included for completeness' sake)
- acquire and run an old VB6-IDE
- import/convert VBA-project
- fix compile-errors
2. VB6 -> VB.NET
- acquire and run an old version of VisualStudio (those still had a converter for legacy-VB6! I think I used 2005)
- import/convert VB6-project
- fix compile-errors
-> now we're in .NET-wonderland!
3. VB.NET -> C#
- run an old version of "SharpDevelop" (I used v4.4 - as far as I know the feature in question was removed in v5!)
- open/import VisualStudios VB.NET-project
- convert to C#
- open/import in VisualStudio
- fix compile-errors
-> now the code-base is where it's supposed to be - in C# and in VisualStudio!
During these conversion-steps I often treated the codeFiles not only within the respective IDE but also as "normal" text-files in <insert-text-editor-of-choice>.
For that phase I recommend
- EditPad (for the actual search-and-replace-stuff)
- Agent Ransack (for identifying the codeFiles in need tampering)
- and a good and healthy dose of regEx!
When arrived in VisualStudio I recommend
- StyleCop
- ReSharper
They both are very good at spotting code-habits that stem from VBA/6 and were simply converted!
Fixing the (comparatively few) comile-errors introduced in each conversion-step didn't take too much time / effort.
- the vast majority of those were of the same few types and quite simple to fix. Again: freshing-up on regEx is highly recommended
- Most time went into replacing some filthy VBA/6-only stuff that doesn't have an 1:1 equivalent in C# (for good reasons). But this kind of code needed re-writing either way.
But:
While the outlined approach worked very well and took surprisingly little time, the actual work is then only starting
- yes, VBA/6 and C# do stuff in different ways
- and they especially lack a lot of C#s capabilities so the resulting code - while working - is almost always very clunky, verbose and un-elegant
I repeat:
looking back, re-writing the code as functional clone would have been the better way!
Perhaps there is a middle way: convert the old code to have some kind of quarry for quickly looking up / copying old algorithms where necessary (without having to do the same steps of syntax-conversion over and over again)...?
|
|
|
|
|
If these folks [^] had a newspaper, would all of it be Fakir news than most other publications?
Even if it's all true?
(this will teach you not to complain when it's "quiet in here")
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No time to think about that yet. I'm still busy trying out cooking with alternative fats.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
CodeWraith wrote: alternative fats. In my profession opinion, I strongly suggest you center you efforts on mineral oil.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Even my car gets fully synthetic oil - and likes it!
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
Any send me codez urgentz group?
modified 20-Oct-19 21:02pm.
|
|
|
|
|
Quote: 4. No politics (including enviro-politics[^]), no sex, no religion.
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it. A few hundred years later another traveler despairing as myself, may mourn the disappearance of what I may have seen, but failed to see.» Claude Levi-Strauss (Tristes Tropiques, 1955)
|
|
|
|
|
Just a play on words - sort of something new for the lounge.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Anway, its nearly the 7th anniversary of the death of Leslie Nielsen.
|
|
|
|
|
I'll make no bones about it: we see through your plot. Nearly isn't good enough.
Today, in 1895, Wilhelm Conrad Roentgen discovered X-Rays.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Keith Barrow wrote: death of Leslie Nielsen Are you joking? He can't be dead. I see him on TV all the time.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
Shirley, you can't be serious!
edit: Is calling out a Leslie about Leslie considered a Leslie?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
modified 9-Nov-17 10:20am.
|
|
|
|
|
And the Marine Corps 242nd birthday...oorah
Someone's therapist knows all about you!
|
|
|
|
|
I just noticed recently that when a box of Kleenex is near empty, the color of tissue changes to peach to remind users that it is time to buy a new box. What a smart idea. Do you know any other examples like this?
TOMZ_KV
|
|
|
|
|
When the bottle of ketchup is almost empty, it makes a 'squirty' sound with a lot of air.
|
|
|
|
|
By design?
TOMZ_KV
|
|
|
|
|
|
Tim Carmichael wrote: When the bottle of ketchup is almost empty, it makes a 'squirty' sound with a lot of air.
I've noticed it also tends to be a lot messier and go everywhere you don't want it to go.
|
|
|
|
|
Tim Carmichael wrote: When the bottle of ketchup is almost empty, it makes a 'squirty' sound with a lot of air.
And if you're in a restaurant everyone snickers at you.
Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.
|
|
|
|
|
How do you tell when a box of peach colored Kleenex is empty?
(I don't use Kleenex. I carry a handkerchief. #oldschool ).
/ravi
|
|
|
|
|
Good question. But I have not seen peach colored but white.
TOMZ_KV
|
|
|
|