Seriously, Don’t Be Afraid of Code

I am loosely following the ProjectTrek example in “Beginning Microsoft Visual Studio LightSwitch Development” to create a project tracker of my own. As I was learning about calculated fields, an epiphany hit. Here it is.

LightSwitch is a great tool for modeling and displaying data, but its real value exists in its ability to empower non-coders (like me) to use code to accomplish the things they want to do when code is needed. In fact, it may be a great way to start learning how to write code.

For example, I want to add calculated fields to add total hours and total costs for a project. I can’t point-and-click to make that happen, but LightSwitch makes it very easy. All I need to do is add a calculated field to the entity (using the Computed Property button) and then click the Edit Method link in the Properties Pane for the property I just added.

When I click that Edit Method link, LightSwitch adds a method to the code for me. All I have to do is add the calculation function. Below is the code for two calculated fields. The only part I had to write are highlighted.

I didn’t know how to write those lines, but finding help on the Web is pretty easy. Also notice that LightSwitch called all the appropriate methods it needed (the first five lines) and then set up my new method for me. This may seem simple for a seasoned coder, but it probably would have taken me days to figure it out.

Advertisements
Tagged , ,

2 thoughts on “Seriously, Don’t Be Afraid of Code

  1. David H. says:

    I am a coder, a Visual Studio guy, day in and day out. I’ve really wanted to see how and where LightSwitch is being adopted but there has been so little of it out there. It is refreshing to see this new product being used for what it was intended. So many people could benefit from LightSwitch; too bad it’s not reaching them (most don’t even know about it)! Microsoft needs to market it differently, to be sure — they are placing it under our (hard-core developer) noses, but not under the noses of their target audience…you the regular power user. You are doing a service to the community with this blog. Keep it up and perhaps others will catch-on.

    • danbeall says:

      Thanks David. I should follow your advice. It is almost two months to the day since you left this comment. I am going to make a renewed effort. I have been working on another technology, but I am steering back to LightSwitch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: