Keyword Counts of Popular Programming Languages

Keys.

In a previous post, 10 Problems with ‘Hello World”, I made a remark that a ‘Hello World’ program only teaches you on average a single keyword. Without doing any research, I asserted that there are hundreds or thousands or keywords in a given programming language – until someone called me out on it.

What I found couldn’t be further from the truth.

Based on a list of the Most Popular Programming Languages, I researched how many keywords and reserved words each language had. I am certain my counts are not exact and depending on specific implementations and versions of languages – the keyword counts may vary.

Here are my findings in descending keyword/reserved word count:

VB.NET

Keyword/Reserved Word Count: 159

AddHandler AddressOf Alias And AndAlso
As Boolean ByRef Byte ByVal
Call Case Catch CBool CByte
CChar CDate CDbl CDec Char
CInt Class CLng CObj Const
Continue CSByte CShort CSng CStr
CType CUInt CULng CUShort Date
Decimal Declare Default Delegate Dim
DirectCast Do Double Each Else
ElseIf End EndIf Enum Erase
Error Event Exit False Finally
For (in For…Next) For Each…Next Friend Function Get
GetType GetXMLNamespace Global GoSub GoTo
Handles If Implements Imports In
Inherits Integer Interface Is IsNot
Let Lib Like Long Loop
Me Mod Module MustInherit MustOverride
MyBase MyClass Namespace Narrowing New
Next Not Nothing NotInheritable NotOverridable
Object Of On Operator Option
Optional Or OrElse Out Overloads
Overridable Overrides ParamArray Partial Private
Property Protected Public RaiseEvent ReadOnly
ReDim REM RemoveHandler Resume Return
SByte Select Set Shadows Shared
Short Single Static Step Stop
String Structure Sub SyncLock Then
Throw To True Try TryCast
TypeOf…Is UInteger ULong UShort Using
Variant Wend When While Widening
With WithEvents WriteOnly Xor #Const
#Else #ElseIf #End #If

Source: http://msdn.microsoft.com/en-us/library/dd409611.aspx


C++

Keyword/Reserved Word Count: 144

registerreinterpret_castreturnsafecastsealed

__abstract __alignof __asm __assume __based
__box __cdecl __declspec __delegate __event
__except __fastcall __finally __forceinline __gc
__hook __identifier __if_exists __if_not_exists __inline
__int16 __int32 __int64 __int8 __interface
__leave __m128 __m128d __m128i __m64
__multiple_inheritance __nogc __noop __pin __property
__raise __sealed __single_inheritance __stdcall __super
__thiscall __try/__except __try/__finally __try_cast __unaligned
__unhook __uuidof __value __virtual_inheritance __w64
__wchar_t wchar_t abstract array auto
bool break case catch char
class const const_cast continue decltype
default delegate delete deprecated dllexport
dllimport do double dynamic_cast else
enum event explicit extern false
finally float for for each, in friend
friend_as gcnew generic goto if
initonly inline int interface interior_ptr
literal long mutable naked namespace
new noinline noreturn nothrow novtable
nullptr operator private property protected
public ref selectany short signed
sizeof static static_assert static_cast struct
switch template this thread throw
true try typedef typeid typename
union unsigned using uuid value
virtual void volatile while

Source: http://msdn.microsoft.com/en-us/library/2e6a4at9(v=VS.100).aspx


C#

Keyword/Reserved Word Count: 98

abstract as base bool break
byte case catch char checked
class const continue decimal default
delegate do double else enum
event explicit extern false finally
fixed float for foreach goto
if implicit in int interface
internal is lock long namespace
new null object operator out
override params private protected public
readonly ref return sbyte sealed
short sizeof stackalloc static string
struct switch this throw true
try typeof uint ulong unchecked
unsafe ushort using virtual void
volatile while add alias ascending
descending dynamic from get global
group into join let orderby
partial remove select set value
var where yield

Source: http://msdn.microsoft.com/en-us/library/x53a06bb(v=VS.100).aspx


PHP

Keyword/Reserved Word Count: 56

abstract and array() as break
case catch cfunction class clone
const continue declare default do
else elseif enddeclare endfor endforeach
endif endswitch endwhile extends final
for foreach function global goto
if implements interface instanceof namespace
new old_function or private protected
public static switch throw try
use var while xor __CLASS__
__DIR__ __FILE__ __LINE__ __FUNCTION__ __METHOD__
__NAMESPACE__

