Visual Basic.NET Training Example - vb.net

We'll soon have some high school kids here in our company for some training lessons in programming for about 1 1/2 days.
We decided to do Visual Basic.NET and thought about programming a little calculator with the four basic operators.
Considering the fact that they will be here for only 1 1/2 days, this application might be "too" complex to be taught in this time range.
Do you have any ideas of what else can be taught in such a short time?

I'd say 1.5days for a calculator by a complete novice is about spot on actually.
You could set the task as a simple 4-operator to be a target. If they surpass this they can add more complex functions. If not then it could simply be just for adding for example. The complexity is expandable depending on the student.

Simplefied version, only plus and minus. Or a leet/1337 translator, only requires them to do:
newBox.Text = oldBox.Text.Replace("l", "1").Replace("e", "3").Replace("t", "7")

I would think the calculator would be doable. Your basically only doing a simple form with some buttons and some basic logic on the various click events for the operators. Only issue would be the logic for chaining the operands and operators.
You might want to do a trial run by yourself of the project, and think where you would break it into steps to explain and such and see how long it takes.

Rock Paper scissors game? This would be good for if statements... Then if they grasp that the concept of conditional statements you could move on to a select case example. I find once most people understand that programs are based on conditions they generally can grasp much of the more advanced concepts much quicker. Conditional circuts were after all the beginning of computing.

When I was at school I started off by building a simple application that has a few buttons and on click it changes the background colour. Then you add more functionality such as a message box, then maybe a button that closes the applicaiton. Talk to them about the debugger/compiler and explain to them how it is very similar to making a cake with all the ingredients (I wish somebody explained it to me like that back then). You can make it as simple or as complicated as you want. Or instead of a real calculator you can teach them how to create a Reverse Polish Notation calculator (i.e in order to add 5 to 3 you would click: 5 then 3 then + which will return 8. Anyway trying not to get carried away here. Good luck and most important of all: make it fun for the future generation of programmers"

Related

ways to improve Testing skills as a Mobile application tester

Changing Career from iPhone application developer to Tester makes me to learn about basic testing.I need to hone my testing skill.what are the ways to improve
I'm testing ~5-10 (small) applications per year so I'm no expert by any means, but this are several things I find quite useful:
Think out of the box. You are familiar with the workflow of the application. You know what your designers thought when implementing
functions. After checking these regular patterns I try to think about
the app completely different and try out new unconventional
workflows.
Try breaking it. Type text where numbers should be, try copying text from the outside into numberfields, tap multiple buttons and
hold them while using one normally. Use your UIElements while turning
the device. Be creative about it - Go apeshit on it! ;-)
"A common mistake people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools." - Douglas Adams
If allowed, hand this application to a 10 year old and see how he
uses it.
Go fast. When jumping between views your eyes will notice small shifted pixels automatically.
When done, check out this awesome tool: UIAutoMonkey (Coming back to that apeshit part ;))
If you are entering in the field of testing, then make sure you follow the below steps/things :
Clear the basic concepts of testing (You can refer the loads of online material for this)
Go for Manual testing first as it will be easy for the first time.
Try to break the things.
Test only when you have clear guidelines. Don't assume anything.
Happy Testing !!

Begin game programming basics [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Closed 6 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
My 11 year old kid brother wants to learn to program games. He has never programmed but would like to learn programming. His interest lies with games and game programming and he understands that it can be difficult but he wants to do that. So, obviously, I turned to SO folks to know what you feel on how he should go about it. Remember, please suggest on
Areas that beginners can choose,
how to begin in that area,
what to read in the beginning,
initial languages in the beginning etc.
Once the beginning part is taken care of, you may also suggest the intermediate and advanced stuff but this question is about very beginning level. If there are areas like Web games Vs. console games Vs generic computer games, then please advice on the areas. As I said he has never programmed, he might want to try all the areas and choose the one he likes the best. I hope this is not too much to ask for someone who is in this field but if this question is huge, please advice on how to break it into multiple questions. ~Thanks.
I started my programming career writing games when I was 15 and it was a lot of fun (even though I wrestled with C++ for 3 years just because "that's what's used for writing games"). My two cents:
Start with a programming language that is easy to use (NOT C or C++)
Get a beginners book for that programming language (not directed at games)
Decide on some API or environment that provides what's needed for writing games. I started out by doing snake, space invaders etc in the console, but any 2D-environment will do (stay way from 3D for as long as you can; there are much more important things to learn first). SDL/GLUT for OpenGL has bindings in almost any language. Pygame for Python looks promising too. Using HTML5's canvas-element, you could even write the programs in the browser using JavaScript. Im not sure what's best these days, but there you have some suggestions.
Find a community for inspiration and help when stuck. I used gamedev.net. Since we're on stackoverflow, gamedev.stackexchange.com should also be a natural choice :)
Start small. Very small. I mean really tiny. Then take small steps to new challenges. Please don't write an MMORPG.
The game design and graphics are fun, but focus on the programming (for now at least). When you've written a simple game, learn how to do the same thing better.
Set a goal. Imagine the game that you'd want to make. Don't try to make that one immediately, but make sure that each new thing you learn or make takes you one step closer. Don't learn what you don't need so to speak (there's simply too much too learn).
I wish you and your brother the best of luck, I never regret going down the path he's about to take!
For a beginning game developing enthousiast I think you can't go wrong with the combination Python + Pygame. Python is a great, elegant (and easy to learn) all-round language and lots of great tutorials are available for Pygame which explain the basics of (mostly) 2D game programming.
There's this post on Gamedev stackexchange where the poster is in literally the same position.
Quoting my answer from there:
I'm also 15, so I guess that could help? :P
I've recently started learning Python
(been doing C++ for a year or so), and
I'm finding it much easier to learn
than C++. There's a lot less pitfalls,
and you need little code to get
something on the screen - what I find
makes you want to continue.
And there's wrappers like Pygame and
Pyglet over SDL/OpenGL for the
graphics side.
And before he starts making simple
games, I would advise learning a
language for at least a couple of
months. (Of course, text based games
like guess the number and hangman are
good exercises during this time)
And for what to read; I can advise Invent With Python. It goes from learning the language in a very gamedev way - which is a good step to making sure he stays interested; I doubt many kids his age are going to want to learn all about variables and loops, moreso being able to make a game - all the way to seamlessly introducting PyGame and graphics.
It could take some time until he can program a proper game...
But as I see it, he should start with Java as it is easy to learn and good for basic games.
Starting out he wouldn't be able to do much more than a guessing game, but he shouldn't get frustrated, this will take time.
I think you should buy him a book on java, and start from the basics.
You would get many different answers on this one as it is mostly personal opinion...
Teach him the basics of programming: variables, declarations, properties, methods, arguments, classes, arrays, loops. I suggest C# as a starting language, it seems simpler than C or C++ to start with, in my opinion. Once he understands those concepts it shouldn't be extremely hard for him to jump in and follow some XNA tutorials on a simple game like pong or something.
Game Development, part of the Stack Exchange, is a great resource for these types of things. It's loaded with posts like this one.
How about instead of forcing him to learn a language first, get him involved in using a framework where he can readily see results to maintain an interest. Something along the lines of RPGMaker could be sufficient.
My reasoning for this would be that, yes, you want him to learn the basics of making games and introduce programming as well, but you don't want to burn him out on the formalities of a language.
If he is 14, then he is of high school age (assuming US based...), and there is a good chance that there are programming courses available to him there. Let him whet his teeth on those to grind out the difficulties of introducing programming, and then once he is interested in expanding beyond the bounds of the toolset introduce him to the answers posted by the other users.
My two cents...I've seen kids give up on programming before because they jumped right into game making and quickly got frustrated...
In the beginning, make sure you keep it fun. Try mocking old games like 1-stage of contra or air hockey. And use a programming language with easy implementation of timer. Because timers, I think are the easiest way to show some visible effects. I would recommend visual basic or objective-c (I know many people won't agree, BUT it is that damn easy with the power of Xcode). Thumbs up ! Have fun.
I agree with ChristopheD about Python and Pygame. When it comes to languages Python is great for beginners because it is very high level therefore so easier to understand and the syntax is clean and simple. And Pygame is a great library for learning game programming.
Eventually he'll want to move into C++, which as I understand is the go to language for game development. But Python and Pygame would be a better start, especially for an 11 year old.
A good series of easy to read online books are the following three:
http://greenteapress.com/thinkpython/thinkpython.html to learn Python
http://inventwithpython.com/ this site has two books, what to make games in plain Python and the other to make games using the Pygame library for Python. Once he gets through these three books he should be able to start making his own games in Python using Pygame and then eventually move on to more serious game development langauges/tools.
Write some simple scenarios for a game such as Wesnoth is maybe a good start.
Learning basis of programming is also important. A langage such as python is probably a good start.
The language is clear and easy to learn and teach.
And it is very extentable.
This is a -very basic- game source code (Butterfly adventure 1.0) made with javascript to start learn programming. Only basic codes (variable, if, switch, function, event, etc.) used.
It may be useful to start learning game development.
Play the game link
Source code link
Video tutorials (Only in Turkish) link
Screenshot
Have fun.
IMHO he should start learning C.
then switch to OpenGL later once he has the grip of basic C constructs.

Porting VB6 app to VB.Net: Can anyone ballpark how much effort this is?

In 2002 I did a pretty large VB6 app for a client. It used a lot of UserControls and a 3rd party menu control (for putting icons next to menu names). It had dynamically "splittable" panels, TreeViews with multi-state checkboxes, etc. A very rich UI. My total time on the project was about 500 hours, which the client graciously let me spread over a whole month. (Yeah, it was that kind of job.) They were very happy, though, and they paid the bill on time with no argument.
So after having no contact with them for years, they suddenly call and wonder if I can update the app to .Net for them. My initial reaction is just to decline, since I don't use VB.Net. And having read a bunch of posts on SO about the difficulties of porting, etc., etc., I'm even more inclined to decline, so to speak.
Still, before I tell them no I am interested in roughly quantifying the effort it would take. I would love to hear from anyone who has done this kind of thing and has a feel for how much work it is. Was it:
Significantly less than the effort you used on the original?
Somewhat less than the effort you used on the original?
The same as the effort you used on the original?
More?
A lot more?
Please only respond if you have actually done this kind of port. And the answer doesn't have to be exact, since I really am only trying to ballpark this. My feeling is that the effort will be at least as much as it took for the original, if not more. But I could be wrong. Thanks for any help.
I have done what you've been asked. In my case it was an (amateur) bowling tournament mgmt system: Member database mgmt (personal info, IRS/Winnings info, mailing lists etc etc etc) , tournament mgmt (player assignments, scoring, lane ticket generation, check register for winnings and side-pots, etc etc etc) as well as IRS EDI generation for all winners in a given year. Plus about a billion little items scattered across ~ 50 screens/sub-screens.
The key is CLIENT UNDERSTANDING -- You must be clear that they understand that this is not trivial; this is a new adventure for BOTH of you (particularly if you are a new-comer to VB.Net) If they liked your work before then they may very well give you the leeway/freedom to learn VB.Net on their nickel.
Reading some of the previous answers let me make a few suggestions (based upon 30 years experience as a software developer, the last 20 of which as a consultant....)
TAKE THEIR MONEY IF THEY OFFER IT. You need to bring your skillset into the 20th century; let them pay for it (again, if they agree.) They may be Magazine surfing and want "the latest stuff" for NO GOOD REASON -- but maybe they realize that they can extend the life of (your) application by this port. In essence they may have all kinds of goofy reasons for doing it... if they are NOT hiring you to DECIDE whether or not this port is a good idea. Then you may express any dismay you have about the decision PROCESS out of good client relationship building; BUT if they want to do this then it might as well be your job.
Take all this mumbo-jumbo re: C# vs VB.Net with a grain of salt. I have worked EXCLUSIVELY in VB.Net / ASPX.net (vs C#) since its inception and have yet to come across ANY functionality NOT attainable in VB.Net. There are some 'purists' out there that just view VB.Net as a toy. Well, I came from the days of writing in Assembler, then C, then C++ (And you can throw in Fortran, PL1 for good measure) then VB5, then 6, then VB.Net ... and NOW JAVA for Android. Its ALL GOOD FUN... and each has it merits and drawbacks. Remember that C# and VB.Net are essentially just GUIs to achieve a meta-language intermediate. You can write a TERRIBLE (as measured by efficiency or memory use or whatever metric you choose!) Program in C# and a great one in VB.Net (and vice-versa.) DO NOT EQUATE GOOD PROGRAMMING WITH LANGUAGE SYNTAX. (... C# is "superior" ???? Gimme a break.)
I chose to allow the Visual Studio do most of the heavy lifting for the first pass. Then you go through the gazzillion errors and clean it up. It goes pretty fast.
BUT you need to decide whether or not to take advantage of any framework benefits that you had hand-coded in VB6. E.G. looping through a string to locate a specific character(s) is now as simple as The_String.IndexOf("c") I found that in my case I went through the code several times and took better and better advantage of the Class (i.e. object orientation) as well as framework goodies as I became comfortable... this adds to your development time (see CLIENT UNDERSTANDING mantra) BUT your code WILL BE MORE Efficient then it ever could have been in VB6. You could simply port to get the errors out and not take ANY advantage necessarily from the framework.
I have not found any issue with 3rd party active-x controls. You can add a reference to FRAMEWORK objects, COM objects, etc. It may even be likely that the control vendor has a .Net (managed code) version... OR there may be suitable alternatives since you wrote the thing in VB6. (See CLIENT UNDERSTANDING mantra)
So if your still reading, then now I will finally tell you that the second attempt at my application in VB.Net CONVERTED/PORTED from VB6 was ~ 1/3 of the original time to get to a working model... and I was learning the framework as well. (If your confident in your skill set, have learned a few languages through the years you will get the gist of VB.Net quickly --- its the SUBTLETIES that take awhile.)
I must caution you that the thing that can REALLY kill you if you do not preach the CLIENT UNDERSTANDING well enough is if they want to make changes WHILE you're porting (and this is VERY LIKELY since they've been using it for awhile... I was very true in my case as well.
There is no hard and fast rule here. It could be that changes will actually HELP YOU get to a better understanding the framework faster OR changes could be a real pain. Only you can determine which flavor they might be. AND if they look to be the PAINFUL type -- you might ask to do the conversion first so that you have reliably reproduced the functionality -- THEN go back and review the code to make changes and take advantage of the framework as necessary. But, as I said, there is NO Hard and Fast rules here -- and don't let the purists tell you differently --- remember they are probably the same guys that said that PASCAL was going to take over the world!
So after having no contact with them for years, they suddenly call and wonder if I can update the app to .Net for them.
You need to ask why they want this done.
It's a Bad Plan(tm) for clients to be making technical decisions on a whim. Before applying any solution, thoroughly understand their needs and their problem. Only after you understand the problem as they do should you make recommendations.
It could be that they're infatuated with a buzzword and want to be using the latest thing, or it could be any of a million other things. The solution to their problem could be something really easy, but if you don't find out what their problem is, you will never know the best way to solve that problem.
I would plan on it taking about 50% of the time and effort it took to create it in the first place.
I have done EXACTLY what you are asking about for a commercial software product that consisted of roughly 500 kloc. We balanced the desire for refactoring with the desire to get something working and released as quickly as possible.
It took nearly the entire team about 1 full year to get it done...for a product that took 4 years to create in the first place. It was a gigantic undertaking..not to be underestimated.
We are doing that exact thing right now, however it's slightly different. Instead of one huge application, there are many smaller ones. However, there are a few bigger ones in the list. What we found out is that it was significantly less work than we originally thought. BUT...the biggest unknowns had to do with third-party controls we had. If you have a lot of those to basically redesign, you will probably be looking at more work.
The one good suggestion I have is to use Visual Studio 2008 for the conversion (not VS 2005). There were far less problems when using the built-in converter in VS 2008 than there was with VS 2005. Not sure why, it just was that way.
So, I can't say that you won't spend 500 hours again, but most likely not. Most of your time should be spent on testing to verify no functionality was lost.
In my opinion,
Visual Basic 6 and Visual Basic .NET are so different that you should forget about their coincidence in their name, and treat this as a migration to .NET =P
I think that you have one big advantage and one disadvantage:
Advantage: you allready know what the application has to do. Probably you´ll have some meetings with your clients, in order to add some modifications or new features, but you have the major part of the requirements very clear. You´ll even have the old working application to see while you, or your team, are coding.
Disadvantage: you´ll have to learn a new language. Saying how much time is going to take, is very subjective. I´ve allways thought that learning a new language is not the problem, the big problem would be if you have to learn to program!. But you do know to program. You´ll know what you want to do, and you´ll have only to search how to do it in the new languaje.
Since you have to learn .NET, If you have to estimate, I think that you should suppose that it will take you at least the same as the previous application, even more.
My advice is too take the chance to learn this new language. And if you are more inclined to decline the project, let me give you another idea... Maybe you could estimate a little module of your application, and tell the client that you´ll try to do that module, to see how much it takes to you. The client should pay this little module, even if you decide not to continue.
You can´t tell the client that you know all the requirements, so they are saving money with you, in some way. And that they should take this little risk (we are talking about a little module), because who better than you to make the project, you know the old application perfectly!
If the client is right with this, you´ll can take the decision with more arguments. And If finally you decide to continue, with this little module done, you can estimate the whole project better than before.
Sorry, my English isn´t very good, and probably I´ve made many gramatical errors.
EDIT grammar mistakes... =P
This is a huge topic.
You should take a look at MS' Free Book - Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET.
Were you to rewrite from scratch, rather than simply try and port the previous application, it shouldn't take too long. VB.Net has some features that will make the new application build take shorter. As it seems that you don't know VB.Net already, what will take you the most time is learn how to do things the new way(tm).
I'd go for two months this time.
But seriously, that's probably not far off — or even low — because the client will have some reason for needing the port done. It won't be just a straight port - they'll want some "small little enhancement" that will blow the whole project up.
Additionally, I'd worry a bit about the third party controls. Most of the rest of it should convert okay, but there's sometimes an issue finding a good analog to a 3rd party control in .Net.
I'm also concerned that you don't use vb.net. If you're a c# user and wanted to re-implement that way you'd be fine, but otherwise this is a non-starter. VB.Net is just different enough from vb6 for you to get yourself into trouble.
Aside from all that, I would expect it to be less work this time than last, because you have a very explicit design laid out in front of you that you merely need to follow.

What features are important in a programming language for young beginners? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was talking with some of the mentors in a local robotics competition for 7th and 8th level kids. The robot was using PBASIC and the parallax Basic Stamp. One of the major issues was this was short term project that required building the robot, teaching them to program in PBASIC and having them program the robot. All in only 2 hours or so a week over a couple months. PBASIC is kinda nice in that it has built in features to do everything, but information overload is possible to due this.
My thought are simplicity is key.
When you have kids struggling to grasp:
if X>10 then <DOSOMETHING>
There is not much point in throwing "proper" object oriented programming at them.
What are the essentials needed to foster an interest in programming?
Edit:
I like the notion of interpreted on the PC as learning tool. Due to the target platforms more than likely being somewhat resource constrained, I would like to target languages that are appropriate for embedded work. (Python and even Lua require more resources than the target likely to have. And I actually kinda like Lua.) I suppose that is one of the few virtues BASIC has, it has been ran on systems with less than 4K for over 30 years. C may not be a bad option if there are some "friendly" tools available such as Ch.
The most important is not a lot of boiler plate to make the simplest program run.
If you start of with a bunch of
import Supercalifragilistic from <expialidocious>
public void inherited security model=<apartment>
public : main .....
And tell them they "not to worry they aren't supposed to understand that" - you are going to put off both the brightest and the dumbest.
The nice thing about python is that printing "hello world" is print "hello world"
Fun, quick results. Capture the attention span of the kid.
Interpretive shells like most scripting languages offer (command line) that lets the student just type 1 or 2 liners is a big deal.
python:
>>> 1+1
2
Boom, instant feedback, kid thinks "the computer is talking back". Kids love that. Remember Eliza, anyone?
If they get bogged down in installing an IDE, creating a project, bleh bleh bleh, sometimes the tangents will take you away from the main topic.
BASIC is good too.
Look for some things online like "SIMPLE" : http://www.simplecodeworks.com/website.html
A team of researchers, beginning at Rice, then spreading out to Brown, Chicago, Northeastern, Northwestern, and Utah, have been studying this question for about 15 years. I can't summarize all their discoveries here, but here are some of their most important findings:
Irregular syntax can be a barrier to entry.
The language should be divided into concentric subsets, and you should choose a subset appropriate to the student's level of knowledge. For example, their smallest subset is called the "Beginning Student" language.
The compiler's error messages should be matched to the students' level of knowledge. If you are using subsets, different subsets might give different messages for the same error.
Beginners find it difficult to learn the phase distinction: separate phases for type checking and run time, with different kinds of errors. For this reason, beginners do better with a language where types are checked at run time, i.e., a dynamically typed language.
Beginners find it difficult to reason about mutable variables and mutable objects. If you teach pure functional programming, by contrast, you can leverage students' experience with high-school and middle-school algebra.
Beginning students are more engaged by an interactive programming environment than by the old edit-compile-link-go model.
Beginning students are engaged by splash and by interactivity. It's good if your language's standard library provides built-in support for creating and displaying images. It's better if those images are supported within the interactive programming environment, instead of requiring a separate player or viewer. And it's even better if your standard library can support moving images, or some other kind of animation.
Interestingly, they have got very good results with just 2D images. Even though we are all surrounded by examples of 3D computer graphics, students seem to get very engaged working with just two-dimensional images.
These results have been obtained primarily with college students, and they have been replicated at over 20 universities. However, the research team has also done some work with high-school and middle-school students. The first papers on that work are just coming out, so I'm less aware of the new findings and am not able to summarize them.
When you have kids struggling to grasp:
if X>10 then <DOSOMETHING>
Maybe it's a sign they shouldn't be doing programming?
What are the essentials needed to foster an interest in programming?
To see success with no or little effort. To create something running in a matter of minutes. A lot of programming languages can offer it, including the scary C++.
In order to avoid complication with #includes, multiple source files, modularization and compilation, why not have a look elsewhere? Try to write some Excel macros or use any other software with some basic built-in scripting language to automate certain tasks?
Another idea could be to play with web pages. It is not exactly programming, but at least easy to achieve something and show to others with pride.
This has been said on SO before, but... try Scratch. It's an incredible learning tool for kids. It teaches the basics of programming concepts in a hands-on and language-independent way. After a bit of playing around with it they can get down to learning a specific language's implementation of the concepts they already understand.
The common theme in languages that are easy for beginners - especially children to pick up is that there's very little barrier to entry, and immediate feedback. If "hello world" doesn't look a lot like print "Hello, world!", it's going to be harder for people to pick up. The following features along those lines come to mind:
Interpreted, or incrementally JIT compiled (which looks like an interpreter to the user)
No boilerplate
No attempt to enforce a specific programming style (e.g. Java requiring that everything be in a class definition, or Haskell enforcing purely functional design)
Dynamic typing
Implicit coercion (maybe)
A REPL
Breaking the problem (read program) down into a small set of sections (modules) that do one thing and do it very well.
You have to get them to stop thinking like a user and start thinking like a programmer. They need to take it one step at a time. Ask them what they have to think of in order to figure out the problem them selves and then write them down as steps. If you can then you break each step even more in the same mater. When done you will have the program in english making it simpler to program for real.
I did this with a friend that just could not get it and now he can. He used to look at something that I did and be bewildered and I would say that he has done more complex stuff than this.
One of the more persistently-present arguments I have had with other programmers is whether or not one's first language should require explicit type languages. Many are of the opinion that learning a language which requires you to explicitly declare type information is one which will teach you to program typefully. Conversely, it can be said that dynamic languages might present a less demanding learning curve. It goes either way, I suppose.
My advice: start with a simple model of how a computer works. I am particular to stack machines as good tools for teaching computation.
Remember that beginners are learning two disciplines at the same time: how computers work and the abstract logic involved (the basics of Computer Science), plus how to write programs that match their intended logic (learning a specific language's syntax and idioms). You have to address both concerns in an interwoven fashion in order for the students to quickly become effective. This is also the reason experienced programmers can often pick up new languages quickly.
It's worth noting Python grew out of a project for a language named ABC, which was targeted at beginners. For example, the required colon isn't strictly required, but was found to improve readability:
if some_condition:
do_this()
I got 3 words : Karel the Robot.
it's a really really simple 'language' that is designed to teach people the basis of programming :
Look for it on the web. You can look at this, though I never tried it :
http://karel.sourceforge.net/
While this isn't related to programming a robot, I think web programming is a great place to start with kids that age. It's how I started at that exact age. It easily translates to something kids understand if they use the web at all. Start with HTML, throw in Javascript, and soon they want to be doing features requiring server-side scripting or some sort, and things progress from there.
With the kind of kids who are already interested in robotics, though, I'd actually go for a different language like the ones already described. If you want to work in a field like robotics, you don't need to be convinced to try something hard. You need to be challenged.
A few years ago I saw a presentation at Ignite! Seattle from one of the people working on the project now known as Kodu who envisioned as a programming language for children. He spent time talking about what common language features could simply be thrown out in a programming environment meant to teach fundamentals.
A lot of cherished imperative constructs, like C-style for loops, were simply left out in favor of a simple object-messaging approach. Object-oriented programming isn't hard to understand when you think about "objects" and "messages"; the hard part is when you deal with things that programmers, but not children, care about, like inheritance and contracts and sweeping abstractions. I've got this thing (noun), now act on it (verb), in this way (adverb like quickly), when thing (sees/bumps into) something (with some attribute) (that's your if). Events are really conditions, and have all of the power of conditions, but it's up to the runtime to identify when those events happen.
This kind of event and messaging driven approach probably translates even better to robots than procedural programming would, anyway, so it might be a good way to look at the problem. Try not to think about what you'd "need" to know to program in C or Pascal or something; think about what you'd want to be able to make something do.

OOP Problems to use for Coding Tests during interviews

As a second interview I get people to sit down and write code...I try to make the problem really technology independent.
My programming problems that I have don't really exercise peoples OO abilities. I tend to try and keep the coding problem solvable within 2 hours ish. So, I've struggled to find a problem small enough and involved enough that it exposes peoples OO design skills.
Any suggestions?
This is a problem that I use with some trainings, looks simple but is tricky OOP-wise:
Create model classes that will properly represent the following constructs:
Define a Shape object, where the object is any two dimensional figure, and has the following characteristics: a name, a perimeter, and a surface area.
Define a Circle, retaining and accurately outputting the values of the aforementioned characteristics of a Shape.
Define a Triangle. This time, the name of the triangle should take into account if it is equilateral (all 3 sides are the same length), isoceles (only 2 sides are the same length), or scalene (no 2 sides are the same).
You can go on and on with quadrelaterals (which include squares, rectangles, rhombi, etc) and other polygons.
The way that they would solve the above problems would reveal the people who understand OOP apart from those who don't.
ideally, you want to present a problem that appears difficult, but has a simple, elegant, obvious solution if you think in OO terms
perhaps:
we need to control access to a customer web site
each customer may have one or more people to access the site
different people from different customers may be able to view different parts of the site
the same person may work for more than one customer
customers want to manage permissions based on the person, department, team, or project
design a solution for this using object-oriented techniques
one OO solution is to have a Person, a Customer, an Account, and AccountPermissions, where the Account specifies a Person and a Customer and an optional Parent Account. the use of a recursive Account object collapses the otherwise cumbersome person/team/department/project structure a direct ERD solution might yield
I have used the FizzBuzz Programming Test. And shockingly can corroborate the claims made by the article. As a second follow up I have asked candidates to compute the angle(s) between the hands on an analog clock. We set up a laptop with VS 2008 installed and the stub in place. all they have to do is fill in the implementation.
I am always stunned at how poorly candidates do on these two questions. I really am.
Designing Social Security Application is something which I ask a lot of people during interviews.
The nice thing about this is everyone is aware of how it works and what things to keep track of.
They also have to justify their design and this really helps me get inside their head :)
(As there is lots of flexibility here)
Kind regards,
Whether or not people do some coding in the interview, I make it a point to ask this:
Tell me about a problem you solved recently using object oriented programming. You'd be surprised how often people cannot answer that simple question. A lot of times I get a blank stare, or they say something like "what do you mean? I program in .NET, which is all object oriented."
These aren't specifically OO Questions, but check out the other questions tagged interview-questions
Edit: What about implementing some design patterns? I don't have the best knowledge in the area but it seems as if you would be getting two questions for the price of one. You can test for both OO and Design pattens in the one question.
How about some sort of simple GUI. It's got inheritance, overriding, possibly events. If you mean for them to actually implement as part of the test then you could hand them a blank windows-form with an OnPaint() and tell them to get to it.
You could do worse than ask them to design a MapReduce library with a single-process implementation. Will the interface still work for a distributed implementation? What's the exception-handling policy? Should there be special support for chaining MapReduce jobs in a pipeline? What's the interface to the inputs and outputs? How are inputs chunked up? Can different inputs in one job go to different mappers? What defaults are reasonable?
A good solution in Python takes about a page of code.
I've got a super simple set. The idea is mainly to use them to filter out people who really don't know their stuff rather than filtering in the rock stars.
These are all 5 minute white-board type questions, so they are really not that hard. But the act of writing up code, and talking through it reveals a lot about a candidate - and is brilliant for exposing those that can otherwise BS through the talk.
Write a method that takes a radius of a circle as an argument, and returns the area of the circle (You would be amazed how many people struggle on this one!)
Write a program that accepts a series of numbers as arguments from the command line. Add them up, and print the sum
Write a class that acts as a keyed counter (basically a map that keeps track of how many times each key is "counted")