I like this message very much, ohh! what's pitiful! it's 2 years ago. but I really hope the writer or someone can send VS51.exe. thanks!
My email zeeman2003@hotmail.com
Refactoring is suppose to take variable scope into account where find/replace does not.
Refactor existing code making it easier to read and cheaper to maintain.
I can see that could be helpful in certain circumstances, but I can't see that it's going to make a 20-30% difference to my productivity on a day-to-day basis.
But maybe that's because I still don't really see what it means (yet). What's the Big Idea?
But how does it make it easier to read and cheaper to maintain?
You still haven't explained what "refactoring" actually is!
For C, you don't have much problem with scope.
It is quite trivial to do a search/replace within a single function as long as new variables aren't created in nested blocks.
For C++ with namespaces and classes, it can often be an idea to change the variable name to something really silly, like 'xx1253beep' and catch all compilation errors. Then it will be possible to do a global search/replace to the final name. This makes sure that a missed rename of a variable doesn't gets resolved by a global variable with the same name.
Giving all global variables a prefix can also often help out.
"Refactor existing code making it easier to read and cheaper to maintain."
What's happened to the skill of planning what you're going to write before actually writing it?
I believe it assumes you are lazy and do not make variables meaningful when you use them. IE it assumes 'you' do this
void fnc_me(unsigned char e) { int i; i = 0; for(;i < e; i++) { if(i & 1) { s_pf("%X", i);} else { s_pf("%03d", i); } } }
In other words you obfuscate everything to loose all meaning because you are too lazy to actually write coherent code (this could be a Microsoft internal problem).
And when you need to change a routine you just recycle the variable over and over each time. So no meaning is attached to any of your code. You also don't comment etc.
Basically it makes that assumption.
It's mostly helpful when you get another project that you can't make heads or tails of (and was written like my obfuscated example I guess) and you need to change it or update it significantly.
Stephen
Ok, I began to pragram from PC software, and then to MCU. So I would like MCU develpmen environment as alomst same as PC, Also I would like new technology of coding, Maybe this make me having diffrent view from others.
About coding I think the Book of CODE COMPLETE is great, it hase hundreds pages talk about, if someone like learn some new thing, would buy it.
About IDE or some Plug-ins may look at this WEB http://www.wholetomato.com/
About 20-30% difference to my productivity, look at the advertisement in the WEB I mentioned above, it say 50 times Times saving, maybe it's diffrent from 20-30%, my math is poor
You don't honestly just believe everything you read in advertising, do you??!!
You still haven't managed to give any explanation of what "refactoring" actually is! So it's hard to beleive that it's been of any real benefit if you can't actually explain what it is!
I guess the language barrier may be an issue here but, even so, I think you should be able to explain something, or give some examples?
But, if the meaning is lost (or was never there in the first place), how can any automatic process (re-)create it?!
Isn't that just like trying to re-create 'C' source code from hex?
A 50 times time saving is 5000%.
But that would require that the developer spends a huge amount of time playing with the code after having initially written it. If the code takes 10 hours to write, you would have to spend 500 hours with it (besides debugging) to perform manual cleanup. If that time isn't available, then you can obviously not optimize it away.
If I pick up an old project, I can normally see more than 90% of the source lines having revision 1.1 in the source repository, indicating that there are very few lines that gets modified after having been initially written. That would then indicate that less than 10% of the code lines could take advantage of any code factoring. The total gain from a tool supporting code factoring would then be quite small.
When developing a product, it can be said that each step later in the development cycle that an error is caught, the cost will have increased with a factor 10. You do not want bugs or hw errors in the released product. You want to catch them during the design phase. Twice the time invested in the design phase is well invested money. And it removes the need for a lot of code rewrites during the lifetime of the product.
It is very good to have tools that helps correlating source code with the requirements specification. But it is dangerous when people looks for the source code editors that are quickest at rewriting code. Having large needs for code rewrites indicates large problems in the development process.
Yes, there is a language barrier ,Refactor is a coding technology, it's hard to explain for you, Maybe you can google to get point, or download trial from that site, to find what will happen
The automatic tools can at least allow you to rename the meaningless 'i' variable into something more describing, without accidentally touching several hundred other 'i' variables in the program.
So automatic tools helps out when the initial developer has been lazy.
If the initial variables already have 10-15 characters, then the number of clashes are few, in which case it will often be enough to do a recursive grep to find that a replace all is safe.