Source: http://php.net/manual/en/reserved.keywords.php


Java

Keyword/Reserved Word Count: 53

abstract continue for new switch
assert default goto package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while
true false null

Source: http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html


Ruby

Keyword/Reserved Word Count: 42

BEGIN END __ENCODING__ __END__ __FILE__
__LINE__ alias and begin break
case class def defined? do
else elsif end ensure false
for if in module next
nil not or redo rescue
retry return self super then
true undef unless until when
while yield

Source: http://www.ruby-doc.org/docs/keywords/1.9/


Javascript

Keyword/Reserved Word Count: 29

break const continue delete do
while export for function if
else import in instanceOf label
let new return switch this
throw try catch typeof var
void while with yield

Source: http://www.aptana.com/reference/html/api/JSKeywords.index.html


Python

Keyword/Reserved Word Count: 29

and del for is raise
assert elif from lambda return
break else global not try
class except if or while
continue exec import pass yield
def finally in print

Source: http://docs.python.org/release/2.3.5/ref/keywords.html


If you find any errors or omissions, please let me know. If there is a particular language I did not include, please share the keyword/reserved word source and I would be happy to add it.

Tagged with: , , , , , , , ,
Posted in Technical

My Experience at Orlando Code Camp 2011

As a follow up to last years post: My Experience at Orlando Code Camp 2010, I thought I would share my experience at Orlando Code Camp 2011.

This year I took away a lot more, compared to last year as I tried expose myself to more variety by focusing on the Showcase sessions and not sessions that were “how to do this with < insert technology here >”.

There was a great variety of tracks this year:

  • Showcase
  • Fundamentals
  • Web
  • Azure
  • Design and Animation
  • Languages
  • Patterns
  • Services & More
  • Collaboration
  • Visual Studio & ALM
  • Silverlight
  • SQL Server
  • Windows Phone 7
  • DotNetNuke Development
  • DotNetNuke Design
  • DotNetNuke Administration

I know that Code Camps are Microsoft-centric, but the one thing that continues to bother me (I see it at .NET User Group meetings also), is the Microsoft Fanboy attitude.

Sorry, I do not think that Windows Phone 7 is an “iPhone Killer” nor is it an “Android Killer.” I also refuse to use Bing as my primary search engine – Google works just fine thank you. It was comforting to see some iPads and MacBooks among the attendees.

Orlando Code Camp Keynote

Orlando Code Camp Keynote

Here is the breakdown of each session I attended:

Session 1

Applied Object-Oriented Design Principles

Presented by: Jay HIll

Jay presented several design patterns that are based on Bob Martin’s SOLID Principles.

Take Away: There are many design patterns that can be used in practice that extend beyond those originally written by the Gang of Four.

  • Null Object Pattern – this is the assurance that you will never receive a NULL object, therefore avoiding the dreaded ArgumentNullException.
  • Enumeration Classes
  • – a way to extend basic enums and prevent enum growth.

  • Nested Classes
  • – a reason to use nested classes in your code.

  • Composite Pattern
  • – treating objects as if they are a single instance.

Links

Code Quota


Session 2

Decoupled UI

Presented by: Page Horton

Page demonstrated an application that completely separates the UI from Business Logic.

Take Away

Links

pagehorton.com


Session 3

Visual Studio 2010 Tips and Tricks

Presented by: Sean Laberee

Sean demonstrated several new features and shortcuts available in Visual Studio 2010.

Take Away: The Extension Manager can be used to install additional functionality into Visual Studio 2010. Including:

  • Start Page Project Template
  • Productivity Power Tools
  • Visual Studio Color Theme Editor

Session 4

Intro to MVC 3

Presented by: Ken Tucker

Ken demonstrated creating a MVC website that went a little bit beyond the MVC Tutorials at ASP.NET.

Take Away: MVC 3 can be added to Visual Studio 2010 by installing the Microsoft Web Platform Installer 3.0.

Links:


Session 5

Design for Developers: Bad Design Kills Good Projects

Presented by: Diane Leeper

Diane demonstrated six things that can decide the fate of your web project.

