Jordan Planet

Monday, October 10, 2005

Accidentally and fortunately today, I came by a very interesting site I would like to tell you about. It is more into an “online community” for ....

Jordanian Bloggers! :D

http://www.jordanplanet.net/

At the very first glance, I was forcefully attracted to read something written to the right, I was really amazed:

Jordan Planet is a portal attempting to link different Jordanians, who share the passion of writing blogs, as well as promote and encourage blog writing in Jordan.

For a long time, I though I and my friend Zeid are the only Jordanian bloggers in the world, ya3ni who would expect to see a list of more than 40 Jordanians interested in blogging!? The site is incredible, and even more are the bloggers who listed their blogs there.

Most of you probably read blogs before, and felt the enjoyment of hearing from people. I myself enjoy reading my friend’s blog, and rush into reading any new post. Blogs are really interesting, especially those of people who live in your community! Keeping in touch with these blogs will be really fascinating, not mentioning having one of your own :)

For the past two hours, I've been navigating through blogs linked by Jordan Planet, and reading different posts. People are using their blogs for reasons other than mine! Some are posting their daily life details, others are writing some thoughts and opinions, but obviously NONE is publishing creepy programs like I do :S

This quick “overview” charged my head with ideas of what to share on my little web space. Soon, this blog will be changing into something more interesting, enjoyable, and trendy!


Minesweeper Flags Game

Saturday, October 08, 2005

This is my first VB .NET application and my first game quite a long ago. It is basically the same as minesweeper, except that your objective is to detect the mines with minimum number of trials. Some of you probably played MSN Minesweeper Flags, well: this is the single-player version!

Unfortunately, to run this game you’ll need to download and install "Microsoft .NET Framework Redistributable 2.0 Beta 2". It is a 23 MB setup package that the game needs in order to run :(

Good News is: once you install this package, you’ll be able to use other applications developed using the new .NET technology, including my future applications. Setup will automatically check whether your computer has this package or not, and will direct you to download it if necessary.

Download Minesweeper Flags 1.0 (976 KB)

Enjoy it :)

Visual Basic .NET Review (Part 2)

Saturday, October 01, 2005


Visual Basic .NET Language Features


Fully Object Oriented

Objects, Properties, Events, and even Data Types all became classes and are treated exactly the same! Programmers who used to mess with objects in VB6 will be surprised to see how efficient VB .NET became regarding object orientation! Actually, I doubt existence of a more OOP language!



Very Fast

VB .NET code runs faster than any previous version of VB. According to some tests done by a friend of mine, its speed is quite the same of C++.



Hardware Independent

VB .NET code runs on any hardware platform since it is compiled into Microsoft’s Intermediate Language (IM) and further compiled by the framework on target machines as described previously.



More like C++

VB. NET code has inherited some properties of C++. My first notes are:

  • Functions can now be overloaded.
  • Objects became classes.
  • Classes can inherit other classes.
  • User-defined data types became structures.
  • Objects now have constructors and destructors.
  • Try/Catch scheme instead of On Error statement.
  • Similar scope specification: variables declared inside inner loops are not defined outside them.



Improved IDE

Visual Basic was well known to have the best IDE (Integrated Development Environment) ever! VB .NET continues this, its IDE is more organized and user-friendly; the very sight of it will make programming even more enjoyable!



Great Controls

The .NET Framework provides a wide range of all-function controls. What is really amazing about these controls is that they are supplied by the framework itself rather than by the operating system, i.e. they can function under all platforms!



Improved Code Editor

The code editor has undergone dramatic improvements, it now automatically adjusts code as you make changes, it instantly detects syntax and some run-time errors, and it helps keep code more organized by automatic tabbing, formatting, spacing, and sub-dividing code.



No-more API

The .NET class libraries provide functions more than sufficient to establish any kind of program or application. Use of API to do work where the language couldn’t help is history. VB .NET can directly access the operating system and computer hardware.



Great Resources Support

When it comes to resources, it’s a bit like “Yummy” :D !

Using VB. NET, you can link and embed resources such as strings, icons, images, sounds, and files into your application. What’s more is that these resources are instantly added to your application as objects in the My.Resources() namespace, and you can manipulate, extract, vie, play, run them in any way you want. This support will lay path for greater multimedia applications in the future.



Automatic Saving and Loading of Application Settings

You can define some variables as “application settings”, and your program will automatically save and load them. Thus, you can easily create a settings profile for your application and have it save and load them while paying attention to what really need to be coded well instead.



Super-Integration with other .NET Framework Languages

