Why Refactoring Support in a JavaScript IDE Is so Important

image.png

As I’m building out a new version of the Silicon Valley Code Camp web site in AngularJS, I’m running into the very common case where I have not created my program files hierarchy optimally.  What I have now (as seen from JetBrains WebStorm) is the following: I realize now that I’m adding the login screen that I really should have an app folder account and registration should be a subfolder of that.  To make that change without a good tool (like WebStorm), I would need to go into my file manager and copy the files I want, then go into my index.html file and manually change all those directory references.  Likely (because I’m not that good at that kind of work) I’d make at least one mistake and have to come back and revisit … Continue Reading

A Quick Thank you and At-A-Program For Resharper and Refactoring

image.png

I had the following line embedded in an initializer: EmailAlerts = String.IsNullOrEmpty(emailAlerts) ? false : emailAlerts.ToLower().Equals("true"), Resharper says (“Simplify conditional operator”)     I say sure, ReSharper does EmailAlerts = !String.IsNullOrEmpty(emailAlerts) && emailAlerts.ToLower().Equals("true"), Clean, Elegant.  I’ve had some posts like this criticized in the past with comments like “Well, if you can’t do that on your own you shouldn’t be programming”.  My reply: “I could have, I didn’t, It did, and I like it better.   That’s it for now. … Continue Reading

CodeIt.Right Takes Refactoring To The Next Level

image.png

Background I’m a big believer in using refactoring tools to help improve the quality of the code I right.  I just added another tool to my arsenal called CodeIt.Right from submain.  I can’t say for sure whether the other tools commonly used will somehow perform the refactoring I’m going to show, but I can say I really like how CodeIt.Right does it.  When I say it takes it to the next level, what I mean is it shows me things I know I should be doing (or in this case I’m fixing code that I got from someplace else.   As it turns out, the place I got it from was Microsoft’s samples for building Windows Store 8 apps.  If you want to find the original code, take a look at the WindowsBlogReader example to find the … Continue Reading

LINQ and “Possible Multiple Enumerations of IEnumerable” Warning / Resharper To the Rescue!

In the most recent version of Resharper 7 from JetBrains, the brilliant team has gone one step above and beyond.  Not only do they show this error which can be quite tricky to both understand and fix, but they now go one step further and offer a fix. For example, look at the below code: var emailDetailInfos = new List<EmailDetailInfo>();using (var db = new SiteDB()){ foreach (var emailDetailId in emailDetailIds) { // first get details about this particular email var emailDetail = db.EmailDetails.FirstOrDefault(a => a.Id == emailDetailId); if (emailDetail != null) { // get all the Details associated including the htmlbody if there is one (that is, images and body) var details = (from ed in … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: