Archive for October, 2009
The Dangers of Copy/Paste Coding
by Shawn on Oct.28, 2009, under Development
One of my blogging hero’s Jeff Atwood blogged about this a few months ago, but it never really hit home for me until recently. I’m a “Don’t reinvent the wheel” kind of guy, I much rather spend time
building direct business value then working on plumbing. So being the blatant rip off artist that I am I use Google for answers to things I think are common.
I stumbled upon BouncyCastle a little while ago when trying to find a way to move away from Chilkat’s encryption library to one that would allow me to compile my assembly with the “Any CPU” flag. But to my dismay they have a very limited amount, bordering on none, of the samples and documentation I needed to use their library. So I turned to my old friend Google for some answers.
What Google returned for me was a post by Havard Stranden on his blog, someone who I’ve read before and even used his Copyable software before. Havard had exactly what I was looking for, and some code examples, I was so happy. So I begun the art of copy and paste and was on my way.
I’ve started to use Unit Tests a little more then in the past. I’m not part of the religion by any means, more of an observer waiting and watching for the spiked punch to be rolled out and the show to begin. I usually use Unit Tests to fix problems or reaffirm my knowledge, because I still didn’t have a lot of information on BouncyCastle I wrapped Unit Tests around my RSA encryption and started testing.
Well some of my Unit Tests failed and some others threw exceptions. I blamed everything but the code I copied and pasted from the Internet. I changed my encoding at least 5 times, I changed my wrapping and conversion functions another 5 or so times, and so on. I wasted about a week trying to figure out what was wrong, why could I correctly encryption and decrypt a small block of test, but not a larger one.
Finally I stepped into the code, line by line and observed what was occurring, and I finally found the issue. This was the inner loop of my encryption and decryption methods, which basically chunk through and array and encrypt and decrypt each chunk. Can you guess where the problem was?
What I found out was chunkSize was going negative, or to zero, a lot. If what I was encryption was less then the blockSize, which is how many parts of the array the RSA encryption function can handle at a time, the I was good. But if it was a larger amount of data it would completely bomb out.
What I ended up with was more then I think one line can handle, but I could be wrong. Basically there were three cases I saw, and I put some if statements in to handle them.
I don’t know why I didn’t dawn on me to check my copy/paste programming first, but I’m so used to finding code that just works I rarely check to to ensure it does. The code probably was a quick sampling or a mock up and not his actually production code. I have no idea where it came from but assuming it was ‘live’ code was the wrong thing to do. When I started having problems that’s probably the first thing I should have looked at, as it was the only thing I didn’t completely understand or write myself.
So word to the wise all you Copy/Paste programmers, check from time to time to ensure the code works properly, else you could burn many hours tracking down issues.
P.S. Sorry Havard, but I don’t know the Alt code for that special A.
EULA and You
by Shawn on Oct.21, 2009, under Business, Development
An End User License Agreement or Software Agreement is a legal agreement that will accompany your software when it is distributed on the Internet. Recently I’ve been spending a fair amount of time on EULA’s and the topics come up a few times. Although I think their legality is still in
question, as I don’t believe they have been thoroughly tested in court, I still think EULA’s are a piece to your overall legal protection, along with a limited liability entity.
EULA’s are everywhere and seem to be used by everyone. But as a small business or a bootstrapping startup how can you get an EULA that you are sure will offer you some protection? As software developers I think we tend to look for an existing EULA in a product we’ve downloaded or already own and use that. Why re-invent the wheel when it’s already done. But you can get into some serious issues here.
First the law, legal language and legal formatting are all very important. You could have an entry EULA thrown out because of punctuation or capitalization, so this is something to keep in mind. Legal language in of itself can be extremely complex, from subtle meaning changes in common words to all out Latin. So DIY with an EULA can have some bad repercussions, especially because when you really need it is when it will be put to the test, i.e. in court, and that could cost you.
So what should a good EULA contain? Here are some tips you should look for in an EULA.
- Software is licensed not sold, license only
- Rights of the end user (how many computers it can be installed on, etc)
- License is valid and granted when/while it’s been paid for
- Limited Liability (you are not responsible for any damages beyond the purchase price)
- No warrantee or implied fitness
- User support/assistance if applicable
- License should be perpetual (in most cases), notice on material breach if failure to comply
- Force Majeure (Act of God) protection
- Provision ensuing that if part of the EULA is invalid, the remainder will still be in effect
- Governing Law should be your place of incorporation
- Notice with your companies contact information
This isn’t an all inclusive list, as there can be much, much more important parts of an EULA. For example if your distributing source that should be in your EULA as well to determine the extent of the rights transferred with that source.
So what is the best way of going about creating an EULA for your software? Well do you have a lawyer in the family or a friend that’s a lawyer? Well if you do beg and plead. If you can find a decent corporate law lawyer in your area I would recommend that as well. But if you can’t there are a number of sites that can help. For example LawDepot.com has and EULA that is constantly being updated. If your planning on multiple software products you can by the year version which will allow you to update and generate new EULA’s for all your products for a year, that costs between 50 and 60 dollars.
If your planning to go it completely alone you can do your research. Onecle has a list of over 5000 EULA and EULA like agreements you can view. There used to be a number of EULA generates on the web but it looks like they are all gone, which may be for the best. Also there doesn’t seems to be a nice generic EULA template to start from.
Bad Software: What to Do When Software Fails is also an interesting read. The book is a little dated now, but the underlying still holds true. Also Legal Guide to Web & Software Development from Nolo has lots of information plus some forms and agreements that can be used, including an EULA.
The bottom line, hire a lawyer if you can, else try and use a professional resource (like LawDepot or Nolo). If you can’t do that take care when crafting your EULA and compare it to the other ones out there.
The Billion Dollar Idea
by Shawn on Oct.14, 2009, under Business
I recently sat in a presentation for a cool new idea, it was well thought out and presented fairly well. As a business owner and entrepreneur myself I was interested in the business side of the idea
more then the technical side, even though the technical side was very interesting as well.
When I hear someone talk about the next big thing or the multi-million dollar or billion dollar idea they loose me almost instantly. Although you should always have an exit strategy for your business, either profit or being acquired, saying your the next FaceBook, MySpace or YouTube does a disservice to your audience if your presenting to developers or business people, they know better.
There was a point in the meeting after the presentation where we were talking about a number of different things when on the presenters, not the main one, mentioned that our input of time to the project was turn into lots of money, and he made the ‘money’ signal rubbing his thumb, pointer and middle finger. I’ve been in a lot of presentations like this one, where someone has the biggest idea ever and they want some investment, either time, resources or money. But this is the first time I actually felt insulted.
I thought to myself that he practically guaranteeing truck loads of money if we put in some time and effort; was that an effort to sway me by making me feel like an idiot if I don’t get on board? My problem with these ‘pitch’ meetings is that everyone’s idea is the best one ever. I’ve never heard someone give an honest assessment, that it’s a good idea but will take a lot of time and effort to pull it off with very little chance of success.
Just having the ‘next biggest’ thing is never enough. You have to know people or know people that know people. You have to be in the right place at the right time and even with all that you need to have some luck to go along with your good idea. If your looking for help from other people don’t talk down to them by suggesting that they will make tons of cash, this is especially true for developers. For a developer to work on someone’s project like that they either have to be friends with the person, or have to have an interest in the technology behind it. Trying to coax these people with tails of untold riches won’t get you anywhere the vast majority of the time.
It’s had to be overly critical of your own idea, but that is what is required sometimes. I never run full bore into an idea. I let it incubate and cure in my head and on paper before I start perusing it. If your looking for other to help make sure they are interested in the idea and the technology, but not the pot of gold at the end. If that’s why they are in your project they could be weighing you down.