Tag: c#

Implementing Base 36 in your iOS App

Implementing Base 36 in your iOS App

Base 36 can be a great way to represent a number with up to 8 alpha numeric characters. If you have an auto number and don’t want to represent it with just a number, you can convert it Base 36 to make it look a little sexier. Wikipedia has a great overview of the technology Base 36.

To convert a number to Base 36 you can use this c based algorithm

static char *base36enc(long unsigned int value)
{
	char base36[37] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	/* log(2**64) / log(36) = 12.38 => max 13 char + '\0' */
	char buffer[14];
	unsigned int offset = sizeof(buffer);
 
	buffer[--offset] = '\0';
	do {
		buffer[--offset] = base36[value % 36];
	} while (value /= 36);
 
	return strdup(&buffer[offset]);
}

Calling this from Objective-C and get the string value

char *wo = base36enc(someint)
NSString *stringValue = [NSString stringWithUTF8String:wo];

There you go. Pretty simple to use in your Objective-C app.

The use of C# will continue to fall, along with the eventual extinction of VB.NET

The use of C# will continue to fall, along with the eventual extinction of VB.NET

C# is a modern programming language that runs on the Microsoft.NET Framework. Just a few years ago being a C# developer allowed you to use your skills across multiple technologies that were in relatively high demand. You can use C# writing a desktop application using WinForms or WPF, or write the server side code for web site using ASP.NET or ASP.NET MVC. A developer could also write a rich internet application with Silverlight technology in C#. Things have changed in the last few years as many of these technologies are becoming irrelevant.

With Windows 8 coming onto the scene Microsoft has de-emphasized the desktop experience, wanting users to do most of their work with Windows 8 applications in the tile mode. Desktop based browsers are slimming down and halting support for some third party plugins. The combination of this shift has left WinForms, WPF and Silverlight out in the cold. What’s left for developers on the PC is Windows 8 apps, which can also be written in javascript or C++. Windows 8 apps are not a priority for most companies as Windows 8 still has a very small tablet market share.

Windows 8 Phone is another potential target for C# developers, but with market share in the low single digits there isn’t much demand for developers writing a Windows 8 Phone app. Windows Phone 8 now also supports native C++ apps, and I’m guessing they won’t want to be supporting Silverlight on the phone for future versions.

Server side C# for ASP.NET MVC web applications is still very popular as many companies are still running Windows based servers. This will slowly shift as more companies move their servers from on-premise to cloud hosted. Many new web sites are written in mostly javascript with the rise of rich client side frameworks like Angular and server side technology with node.js. Which leads me to my point about the extinction of VB.NET…

Nobody writes VB.NET on the server! If they do, they probably don’t belong in our society.

It will be interesting to see what Microsoft does with C# in the coming years. It’s already a very powerful and flexible language so they may well leave it alone for a while. On MSDN C++ has been getting a lot of love in their monthly tech how-to articles. It seems they are trying to steer developers to use C++ as their primary language choice.

A recent article on Dr. Dobbs has C# as a rising language, but I don’t think it can keep holding its own with the main uses being Xamarin and MVC server side code.

As a developer who is strong in .NET and relies on that technology for a career, it will be worth taking a look at where you think the market for developers is headed. I believe that if you are strong in javascript, Objective-C, Swift, C++ and Java your future looks brighter than only knowing C#. One of the challenges developers face is keeping up with technology and adapting. This is clearly a time for .NET developers to realize what they can do to still keep their skills competitive and in demand.