Thanks for CLR, CLI, and CTS, VB. NET components can easily deal with components developed using other members of the .NET platform. This comes really comforting especially for those who have a personal experience with the pains of transferring data across components developed with different languages.



Up-to Date

VB6 had disabilities dealing with new software, like versions of Microsoft Office newer than 97, and Microsoft Windows XP. VB .NET is more fitting now.


Visual Basic .NET Review (Part 1)

Saturday, October 01, 2005

Two years ago, I got the 2003 version of Visual Studio .NET, I was quiet surprised by the changes Microsoft made to its so-called visual studio. Visual Basic was my ultimate programming tool, and I should have started learning VB .NET immediately. Still, I was waiting for something more. I didn’t want to engage myself in learning a new “still under-development” programming language.

Since then, I hear all the time about the framework, and how it is becoming different from anything that ever existed in the field. It is only a week ago that I got VB .NET 2005 Express Edition, and it turned to be really worth waiting for :)

“The .NET Framework is the next iteration of Microsoft's platform for developing component-based software. It provides fundamental advances in runtime services for application software. It also supports development of applications that can be free of dependencies on hardware, operating system, and language compiler.”

Below are some paragraphs from “Programming Visual Basic.Net” by Dave Grundgeiger, a good book although a bit out of date now. In Part 2 of the review, I’ll highlight some of the new features of VB .NET.


Common Language Infrastructure (CLI) and Common Language Runtime (CLR)

At the heart of the .NET Framework is a new mechanism for loading and running programs and managing their interactions. This mechanism is described in the Common Language Infrastructure (CLI), a specification for a runtime environment that allows software components to:

  • Pass data between each other without regard to the programming language in which each component is written.
  • Execute on different operating systems and on different hardware platforms without having to recompile the high-level source code (a low-level compilation still automatically occurs on the target platform).

Although the CLI specification was created by Microsoft, it has since been submitted to the ECMA standards organization (http://www.ecma.ch), which now has responsibility and control over it.

The CLI is just a specification—it has to be implemented in order to be useful. An implementation of the CLI is known as a Common Language Runtime (CLR). Microsoft's CLR implementation on the Windows platform is not under ECMA's control, but it is Microsoft's intention that the CLR be a fully compliant implementation of the CLI.

The CLI specifies how executable code is loaded, run, and managed. The portion of the CLR that performs the tasks of loading, running, and managing .NET applications is called the virtual execution system (VES). Code run by the VES is called managed code.


Intermediate Language (IL) and Just-In-Time Compilation (JIT)

All compilers that target the CLR compile source code to Intermediate Language (IL), also known as Common Intermediate Language (CIL). IL is a machine language that is not tied to any specific machine. Microsoft designed it from scratch to support the CLI's programming concepts. The CLI specifies that all CLR implementations can compile or interpret IL on the machine on which the CLR is running. If the IL is compiled, compilation can occur at either of two times:

  • Immediately prior to a method in the application being executed.
  • At deployment time.

In the first case, each method is compiled only when it is actually needed. After the method is compiled, subsequent calls bypass the compilation mechanism and call the compiled code directly. The compiled code is not saved to disk, so if the application is stopped and restarted, the compilation must occur again. This is known as just-in-time (JIT) compilation and is the most common scenario.

In the second case, the application is compiled in its entirety at deployment time. IL is saved to .exe and .dll files. When such a file containing IL is executed, the CLR knows how to invoke the JIT compiler and execute the resulting code.


Common Type System (CTS)

The CLI specification defines a rich type system that far surpasses COM's capabilities. It's called the Common Type System (CTS). The CTS defines at the runtime level how types are declared and used.

Previously, language compilers controlled the creation and usage of types, including their layout in memory. This led to problems when a component written in one language tried to pass data to a component written in a different language. Anyone who has written Visual Basic 6 code to call Windows API functions, for instance, or who has tried to pass a JavaScript array to a component written either in Visual Basic 6 or C++, is aware of this problem. It was up to the developer to translate the data to be understandable to the receiving component. The CTS obliterates this problem by providing the following features:

  • Primitive types (Integer, String, etc.) are defined at the runtime level. Components can easily pass instances of primitive types between each other because they all agree on how that data is formatted.
  • Complex types (structures, classes, enumerations, etc.) are constructed in a way that is defined at the runtime level. Components can easily pass instances of complex types between each other because they all agree on how complex types are constructed from primitive types.
  • All types carry rich type information with them, meaning that a component that is handed an object can find out the definition of the type of which the object is an instance. This is analogous to type libraries in COM, but the CTS is different because the type information is much richer and is guaranteed to be present.