| You are here: | About>Computing & Technology>C / C++ / C# |
![]() | C / C++ / C# |
Starting Some New TutorialsI've been asked if I would write some additional programming tutorials for people who are totally new to programming and on both Linux and Windows. These will initially be for C then C++ and C#. The emphasis will be on the fundamentals of programming such as variables, types and loops etc.
To keep the tutorials compatible for C/C++ I'll be using open source tools which include CodeLite, an excellent cross-platform IDE and the GCC compilers (g++, gcc) with MingW or CygWin (on Windows) or natively on Ubuntu. If you've not tried CodeLite, take a look. I've added it into the Linux Tools and Utilities though you can also use it on Windows if you download MingW. Thursday May 15, 2008 | permalink | comments (0) Warning! Silverlight 2.0 Beta or Visual Studio 2008 SP1 Beta?When you have two overlapping technologies, in this case Silverlight and Visual Studio, both with betas there is the risk that things won't work together. It's happened this week so you may have to make a choice. Don't go for the Visual Studio Service Pack 1 Beta (which came out two days ago) or the Silverlight 2.0 Beta. The Visual Studio SP1 Beta is quite extensive and includes support for SQL Server 2008, new ADO.NET features, improvements to the WPF designers, WCF templates for Silverlight projects, debugger support for the .NET Framework public symbols and source release, control improvements and Visual C++ improvements such as the Office 2007 Ribbon bar etc (and I'd guess the TR1 features).
Of course this depends on how much you value these features or want to wait until the full version is ready. If I'm developing software I'd prefer not to change horses mid-stream, especially if I'm working on an important development. There is nothing worse than being held up by a bug that is an artifact of a beta!
Wednesday May 14, 2008 | permalink | comments (1) Hungarian Notation or What?In case you didn't know it, Hungarian names are apparently given in the order family names first then personal name. This was the reason given for Hungarian Notation where variable names had identifiers like lpFred (Fred is a long pointer). C and C++ developers on Windows will be familar with this. It was created by was invented by Charles Simonyi, a programmer at Xerox Parc who later became Chief Architect at Microsoft. The idea was that variable names were somewhat self-documenting. This was before IDEs had nifty lookups.
I've never been a great fan of this; I'd rather have longer more meaningful names such as CurrentUserCount, where you'd expect that the variable would be an int as it's a counter. It doesn't matter which language you use, so long as you are consistent. For work I try and minimize the effort needed by future developers of my code to understand it. But I'm interested in knowing- are there any other naming conventions ( not Pascal Case or camelCase which use capitalization) that you use to simplify this sort of thing?
Tuesday May 13, 2008 | permalink | comments (1) XNA Version 3.0 Technology preview Now AvailableThis is not the full version but an early beta and if you want to start programming games (including multiplayer) for the Zune media player you'll want to try this out. If you're still on Visual C# 2005 (Full or Express versions) you'll need to move to the 2008 editions but it works with the Express editions so it won't cost you a cent. It also works alongside the 2005 editions with the XNA Game Studio 2.0 so
no uninstalling is needed.
You can download it from the Microsoft download page. At a modest 42MB it won't take too long. Monday May 12, 2008 | permalink | comments (0) My Progress With ASP.NETIt's not that it is intrinsically difficult, I think I was just trying to run before I could walk. I've just spent three days last week taking an existing partly built website in PHP and rewriting it to use ASP.NET/C#. The PHP website used a very nice free template called Multiflex-3. This was written in html and css and I'd used all the PHP tricks I
knew so that most of each web page was done with just a few lines of code and a few include files. That's the php way. But I'd been somewhat dissatisfied with PHP
over the years and so was determined to make the break and jump to ASP.NET. I even rented cheap ASP.NET 3.5 hosting and registered a domain for it. I started
on Tuesday this week and by Thursday I had a lookalike website running (though with most things unimplemented).
With ASP.NET, there are a couple of ways of doing things to simplify life; Master Pages and Themes. You create a Master Page with site logo, menus etc and then each page on the site uses the Master page and you add code to customize it. It's a bit like a master slide in Power Point. Themes let you style all the controls as well as the sites look and feel. Melding them was fun but a bit time consuming but I've now done it with both 2 column and 3 column pages. The frontpage now looks identical to the PHP one including drop down menus. That's to be expected as both these technologies ASP.NET and PHP are both server side and serve up html and css etc but it was still nice to see it! Now of course comes the rest of the hard work; databases, logins, cookies etc. My main reason for switching is that for a sophisticated web application I think C# outguns php.
Sunday May 11, 2008 | permalink | comments (1) Back to the C TutorialWith the publication of the C# strings tutorial last week, I'm now back onto C again and this tutorial will be about files; both text files and random access files. Much of my earlier programming was using random access files, particularly in the postal games area. This was in the first few years of PCs, in the late 80s when databases were just starting to appear but were very expensive so everyone rolled their own file system. I didn't actually write any database applications until late 1997 and that was using Microsoft Access mdb files..
Nowadays of course even tiny applications can use small databases like SQLite, which links all its code into the application so there is much less need for random access files. And yet I believe it's a useful programming technique to know. Saturday May 10, 2008 | permalink | comments (1) Answer to C# Programming Puzzle and Another!If you're used to C or C++ and not C#, you'd expect the compiler to whinge about the casual mixing of incompatible types but C# is more
like some scripting languages (eg PHP) in this regard. C# is actually strictly typed but is happy to compile and run this (and outputs a= David 45.60) because all objects, including number literals and types include a ToString() method. So concat works fine!
Continuing the C# oddities as I've just finished the next C# Tutorial on strings. Is there any difference between the two string variables s1 and s2 in the code below? Is the comparison true or false?
Thursday May 8, 2008 | permalink | comments (1) C# Programming PuzzleAnswer tomorrow. Without trying it, will this compile and if so what does it output?
Wednesday May 7, 2008 | permalink | comments (5) Inkscape - Open Source Vector Drawing Program Although not at version 1.0 yet, Inkscape is a quality vector drawing program not unlike Illustrator. I'm pretty dire in the artistic stakes, more technical drawing ability than artistic flair but I used to get by with DPaint back in the early 90s.
Inkscape is a vector drawing package which means that an entire image is created by millions of vectors; each something like a direction, a distance and a color. This is not the same type as the STL vector (a single array). The big advantage of vector over raster formats (bitmaps etc) is that vector can be stretched without requiring fancy pixel color interpolation schemes. As this is coded in C++ it is cross-platform (Windows, Linux, Mac and more) and you can download the source code from Sourceforge.net and see how it works. I'm very impressed just from playing with it for a short time and it's certainly earned a place in the C++ code library.
Tuesday May 6, 2008 | permalink | comments (0) Programming Challenge 11 Results PostedIf there is a problem with a programming challenge entry I try and fix it. Not to make it run faster but just to make it compile and run. Usually this is only a problem for C and C++ programmers as most C# compilers are compatible. I gave up compiling entries with Microsoft Visual C++ 6.0 a few months back because it had a few incompatibilities with the likes of GCC, though over the years I've used VC++ 6, it has been extremely popular. I suspect that there must be a C compiler that accepts variable declarations after code judging by one of the entries this month!
Incompatibilities between different compiler writers is a reflection on the detail of the language specification. Both C and C++ have the odd dusty little area where the order of things isn't defined. Anyway, thank you to everyone who entered and congrats to Chris Runyan with his scorchingly fast C++ entry. I'm ready for Challenge 12 entries!
Monday May 5, 2008 | permalink | comments (0) Display Latest Headlines | powered by WordPress |
|
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |

Although not at version 1.0 yet, Inkscape is a quality vector drawing program not unlike Illustrator. I'm pretty dire in the artistic stakes, more technical drawing ability than artistic flair but I used to get by with DPaint back in the early 90s.

