Copy & paste is not a code reuse strategy

Code reuse is an admirable goal for any developer.

Being able to re-use well written well tested code is a good thing.

Especially if you can reuse it across multiple facets of one project, or across several projects.

And I wouldn’t be surprised if a lot of people start out reusing code using copy paste from one place to another.… Read the rest

All good things come to an end

Some time ago Bob had said he would let the domain registration for BKeeney Briefs lapse. Today it finally came home to roost.

Trying to visit gets you one of several things.

What I got was a domain name squatter site trying to sell me the name.

Sad to see that finally happen but with Bob’s employment changing from contractor to full time employee its not surprising.… Read the rest

Bit in the ass by API 2

Was tracking down a bug in my app and couldnt figure out what was wrong initially.

All the code seemed right but setting a value to code like

value = string.ToInteger

seemed to be the culprit. Sure enough the string contained a value like 3.0e+2 (an integer expressed in exponential form) But the docs say

String.ToInteger

Read the rest

Survey

If youre one of the people who didnt get the Xojo Experience survey there’s one thats a lot alike at INN

Filetype help

On the forums someone is looking for a way to identify what kind of file they are dealing with. And then a way to “sort” knowing those types.

The suggestion given is to look at each extension in a simple way

But, you can get away without ever having to look at the extension. Folderitem already assigns a TYPE IF there is a filetype defined that matches.… Read the rest

Help keep your code sanity

Ever think to yourself “Oh I have this project to do and I’ll just cut and paste the code from there and tweak it?” And now you have two copies that are a lot alike but maybe not exactly the same.

And then you do this over & over and now you have many copies of that code?… Read the rest

Labelling

A long time ago I was in a BEd\Bsc program at University.

It was supposed to end with me having two degrees. One Degree in Education and one in Computer Science. But the two faculties couldn’t agree on the course of studies over 5 years. And when I got to year 5 it turned out both expected me to do at least one more full year in each faculty.… Read the rest

Coincidence

Sometimes you want classes to have a common API.

But rather than adding a common super class or interface to define that common API, you just make sure your classes have the same methods, events, properties & whatever else you feel is necessary to make them have “the same API”.

I would suggest you rethink doing this.… Read the rest