<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PC Pro blog &#187; C</title>
	<atom:link href="http://www.pcpro.co.uk/blogs/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pcpro.co.uk/blogs</link>
	<description>Blogging in the real world</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:54:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The hard facts: what languages web developers should learn</title>
		<link>http://www.pcpro.co.uk/blogs/2010/05/06/the-hard-facts-what-languages-web-developers-should-learn/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/05/06/the-hard-facts-what-languages-web-developers-should-learn/#comments</comments>
		<pubDate>Thu, 06 May 2010 11:43:59 +0000</pubDate>
		<dc:creator>Kevin Partner</dc:creator>
				<category><![CDATA[Online business]]></category>
		<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[web developers]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=15973</guid>
		<description><![CDATA[When I first started learning programming, choices were limited to machine code or a version of BASIC. But then I am ancient.
In many ways, the newcomer to programming who’s aiming at web or mobile development has a much better time of it today. This is because whilst there are many, many languages to choose from, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-15979" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/05/silverlight_v_web-156x175.jpg" alt="SL_logo_v" width="156" height="175" />When I first started learning programming, choices were limited to machine code or a version of BASIC. But then I am ancient.</p>
<p>In many ways, the newcomer to programming who’s aiming at web or mobile development has a much better time of it today. This is because whilst there are many, many languages to choose from, they have much more in common than languages of the past. Learn ActionScript, for example, and you’re half way there with C#, PHP and JavaScript, as their basic constructs are identical.</p>
<p>But the real value you, as a web developer, can bring to a project is specialist skill. Whilst every good PHP developer understands the basics of C#, no web project can be completed without in-depth knowledge, and this takes time and lots and lots of practice to develop. It’s a huge investment so the choice of which language to specialise in is also critical, at least in the short- to medium-term.<span id="more-15973"></span></p>
<p>If you’re aiming to develop your own web applications, you can choose whichever language flies your kite. I develop in PHP, JavaScript/jQuery and Flex/Flash Builder because I like them. PHP is my absolute favourite, and I tend to use that alongside jQuery unless I need the super-rich application features that only Flex/Flash can deliver. My brother, on the other hand, is a massive fan of C# and either language is perfectly capable of creating sophisticated web applications.</p>
<p>If you want to hire yourself out you need to make a more pragmatic choice about which development tool to specialise in and one way to do this is to look at the demand for each. <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">According to the TIOBE Programming Community Index for April 2010</a>, the venerable trinity of C, Java and C++ are the most widely used and requested programming languages. This is mainly because of the huge quantity of legacy code that needs to be managed within large corporations. PHP is the top web scripting language with C# around half of PHP’s level and Python and Perl next. Objective-C, the language used for creating iPhone applications, still only accounts for a tiny fraction of the programming market but is massively on the rise.</p>
<p>So, for web development, PHP is the most popular language (note, I did not say “best”). That’s all very well but I rather suspect that there are more programmers working in PHP than any other development language, which means the competition is huge. We need to know the ratio between popularity and competition.</p>
<p>I went to freelance recruitment site <a title="Guru.com" href="http://www.guru.com/" target="_blank">Guru.com</a> and, for each language, found out the number of projects posted for each of the common web and mobile platform development languages. I then noted how many freelancers/companies offered each language. By dividing one into the other, we end up with a rough idea of how competitive the market for expertise in each language is. For example, when I checked there were 151 PHP projects on Guru and 7,769 providers. This means that there are 51.45 providers for each job.</p>
<p>Here’s the full list:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="177" valign="top"><strong>Tool</strong></td>
<td width="170" valign="top"><strong>Providers/Jobs</strong> (low is better)</td>
</tr>
<tr>
<td width="177" valign="top">Android</td>
<td width="170" valign="top">1.86</td>
</tr>
<tr>
<td width="177" valign="top">iPhone</td>
<td width="170" valign="top">3.39</td>
</tr>
<tr>
<td width="177" valign="top">Silverlight</td>
<td width="170" valign="top">14.44</td>
</tr>
<tr>
<td width="177" valign="top">Flex</td>
<td width="170" valign="top">38</td>
</tr>
<tr>
<td width="177" valign="top">PHP</td>
<td width="170" valign="top">51.45</td>
</tr>
<tr>
<td width="177" valign="top">ASP/ASPX</td>
<td width="170" valign="top">52.5</td>
</tr>
<tr>
<td width="177" valign="top">Ruby</td>
<td width="170" valign="top">83.8</td>
</tr>
<tr>
<td width="177" valign="top">Python</td>
<td width="170" valign="top">90.3</td>
</tr>
<tr>
<td width="177" valign="top">Flash</td>
<td width="170" valign="top">90.9</td>
</tr>
</tbody>
</table>
<p>What leaps out immediately is that the competition ratio for mobile development is much lower than for web development, and within that Android development is almost twice as attractive a market as iPhone development.</p>
<p>Looking at the web development languages, it looks as though Flash, Python and Ruby development are markets that are saturated with developers chasing relatively few projects. PHP and ASP (which includes ASP and ASPX) are neck-and-neck but the head and shoulders winners are Flex and Silverlight. Whilst there are relatively few projects, there are also few developers.</p>
<p>So which should you choose? Looking at these ratios, it seems to me that choosing either PHP or ASP development with Visual Studio for creating standard web applications is a good initial approach. PHP has the advantage of being free to install and develop for (there are plenty of free IDEs) whereas skills developed in C#, for example, are also transferrable into desktop development. The other benefit of developing in the Visual Studio environment is that adding Flash-like functionality is simply a matter of extending your existing C# skills so that they use the Silverlight player.</p>
<p>From the purely commercial point of view (and if you assume that Silverlight will, eventually, succeed as a technology in becoming as ubiquitous as Flash Player) the Visual Studio approach has a lot going for it: C# becomes a single language that can be used on the desktop, for creating standard .aspx web applications and for developing Silverlight applications.</p>
<p>For me, however, PHP is unbeatable when it comes to productivity, and Flash Player is way ahead in terms of browser installations so, at least for now, I’ll be sticking to this combination. My advice to a newcomer to programming, however, would probably be to download Visual Studio 2010 Express and try C# for size – it may well, finally, be the future Microsoft always intended it to be.</p>
<p>On the other hand, with the forthcoming release of Adobe Air for Android and the low competition level for Android development, Flex has suddenly become a very credible development environment for that platform. You pays your money&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/05/06/the-hard-facts-what-languages-web-developers-should-learn/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The joy of interfacing</title>
		<link>http://www.pcpro.co.uk/blogs/2008/04/24/the-joy-of-interfacing/</link>
		<comments>http://www.pcpro.co.uk/blogs/2008/04/24/the-joy-of-interfacing/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 17:21:54 +0000</pubDate>
		<dc:creator>David Fearon</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Interfacing]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/2008/04/24/the-joy-of-interfacing/</guid>
		<description><![CDATA[
So anyway, get yourself into your time machine and set it for sometime around 1986. Once you get there, pop on your invisibility cloak, find someone who looks spoddy and follow them into the dining room. See that BBC Micro in the corner? Pop over and give the top a quick tug. Chances are it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2008/04/_mg_3579.jpg" alt="Prototype interfacing. Not pretty, but it works." height="302" width="428" /></p>
<p>So anyway, get yourself into your time machine and set it for sometime around 1986. Once you get there, pop on your invisibility cloak, find someone who looks spoddy and follow them into the dining room. See that BBC Micro in the corner? Pop over and give the top a quick tug. Chances are it&#8217;s not screwed down.</p>
<p>That&#8217;s because, in the old days, computers were for hobbyists with soldering irons, and they were forever taking the tops off to install new circuit boards they&#8217;d made.</p>
<p>Doesn&#8217;t happen much anymore, of course &#8211; you might pop the side off once a year to install a new graphics card, but most people wouldn&#8217;t consider actually building new hardware to go inside their computer. And for very good reason: the insides of a modern PC are massively more complex and to build an add-on part yourself that would actually be any use is more or less impossible.</p>
<p>Thing is though, designing and connecting your own hardware to a PC, while unlikely to win you admiring glances from the opposite sex, is bloody good fun. Fact. I&#8217;ve been tinkering with the whole area again for the past year or so &#8211; for reasons I may document at some point &#8211; and it turns out that there&#8217;s a massive array of components that are relatively easy to interface to a PC and do interesting things with.<span id="more-130"></span></p>
<p>So here&#8217;s what I&#8217;ve done: I&#8217;ve interfaced a <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1335&amp;dDocName=en010532">Microchip MCP3202-C</a> analogue-to-digital converter IC to the parallel port of a PC. And <em>voila</em>, I can use the computer to directly measure any analogue voltage between 0 and 5 volts. In fact I can measure two lots of voltages since the 3202 is a dual-channel device.</p>
<p>Now, the ability to measure some voltage or other doesn&#8217;t sound terrifically interesting <em>per se.</em> But it is! Because there&#8217;s a vast array of sensors and transducers out there, which measure all sorts of fascinating things about the real world like temperature and pressure and position and humidity and <em>everything</em>. And guess what their output is? Yes! Very often these devices produce an analogue voltage, and very often it&#8217;s between 0 and 5V (since 5V is kind of a universal logic voltage).</p>
<p>It&#8217;s certainly not as easy as it used to be to connect your computer to the real world. The BBC Micro, for instance, was specifically designed for interfacing and you didn&#8217;t even need any external circuitry to measure analogue voltages &#8211; you just used the analogue input ports on the back and read the voltage directly from BASIC with the ADVAL statement.</p>
<p>To get my 3202 ADC chip talking to a PC, I first had to add a little bit more buffer circuitry, to get the anaemic voltage levels coming out of its parallel ports to look a bit cleaner. But that&#8217;s only a single logic chip, costing about 20p (the 3202 itself <a href="http://uk.farnell.com/1196794/semiconductors/product.us0?sku=MICROCHIP-MCP3202-CI-P">currently costs £2.25</a> from <a href="http://www.farnell.co.uk/">Farnell</a> if you&#8217;re only buying one or two).</p>
<p>Next, I abandoned Windows and installed <a href="http://fedoraproject.org/">Fedora Linux</a>. Why? Because Linux has the joy of a predictable, stable tool-chain for programming, and it comes with a C compiler and everything you need for programming. It&#8217;s a geek&#8217;s OS and it&#8217;s set up for geeks to tinker with straight away. And if everything you need isn&#8217;t there in your particular installation, chances are all you&#8217;ll need to do is issue a command something like this:</p>
<p style="font-family: courier,sans-serif">sudo apt-get install gcc</p>
<p>And off Linux will go, ferreting out the gcc C compiler and all the necessary extra components. Also, of course, it&#8217;s free. And I wouldn&#8217;t dream of installing Windows on a PC when I didn&#8217;t have the correct license.</p>
<p>With that done, I had to decide on a programming environment. Java is my language of choice &#8211; it&#8217;s the best language on the planet and those people who talk about its nightmarishly complex class libraries are all wrong, honest &#8211; so Sun&#8217;s brilliant (and free) <a href="http://www.netbeans.org/">Netbeans IDE</a> was the only sensible choice.</p>
<p>You may be seeing the problem looming. Java is a high-level language deliberately abstracted from the hardware it runs on, meaning that getting the low-level access I needed to interface with my ADC chip wasn&#8217;t going to happen with Java alone. That meant one thing: JNI, the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jni/">Java Native Interface</a>, which allows you to write native C code and glue it to a Java method. That means fast, native access to the hardware combined with a lovely high-level language to write the graphical front-end for my app.</p>
<p>Only problem with JNI is that it&#8217;s hideous. I mean truly hideous. It&#8217;s badly implemented and appallingly documented and it took me a week of trial and error actually to mangle my C code for reading the ADC chip into a form that JNI could work with. But eventually I got there.</p>
<p>There&#8217;s nothing quite like getting really deeply into the binary operation of a chip. The 3202 IC uses a simple serial protocol called SPI to communicate with the outside world. So I had to sit down with <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/21034D.pdf">the datasheet</a> in hand and write a routine in C that would directly communicate with the chip in binary, by waggling the voltage level of three of the PC&#8217;s parallel-port pins between 0 and 5V. Fairly amazingly, once I&#8217;d sorted out the JNI thing it worked first time. My Java graphical front-end can get the voltage levels and display them any way I like, and the hardware can manage a sample rate of about 2,000 readings per second, if I happen to want to measure something that fast.</p>
<p>Not as easy as with a BBC Micro then, but here&#8217;s the thing: BBC Micros used to cost about a month&#8217;s wages, so the chances of dedicating one to measuring the temperature in the greenhouse were always going to be pretty slim. A little Mini-ITX motherboard &#8211; which is what I&#8217;m using for my project &#8211; is only about £100. That means you can use one as a hardware appliance and dedicate it to the task of measuring, well, whatever it is you want to measure. And it&#8217;s the matter of an evening or two&#8217;s work to configure a web server and write some code so that you can communicate with it from anywhere and see what it&#8217;s been getting up to.</p>
<p>All a little bit pointless? Well, maybe. Fun? Depends on your proclivities I suppose. But it makes me happy.</p>
<p>So, who wants a feature in PC Pro about how to do it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2008/04/24/the-joy-of-interfacing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