Take Away: Developers are typically not known for their design capabilities (see 10 Resources for Design-Challenged Programmers), so it was a wake-up call to hear things from a designers standpoint.

Links


Session 6

Meet the Visual Studio Team!

Presented by:

  • Adrian “Spotty” Bowles – Compilers QA
  • Prakash Balasubramanian – Compilers QA
  • Sayed Ibrahim Hashimi – VS Web PM
  • Kevin Halverson – Compilers QA (VB/C#)
  • Sean Laberee – Editor/VB/C# IDE PM

Visual Studio Team

The Visual Studio Team answered audience questions:

Question: What does a Program Manager do?
Answer: A Program Manager is the “voice of the customer” who tries to understand what the end-users want.


Question: When is the next version of Visual Studio due out?
Answer: The typical version lifecycle for Visual Studio is 18 months.


Question: How is Microsoft moving towards combining the functionalities of Expression Blend and Visual Studio?
Answer: They are looking to make Expression Blend more developer friendly and Visual Studio more designer friendly.


Question: Where can I report issues or make suggestions?
Answer: Microsoft Connect


Question: Are there plans to include Silverlight or XNA updates in Web Platform Installer?
Answer: No, Silverlight and XNA have a different product lifecycle than Visual Studio.


Question: Why is Visual Studio 2010 so slow?
Answer: The Visual Studio team is currently looking at ways in to improve memory management. Other factors could be:

  • Running VS 2010 in Windows XP – doesn’t support video hardware acceleration
  • Installation of multiple extensions
  • Windows Forms Designer is known to leak memory on rebuilds



Question: Will future versions of Visual Studio support Design view of MVC projects similar to Web Forms?
Answer: The Visual Studio team is currently looking at ways to display a view in design mode.


Question: Will Visual Studio be offered in the cloud – similar to Office 360?
Answer: See Try F# from Microsoft Research.


Question: Will the next version of Visual Studio include the Ribbon?
Answer: Not in the short-term. The next release will have more simplified menus. Future releases will have a variation of the ribbon, but won’t be identical to the one found in MS Office.


Question: What can I do to prevent repositioning of windows after compiling?
Answer: Visual Studio 2010 supports multi-monitor support. Also the window positions will vary in Design Mode vs Debug Mode.


Overall, it was a great experience to expose myself to different approaches and ways of thinking that are presented in a classroom setting rather than a book or a blog.

If you have the opportunity to check out a Code Camp near you, I highly recommend it.

Tagged with: , , , , , , ,
Posted in Technical

Write Your Own Programmers Credo

Star Wars Greedo

There’s an old joke that’s been floating around the web for over 10 years called: Computer Programmer’s Credo #73, which says:

Documentation is like sex:
When it is good, it is VERY good;
and when it’s bad, it’s still
better than nothing at all.

Putting humor aside, if you examine Computer Programmer’s Credo #73 – it describes something that all computer programmers face at one time or another.

Think about the last time that you worked on or inherited code that didn’t belong to you. How many times did you ask yourself:

Why did this person write this in this particular way?”

or

Is there a reason why they chose to implement this so inefficiently?

If the original author of the code is still around, you could ask them – but what are the odds that they would remember why they did it? Without having documentation in code, all you can do is read the code at face value.

What exactly is a credo?

A credo is more than a cute little saying about a particular subject matter. It is best described as a philosophy or words by which you live or work.

I assume the author of the Computer Programmer’s Credo #73, was somebody who had to constantly modify or rewrite code that wasn’t his or hers. If the author appreciated good code documentation, does this mean that he or she implemented the same practices in his or her own code?

A credo should be something that you strongly believe and actually implement in your habits. It is not a complaint about how someone else does something, but you also do that same something at one point or another.

Get Started with Your Programmers Credo

Think about what you appreciate about programming:

Do you:

  • Appreciate good code documentation?
  • Implement best practices?
  • Design your code for reusability?
  • Learn new programming languages and frameworks
  • Encourage Jr. programmers to grow and learn from Sr. programmers

These are just a few questions that you can ask yourself about your programming habits.

Take a few minutes to write down several things that you as a programmer believe as your philosophy. Just keep in mind that whatever you write down, should be something that you practice.

Tagged with: , , , ,
Posted in Leadership