Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

Enough TextMate Talk, Go Write Some Code

May 9, 2011 by Rob Bazinet 2 Comments

Tweet

It seems every few months I hear another diatribe about using Vim or Emacs and switching from TextMate. ?The usual reason for switching from TextMate is because version 2.0 hasn’t shown up yet. ?So what?

Watt Martin has been providing some interesting and unbiased thoughts on text editors lately with a couple of interesting posts. ?The first, Text Editor Intervention:

I love you all, but it?s time to stage a text editor intervention. Put down the mouse, back away from that download link, and take a deep breath.

First off: if you are a Mac user and compatibility with TextMate is an absolute must-have, let me ask you two questions. Is TextMate 1.5 still working for you? Can you keep living with its limitations? If you answered both those questions ?yes,? our work is done here. Go in peace.

I use TextMate daily, it does everything I need. ?I don’t need to code faster or have a half-dozen split screens open. ?My aging mind can only process code so fast and having split screens open, is not going to help me. ?But that is just my preference. ?Many new editors have popped up on my radar recently like Sublime Text and Redcar, which refer to their TextMate support as Watt points out:

Those of us who cling tenaciously to TextMate do so because of its amazing bundle system; you really have to spend time digging into it to understand how powerful it is. BBEdit, Vim and Emacs all require you to learn a weird scripting language; TextMate lets you write in any language you can script a Unix shell with, from bash to Ruby.? The flip side of that, though, is that TextMate?s bundles are?with few exceptions?limited to passing standard input and environment variables to a shell script and getting standard output back. With BBEdit and the Ugly Unix Twins, you can attach scripts nearly everywhere, with deep access to the underlying editing engines.

The new editors popping up are attempting to be the next TextMate, to attract the users now running TextMate. ?It is a testament to TextMate, trying to imitate what works.

If your editor works fine for you and gets the job done, why do we feel pressured to move on to something else because it is under more active development? ?Actually, I regularly see new minor updates for TextMate. ?People were promised version 2.0 and because it hasn’t arrived they feel compelled to jump ship. ?This is probably the single silliest reason I have ever heard of for subjecting oneself to a steep learning curve to a new editor.

My opinion about text editors is ignore everyone and go with what works for you. ?I’ve tried MacVim, but wasn’t productive enough up-front for my taste and there was no pressing reason to switch. ?If I had to, I would probably commit to the effort of learning Vim once and for all.

Stop worrying about when TextMate 2.0 will be out and go write some code already.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming Tagged With: macvim, redcar, sublime, textmate, vim

Writing with Agile Style

March 31, 2011 by Rob Bazinet Leave a Comment

Tweet

143571757 ba4415ea00

I love writing.

When I am not writing software I like to step away and work on something for this blog or for something more involved for InfoQ. ?I often think I might like to do it full-time if I could make a reasonable living from it, but that’s unlikely.

I didn’t realize what felt so good about writing until recently when I was thinking of post topics. ?I get a thrill from pushing a new post or article out, a real sense of satisfaction. ?When hitting the “Publish” button I get a true sense of accomplishment, that I have added just a bit of value to the world. ?This is what makes Twitter so powerful, 140 character maximum posts at a time. ? Quick and easy.

I think the satisfaction equates to coding as well. ?I will be the first to admit I sometimes wait too long to get a set of features out, just holding off for “one more thing”. ?As we have all heard before, release early and release often. ?I know when I have a quick fix and get it out, it feels good, so why not do this all the time. ?This is what the Agile folks preach.

So, it’s important to get stuff out there, off your plate. ?The blog post doesn’t have to be nominated for a Pulitzer Prize, that code doesn’t have to be an entirely new application. ?Small wins can be big for your confidence and motivation, they are for me.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming Tagged With: Agile, writing

Where Are We Without Community?

September 24, 2010 by Rob Bazinet 2 Comments

Tweet

communityI came across a really interesting blog post yesterday with a recurring theme.? It was by developer Dave Newman titled, Leaving .net.? Does it sound familiar?? It does to me and after reading Dave?s post, the reasons are a familiar sound.

So many .NET shops have their heads buried in the sand, developing mounds of software with antiquated principles:

A company I worked at once had been operating for years under the assumption that it was OK for software to take months to integrate and deploy; they had never heard of continuous integration. They thought it was normal to rewrite your application from scratch every 2 years; they had never heard of Test Driven Development or iterative development. These techniques have been proven to significantly raise the bar on quality, cost of development, cost of maintenance and general morale. Turns out you can still find, in this day and age, software practitioners who haven?t even heard the terms.

It has been shown that Test Driven Development (TDD) improves code but it seems the .NET community fails fully embrace the concept.? I have been part of many .NET projects where stakeholders simply refused to spend the time doing TDD, not when deadlines need to be met.? They were simply too naive to know that deadlines would still have been met but with better code.

My last .NET project was led by a developer who was the master of ?not invented here? syndrome.? The project was a unique eCommerce application originally architected 5 years earlier and consisted of some complicated code.? The developer, who didn?t want to spend the time to learn the system, wanted to rewrite the code his-way so he could understand it.? His way was easily worse and did not take into account all the side effects his way may have introduced.? I am glad I am not the only one to witness this:

I have also seen on numerous occasions developers build their own libraries and frameworks to solve well understood problems in curiously terrible ways. The endless rebuilding of data mappers, logging code, object resolution mechanisms, messaging systems and web frameworks adds up to a massive waste of time, effort and potential. I?m not talking about public collaborative efforts, I?m talking about in house ?Not invented here? syndrome. This is what happens when you have a community cut off from the world. A community that doesn?t talk to each other and work together. This is what the .net community is.

Communities exist everywhere but none stronger than those in the open source world.? I can?t think of a more diverse and deep group of developers than those using Ruby.?? Developers in this community rally around each other, support each other and the projects they create.? If there is no support, no community development the project simply dies off.? One can use Ruby on Rails as a great example, go ready it 1600 contributors.? This is project done for the community by the community, not reinventing the while but improving it.

Has Microsoft ever done anything like this?? No. The closest I can think of is IronRuby and they have since turned their back on that project.?? Microsoft tends to treat developers as something to be fed, who pushes out updates as fast as possible to get the pack on to the next thing.? If you look at Silverlight going from v1.0 to 4.0 in a blaze or WCF moving fast to its current state, developers can keep up.? Most of the time we can?t keep up because we are fed and are not allowed to also cook, like in the Ruby community.

This is the same with ASP.NET MVC:

Last year Microsoft released a new web framework called MVC. It?s not new by web standards, it?s not even new by .net standards as the Monorail project had been alive for years before. Yet people were waiting for it. People were waiting for Microsoft to deliver it to them. There were already open source MVC web frameworks and an army of .net developers who could have collaborated to make them great but nothing much happened. It took a handful of developers at Microsoft to make their own framework and now MVC is the hot new thing.

But they did not:

This new web framework is better than the previous one and is quickly becoming the de-facto. Microsoft released the source. Someone created a github repository. This repository is being watched by 30 people and 5commits have been made to it. 5 commits! Why is this number so horrendously low? Because Microsoft don?t take patches. They?ll release a new version of MVC without anyone?s commits. Worse than that, everyone will start using their new version and the github repo will just start again.

The little community that exists for Microsoft wants to see success but Microsoft won?t let them.? Microsoft doesn?t believe in community, they may say they do but actions speak louder than words.? In the end, they are only hurting themselves.

Microsoft has been touting open source for a while now, not because they want to but because they think it will improve their bottom line.? Isn?t that what they?re all about?

Imagine if Microsoft would have opened up ASP.NET MVC completely and let the community create it?? Yes, I know they released the source, but that does not make the project open source.? Open source means they take contributions from the community and the code is created and owned by the community.? Big difference.

Why Leave .NET?

Well, for one, to make a statement.? If all .NET developers accept the status quo, nothing will change.? Secondly, to see what it looks like from outside the .NET world, how other developers live and breath.

You don?t have to actually leave the technology, maybe explore others and gain some experience.? The experience could make you a better developer and bring back something to .NET, possibly to help Microsoft become aware of a better way.

Where to go?

Well, almost anywhere else.? I like the Ruby community but I have heard Python has a great community.? I would bet almost any open source community will welcome you.

What?s the answer?

I developed C# code since it?s inception and wrote many lines of C++ using Microsoft Visual C++ before that.? These are really good technologies and we can?t just write them off.

I hear developer?s stories all the time, how they dropped .NET and moved to technology X.? The Ruby community itself contains many ex-.NET developers who have seen the light.? How can we make Microsoft see the light?? I don?t know we can, they need to be looking.

It comes down to this, Microsoft is losing without a community.? I am referring to the passionate community, like the 1600 who created Ruby on Rails.? I think as more and more developers gain experience and see how other communities function, they will leave and move on.? It won?t be overnight but it will happen unless Microsoft is willing to change.

So to answer the question, where are we without a community?? The answer is no where.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming Tagged With: ASP.NET MVC, Community, Microsoft, Open Source, Ruby on Rails

App Inventor for Android, VB Revisited

July 12, 2010 by Rob Bazinet 2 Comments

Tweet

Google announced a new product today, App Inventor for Android.  This is a development environment for creating applications on Android, only you don?t need to be a developer, says Google:

You can build just about any app you can imagine with App Inventor. Often people begin by building games like WhackAMole or games that let you draw funny pictures on your friend’s faces. You can even make use of the phone’s sensors to move a ball through a maze based on tilting the phone.

But app building is not limited to simple games. You can also build apps that inform and educate. You can create a quiz app to help you and your classmates study for a test. With Android’s text-to-speech capabilities, you can even have the phone ask the questions aloud.

To use App Inventor, you do not need to be a developer. App Inventor requires NO programming knowledge. This is because instead of writing code, you visually design the way the app looks and use blocks to specify the app’s behavior.

Here is App Inventor in Action:

Is this the new Visual Basic?

I think we saw this before with Microsoft?s introduction of Visual Basic.  Visual Basic was an environment for just about anyone to create applications for Microsoft Windows.  Sure, it was used a TON and created a rich marketplace but it also created a lot of really bad software with really poor code bases which were hard to maintain.  I think a few readers probably still have their fair share of VB 6 code out in the wild.

I saw so many applications created by dragging-and-dropping controls on a form by business people, farm-hands and anyone else who cared to pick-up a mouse.  These applications were often toys created by mort.

Dave Winer of Scripting News, agrees this may not be the thing for the marketplace.  He certainly has seen technology come and go:

This idea of a once-and-for-all development tool is like the Divining Rod of the Olde Days. Perpetual Motion. The goose that laid the golden egg. The fountain of youth. Shangri-la. Bigfoot. The Loch Ness Monster. Cold fusion. The Singularity!

Jeff Jarvis and The Quark of Programming also offers an interesting perspective:

Will App Inventor yield lots of crappy apps? Of course, it will, just as Quark enabled sinful design and Blogger wasted bits. That is true of all such technologies that lower the barrier to entry to a former domain of priests. That?s precisely what the printing press did. As much as the web breaks down priesthoods, it created new ones. Developers are merely the latest. They say that mortals can?t do what they do. But what if they could? What if they could translate a thought not just into words and design but into action?

I imagine Marc Benioff of Salesforce.com going positively batshit over this, enabling businesses to create apps for, say, their sales teams to manage and share information about and with clients. I imagine small businesses using App Inventor to create apps like Chipotle?s that enable customers to make burrito orders before they arrive. I imagine teachers being able to make exercises and quizzes in apps (forget the electronic textbook; give me the electronic workbook!).

I think Jeff is right, there will be a lot of crappy applications created.  This could be a huge problem too.  Let?s say the Android app store skyrockets to 1,000,000 applications, how would you ever filter out the junk from the good?  It would be nearly impossible.  As it is, Apple has a pretty stick policy to filter apps fro there store and it is still hard to find an application never mind a good one.

On the other hand, from a business perspective, this is a potential great move by Google to create a ton of new applications for their store.  In one fell swoop they can have developers and non-developers creating applications for their store.  I speak from experience, it is not trivial to create iPhone applications, certainly not something a non-developer could easily tackle.

I would love to see a tool like this succeed, but I have seen others fail.  Why should App Inventor be any different?

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming Tagged With: App Inventor, Google, Visual Basic

Picking up some Python

April 27, 2010 by Rob Bazinet 4 Comments

Tweet

I have been using Ruby and various .NET languages for a long-time but the coming flood of deep architecture changes coming to Ruby on Rails 3.0 has drawn my attention to other web frameworks such as Django and the Python language.

The attention everyone gives to Ruby on Rails has resulted in a wealth of Ruby and Ruby on Rails books to the point of becoming overwhelming.   This is not the case with Python and Django, the number of books is a lot less.

Zed Shaw is one developer who made the transition from Ruby to Python and is putting out a learning Python book of his own titled Learn Python the Hard Way.  The book is being made available on Zed?s web site and is free.

Zed also points out some other great resources for learning Python:

I really quickly wanted to get the word out about two books that are so far looking to be great beginner Python books.

  1. How To Think Like A Computer Scientist is actually used as the curriculum at a few universities in the US and maybe in other locations. Despite the title it is actually good introduction to the language and to programming.
  2. A Byte Of Python is also free and has been translated to [a huge number of languages](http://www.swaroopch.com/notes/Python_en:Translations and also seems to a good first book.

This is really interesting approach to writing a book; collaborative and open.  There is a wiki set up to help facilitate the collaboration.

Python is a great language with rich history and wealth of good libraries.  It?s used heavily all over the world and has deep community support, well worth a look and considering how good Django is for web applications.  Who knows maybe worth a look instead of Ruby on Rails.

Technorati Tags: Python,Rails,Ruby,Django,Books

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

Google helps put a stake in the IE6 coffin, finally

February 6, 2010 by Rob Bazinet 16 Comments

Tweet

If you are a web developer, you know the pain that is Internet Explorer 6. You know how hard and tedious it is to add support for IE6 to your web application and maintain it once released.ie6trash.png

All of the recent browser improvements to Chrome, Safari and Firefox give developers the opportunity to create very rich browser-based applications leveraging HTML5 and JavaScript. The recent announcement from Apple that the new iPad will not support Adobe Flash say a lot, HTML5 is the future.

When the major browser developers standardize on these technologies, our jobs as web developers will begin to get a bit easier. I received an email from Google recently which reflects their stance:

Dear Google Apps admin,​

In order to continue to improve our products and deliver more sophisticated features and performance, we are harnessing some of the latest improvements in web browser technology. This includes faster JavaScript processing and new standards like HTML5. As a result, over the course of 2010, we will be phasing out support for Microsoft Internet Explorer 6.0 as well as other older browsers that are not supported by their own manufacturers.

We plan to begin phasing out support of these older browsers on the Google Docs suite and the Google Sites editor on March 1, 2010. After that point, certain functionality within these applications may have higher latency and may not work correctly in these older browsers. Later in 2010, we will start to phase out support for these browsers for Google Mail and Google Calendar.

Google Apps will continue to support Internet Explorer 7.0 and above, Firefox 3.0 and above, Google Chrome 4.0 and above, and Safari 3.0 and above.

Starting this week, users on these older browsers will see a message in Google Docs and the Google Sites editor explaining this change and asking them to upgrade their browser. We will also alert you again closer to March 1 to remind you of this change.

In 2009, the Google Apps team delivered more than 100 improvements to enhance your product experience. We are aiming to beat that in 2010 and continue to deliver the best and most innovative collaboration products for businesses.

Thank you for your continued support!

Sincerely,

The Google Apps team

This announcement is actually huge, in my opinion, because IE6 is the single browser that haunts web developers daily. Once IE6 is gone we can settle down and forget it once and for all. Google has a nice advantage here, so many people use Gmail, Google Docs and other Google Apps everyday that they will be force to upgrade to a modern version of IE or switch to a different browser altogether, great for us.

The news here seems to finger IE6 but it also notes removal of support for other older browsers too. Good times ahead.

Technorati Tags: HTML5,Internet Explorer 6,JavaScript
HTML5, Internet Explorer 6, Javascript, Programming

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

I Am Not a Master but a Solutionist

January 11, 2010 by Rob Bazinet Leave a Comment

Tweet

I stumbled upon an interesting essay by Zed Shaw recently titled "The Master, The Expert, The Programmer" pointed out by Avdi Grimm. One part that stuck out in my mind was this excerpt:

What I notice is that my peers are progressing to more and more complicated and convoluted designs. They are impressed with the flashiest APIs, the biggest buzzwords, and the most intricate of useless features. They are more than happy to write endless unit tests to test their endless refactoring all the while claiming that they follow XP’s “the simplest thing that works” mantra. I’ve actually seen a guy take a single class that did nothing more than encapsulate the addition of two strings, and somehow “refactor” it to be four classes and two interfaces. How is this improving things? How can more somehow equal simpler? This should never be the case.

These are the actions of an expert. These experts are very smart, capable, and skilled, but they are too busy impressing everyone to realize that their actions are only making things worse for themselves. In the end all of their impressive designs are doing nothing but making more work for themselves and everyone around them. It’s as if their work is only designed for getting them their next job, rather than keeping them in their current one.

I agree and have always thought the same. I have seen people turn something simple into something complex that will be difficult to maintain. One of my previous enterprise clients produced solution after solution which was so complex that adding a field to a form took a day with all of its levels of indirection.

So many programmers are like sheep, they follow the herd because they think they should and feel if they don’t they will be left behind. In my opinion, developers should stand back from the crowd and be an individual and do those things that work for them.

Personally, I will do the simplest thing I can do to solve a problem within the constraints of the problem domain. This is my best interest because I can better maintain code later and it is the best interest of the client because it costs them less and more likely someone else can support it later.

Solutionist

I currently am working on a project that is filled with tests, some created in TDD fashion, some created after the fact. It seems to me, from someone coming in from the outside, that these tests were created for tests-sake and done for the right reasons. The tests are spread out across the project and are not complete and don’t cover all of the necessary business rules. When I look at this it seems like it was a waste of the clients money. If we can’t rely 100% on what the tests are actually testing, then why do them at all?

I am also working on a project with very little tests, almost none. This project works very well and shows almost no ill-effects of not having a test suite. I will not get into a holy TDD war, it’s not my point. I’m just pointing out how two diverse projects from a test perspective can provide value.

I look at the work I have done over the years, some with full test suites and some without and realize what was done was done with a certain business situation in mind. We don’t live in a perfect world business is not perfect, projects aren’t perfect and neither are solutions.

We are solutionists and we do the best job we can from the experience we have garnered and what the client can afford. I think this is an important point here, we can’t really bang our fist on the table demanding TDD from a client who may not have the budget.

I think we should be creating the simplest solutions we can to fit the needs, and budget of the client. If simple is a one form application, then do it. If simple is a 20 form application with full test suite, then do it. Simple is what gets the job done.

Technorati Tags: TDD,Freelancing,Ruby on Rails
 

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

Mindscape LightSpeed an O/R Mapper Done Right

November 23, 2009 by Rob Bazinet 50 Comments

Tweet

Anyone who reads this blog knows I work with quite a bit of different technologies, some I love and some I just tolerate.  One of the technologies I love is Ruby on Rails, for many different reasons, but one huge reason is the way it allows the developer to interface with a database.   When I create a Ruby on Rails application with even a single migration, I have access to my database tables as objects in my application with very little work.

Now transition to the life of a .NET developer.  Someone given the task of creating a database application with the job of simply adding, updating and deleting records from a database is faced with many choices with very few offering the elegance of a tool like Ruby on Rails.

I was hired recently to create a new web application which required it to be written in ASPNET with C#.  This gave me the opportunity to look at all the key aspects of the application and the first to get stuck in my mind was data access.  Which tool to use on .NET?

I write both Ruby on Rails and ASP.NET applications and transitioning between the two is often difficult when faced with the plethora of ways to access data in .NET, most seem to be more complicated than necessary. 

Microsoft Data Access

Technologies created by Microsoft only seem to make it to market if they are complicated and cumbersome to use, these include:

ADO.NET – Using stored procedures for example.

LINQ to SQL – In my opinion, a real clumsy attempt to give a way to access almost anything by a query language implemented in C# or VB.NET.  You can see by example that no one should have to write these things all day:

var q =
from c in db.Customers
where c.City == "London"
select c;
foreach (Customer c in q)
Console.WriteLine(c.CompanyName);

Entity Framework – Oh please.  I have only given this technology a cursory look and just have to shake my head in disbelief that Microsoft would create such a mess of complexity, but they do complexity best.

Non-Microsoft Data Access

There is hope though for developers wanting something better.  Technologies like SubSonic and NHibernate offer very different solutions to Microsoft’s vision of how data access should be done.  Both of these are open source projects and have their strengths and weaknesses, and both have their own learning curve.  I have spent some time with SubSonic and it is good product with active development.  I can’t say I have done very much beyond the experimentation stage with NHibernate but I know many folks who love it.

I had been a bit oblivious to work being done with data access and object relational mapping (ORM) in the .NET space.  I came across one tool from Mindscape, a New Zealand based company, with an ORM tool called LightSpeed.  I was a little reluctant because of my assumed learning curve and could not have been more wrong.  This is a commercial product but Mindscape offers a free version that is full-powered but only allows for up to 8 database tables, which would be fine for smaller projects or to try it out.

After speaking with some other developers who have been using LightSpeed I decided it was the right tool for the job.

LightSpeed in Action

The project I had in mind was indeed a new project but I inherited an existing SQL Server 2005 database full of tables.  This application will consume many of the existing tables read-only but we create new tables to store our application-specific data.

This is not a tutorial on how to use LightSpeed but how I am using the tool.  I am sure there are many ways to configure the tool to use the data most efficiently.  I am sure the purists will complain about doing model-driven design, but I don’t care.   I was looking for a tool to get up and running with the least effort, we will tweak later.

LightSpeed comes with a really nice designer which allowed me to pick and choose various tables I wanted to use in my application.  Notice how the designer picks up the existing relationships from the database:

LightSpeedDiagram

Once the designer is saved it quickly creates some very clean C# to represent the schema in code.   A few entries in the web.config and everything is ready to write some code.  Mindscape has a nice Getting Started screencast which shows how easy it is to go from zero to code.  The screencast is just over 11 minutes long and is enough to get up and running.  

Setup Code

A bit of setup code in my application gives us access to our database and a place for our objects to interact with:

        private LightSpeedContext<UnitOfWork> _context;

 

        public LightSpeedContext<UnitOfWork> Context

        {

            get

            {

                if (_context == null)

                {

                    _context = new LightSpeedContext<UnitOfWork>

                                   {

                                       ConnectionString =

                                           "Data Source=.;Initial Catalog=terminal_link;User Id=dbuser;Password=xxxx;",

                                       PluralizeTableNames = LightSpeedContext.Default.PluralizeTableNames,

                                       IdentityMethod = LightSpeedContext.Default.IdentityMethod

                                   };

                }

 

                return _context;

            }

        }

 

Once we have a Context property setup this will be the basis for all database access.  Notice it is created only once.

Retrieving Entities

All the code is very simple but does a lot.  We need an entity here for a certain ID and we are using the LightSpeed method of query, you could just as easily use LINQ queries.  I choose to stay away from them and use the cleaner method of retrieving an entity object.

        public TltForeman GetForemanByWorkId(string workId)

        {

            using (UnitOfWork uow = Context.CreateUnitOfWork())

            {

                return uow.FindOne<TltForeman>(Entity.Attribute("ForemanId") == workId);

            }

        }

Creating Entities

Passing in an instance of our entity, adding to what is referred to as a UnitOfWork and just calling SaveChanges does the job.

        public void AddForeman(TltForeman foreman)

        {

            using (UnitOfWork uow = Context.CreateUnitOfWork())

            {

                uow.Add(foreman);

                uow.SaveChanges();

            }

        }

Deleting Entities

Deleting is as simple as adding, pass an instance of our entity and remove from the UnitOfWork and SaveChanges and the entity is gone.

        public void DeleteForeman(TltForeman foreman)

        {

            using (UnitOfWork uow = Context.CreateUnitOfWork())

            {

                uow.Remove(foreman);

                uow.SaveChanges();

            }

        }

Finally

This tool is really a pleasure to use.  I don’t know if I am partial to it because of my work with Ruby on Rails or just the beautiful simplicity, but it is worth a look.   Don’t get me wrong, it does not lack features but its features don’t get in your way.  I can tweak all I want, something the Rails community refers to as convention over configuration.

The amount of time to go from database to working application was cut probably almost in half.  No stored procedures were created in the making of this application.  This fact alone should be a good enough reason to move from traditional designs to using an ORM to avoid stored procedures and save some time.

Why should managing data from an application in .NET need to be such a task, which is one we repeat over and over.  Using LightSpeed has eased the pain to get an application done rapidly and is a welcomed tool to my toolbox when I need to get .NET work done.

 

Technorati Tags: Mindscape,Mindscape LightSpeed,ORM,O/R Mapper

 

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

Gone are the Days of Simple Developer Tools

October 14, 2009 by Rob Bazinet 18 Comments

Tweet

originalfox I read with interest a post by Ted Neward titled "Agile is treating the symptoms, not the disease".  I will leave you to read the post in its entirety but point out Ted is paraphrasing a talk he attended with the speaker saying:

Keeping track of all the stuff Microsoft is releasing is hard work: LINQ, EF, Silverlight, ASP.NET MVC, Enterprise Library, Azure, Prism, Sparkle, MEF, WCF, WF, WPF, InfoCard, CardSpace, the list goes on and on, and frankly, nobody (and I mean nobody) can track it all.

This is so true.  Microsoft used to chase the small developer is not chasing the enterprise and in doing so has created all of these complex pieces.

I think I understand Ted’s point.  Today’s tools are overly complex, built up over the years on top of existing layers upon layers of functionality.  Even new tools and frameworks built from the ground up try to jam all the functionality of an older tool times 5 over.

Gone are the days were we used great tools like DBase IV, FoxPro and Clipper to create business applications.  It is very true these applications were created by 1-2 developers, not huge teams.

Do our tools today need to be so complex to justify a software development practice such as Agile or Lean to help us make efficient use of these tools?  The answer is probably.  We need these methodologies to keep ourselves honest to make our software work as we promised within all those moving parts in the frameworks.  Even radical tools such as Ruby on Rails requires much finagling with its core and the plethora of open source gems that a suite of tests is needed to make sure we are delivering what we promised.

It’s true, this was not the case in the FoxPro days, we created some really valuable applications for businesses to solve their problems and they worked well.  We did not have fancy test suites (no automated ones at least) to make sure things didn’t break when we added features.  We didn’t need to because the software was not that complex.

Maybe it’s hard for some people to understand what may be interpreted as a negative trend in our tools and frameworks.  The reason may be because those folks have not been around software development long enough see it.  This isn’t to say they are inexperienced, but just have not experienced the simpler tools of yesterday.  As Ted eludes to, he has several people he cares about that are old enough to understand:

Others, including many people I care about (Rod Paddock, Markus Eggers, Ken Levy, Cathi Gero, for starters) made a healthy living off of building "line of business" applications in FoxPro, which Microsoft has now officially shut down.

Phil Haack had a good post as a rebuttal to Ted, which Ted kindly replied to.  I felt like I was watching a tennis match while reading the posts.  I am not trying to get involved in the debate other than to say I understand and agree software development has become complex.  I admit I am an old-timer in software development years and miss doing projects in FoxPro.  Maybe I am just nostalgic.

There do exists a few tools I am aware of which lets small teams create software with minimal fuss:

  • REALbasic – development tool for Mac, Windows and Linux
  • Alpha Five from Alpha Software

I think smaller, faster and simpler tools are a great idea, maybe these tools are worth a look.  Could we being seeing a niche developing?

Technorati Tags: Microsoft,Software Complexity,FoxPro

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

Kicking Your Coding into High Gear

July 7, 2009 by Rob Bazinet 18 Comments

Tweet

kicking I finished reading the great book by Chad Fowler, The Passionate Programmer. This is a fantastic read and got me thinking about various aspects of my professional life. One of the best pieces of advice in the book which too few developers actually follow is from Chapter 15: Practice, Practice, Practice.  The premise of the chapter is that developers should always be practicing their craft and honing it into a fine instrument.  We don?t become a professional simply because we have a job,  but by the attention we pay to our individual skills.

It is common for a developer to go out and buy a book on a new programming language they want to learn and go through the book?s examples, only to come away feeling a bit empty.  We as developers do not learn best this way, we learn by doing.  When professionals are asked what they recommend in order for people to become proficient in a new programming language, they say create ?something?.   Go out and pick an idea and create that application.

This was how college courses teach programming; concepts and language constructs are shown and then a problem is given to be solved.  This is the perfect example that we learn best by doing.

What if you don?t have any ideas which seem reasonable to start?  The idea of just setting out to create ?something? can be a barrier to entry in itself.

Thankfully, there are several great web sites with the sole purpose of exercising our minds and helping us become better programmers.  The web sites present the reader with problems to solve with a range of difficulty.

Ruby Quiz

Ruby Quiz has been around for a while and includes 156 puzzles with at least one but often multiple solutions for each problem.  Although it appears RubyQuiz has not published a new problem since February 2008, it is still a great source of problems to solve.  RubyQuiz is designed to provide solutions in Ruby but the problems are solvable with any language which might make a good exercise to see which language creates the most elegant or beautiful solution.

Some of my personal favorites are:

  • Yahtzee
  • Sodoku Solver
  • Math Captcha
  • Scheduling
  • Word Search
  • IP to Country

I like these because the provide some practical value and are interesting.  Thanks to Srdjan Pejic for pointing out that Ruby Quiz is still alive and continuing to be updated.  The current count is at 212 quizzes.

Code Kata

Chad recommends Code Kata which was done by Dave Thomas of the Pragmatic Programmers and is explained as:

Code Kata is an attempt to bring this element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many different ways. Some are open ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer. I add a new kata every week or so. Invest some time in your craft and try them.

The Code Kata series, consisting of twenty-one problems of varying complexity, addresses problems we might face in our daily lives as developers.

One interesting example and clever approach to presenting a problem is Kata Nine: Back to the Checkout.  This Kata requires the developer to create a checkout that might be used in a grocery store.  Dave gives the reader what the input data might look like:

Item   Unit      Special
Price     Price
--------------------------
A     50       3 for 130
B     30       2 for 45
C     20
D     15

What the interface needs to be:

The interface to the checkout should look like:

   co = CheckOut.new(pricing_rules)
co.scan(item)
co.scan(item)
:    :
price = co.total

And a set of unit tests so the developer knows what the code should do:

class TestPrice < Test::Unit::TestCase
def price(goods)
co = CheckOut.new(RULES)
goods.split(//).each { |item| co.scan(item) }
co.total
end
def test_totals
assert_equal(  0, price(""))
assert_equal( 50, price("A"))
assert_equal( 80, price("AB"))
assert_equal(115, price("CDBA"))
assert_equal(100, price("AA"))
assert_equal(130, price("AAA"))
assert_equal(180, price("AAAA"))
assert_equal(230, price("AAAAA"))
assert_equal(260, price("AAAAAA"))
assert_equal(160, price("AAAB"))
assert_equal(175, price("AAABB"))
assert_equal(190, price("AAABBD"))
assert_equal(190, price("DABABA"))
end
def test_incremental
co = CheckOut.new(RULES)
assert_equal(  0, co.total)
co.scan("A");  assert_equal( 50, co.total)
co.scan("B");  assert_equal( 80, co.total)
co.scan("A");  assert_equal(130, co.total)
co.scan("A");  assert_equal(160, co.total)
co.scan("B");  assert_equal(175, co.total)
end
end

Each Kata is not only a different problem but each also teaches different aspects of real-world programming whether it be unit tests, decoupling or multiple approaches to a problem. 

Project Euler

Project Euler is yet another set of problems for developers to solve with code. The web site describes Project Euler as:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

There are a total of 252 problems with a range of difficulty with all being mathematical or computer science in nature.  These types of problems exercise our math skills along with our abilities to create algorithms.  Each problem lists now many people solved each problem:

ProjectEuler

Each problem has a very brief description or requirement, Problem #7 ? Find the 10001st prime:

EulerProblem7

As you can see, you won?t be mired in requirements but only a simple and brief description of the problem at hand.  These problems seem to take longer than the others as they are more involved but worth it.

Top Coder

Another way to flex your coding muscle is by competing against others while learning from others.  Top Coder has been around for a while and offer many types of competitions open to the public or customized for a company.

One of their contests is the annual TopCoder Open which is already over for 2009 but you can an idea of what is all about from the contest web site.

Rails Rumble

An additional coder competition is Rails Rumble which you probably guessed uses Ruby on Rails. 

The Rails Rumble is a 48 hour web application development competition. As a contestant, your team gets one weekend to design, develop, and deploy the best web property that you can, using the awesome power of Ruby and Rails.

Contestants, as they are called, enter from varying skill levels and can come as a team to compete by creating a web application over a two-day period.  This is a great way to learn from others who are more experienced as well as meet many great developers which could result in a long-term relationship.

Rails Rumble 2009 is in August so get going on entering.

Source Code

Although coding problems are great for sharpening the skills you have there are other ways to build skills.  I think the single best way to improve ones code is by looking at the code of other people.  There is virtually an unlimited supply of code out in the open source world just free for educating yourself.  Just go to GitHub and start searching and poking around what?s there, pull down some projects and see what others are doing.  You will learn a lot doing this very simple exercise.

Dan Pickett points out that a great way of improving ones coding skills would be to get involved in an open source project.  Fellow contributors make great reviewers who can help improve your code.  I could not agree more.

Finally

I think the best way to learn is by doing, and these are some good places to start.  I am sure there are plenty of other sources of challenge like this on the web, please pass them along in comments and I will update the post.

My personal preference is the coding problems like those in Ruby Quiz, Code Kata and Project Euler.  They give a wide selection of problems that can be solved right at home when the time is available.

I have been doing some of these problems in my spare time but being reminded how important the exercise is from The Passionate Programmer made me want to write this post.  This is an important book and every developer should read it to give ideas about your careers or reinforce the ideas you have already.

Technorati Tags: Programming,Top Coder,Project Euler,Code Kata,Ruby Quiz

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Filed Under: Programming

« Previous Page
Next Page »

Recent Posts

  • Social Media Times Are Changing
  • It has certainly been a long time…
  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Everything I read these days mentions ChatGPT or AI as the answer to everything. So many red flags. I hate trends l… https://t.co/ITLxsfAvd9
    about 1 week ago
  • If anyone knows any projects looking for some dev help, mainly Rails, as a lead who can manage small teams…I’d love… https://t.co/u0ClZ8x5wB
    about 3 weeks ago
  • This is such the truth…Even Amazon can't make sense of serverless or microservices https://t.co/0zK9YVMdrj
    about 4 weeks ago
  • I’m not sure I’d subscribe to content on Twitter when I already follow someone. Maybe I’m missing something.
    about 1 month ago
  • This looks really cool and a great real world use of AI. https://t.co/DzX5BbgDdY
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon