 |
|
 |
This article is good example like to make some interesting thing in a very ugly way. - No background about VM at all. What is it ? Why this code ? Why to use ? What do you what to show posting this code ? Ask such questions to yourself and update the article. You told that you are lazy. 8) Ok, every good programmer is somewhat lazy. But definitely not all lazy persons good programmers. Being lazy in good (programmers) sense is to write efficient well-commented and re-usable code which is clear to understand, and all this is in short time. Doing this will give a lot of free time for your laziness today and in future. Sorry, but your implementation of VM lacks of all those things. Try read some articles or better read a book on Programming Patterns, this will help you to eliminate those 2 ugly "switch" statements and may be studying of MSDN C# topics would teach you how to use enums in C#. Here are some recommended titles: Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides C# Design Patterns: A Tutorial by James William Cooper, James W. Cooper Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process (2nd Edition) by Craig Larman And before posting something somewhere, please, ask the question to yourself: How your posting would help someone ? Code just for coding is nothing. (May be just an entry for obfuscated code contests 8) If you experience problems answering previous question, try to add some funny story to the end, at least your posting would entertain someone. 8) Regards, Vladimir Novikov
|
|
|
|
 |
|
 |
Calm down everyone.
Anonymous a few questions:-
1. What is a virtual machine?
2. What would you use it for
|
|
|
|
 |
|
 |
Good call Lee. We are acting like a bunch of old ladies
A virtual machine is used as an abstraction layer between an actuall operating system and a runtime environment.
Java has a virtual machine, allowing java to run on many different O/S hardware combinations.
The .NET runtime actually has instructions defined for a virtual machine, but in the MS implimentation of the .NET runtime nothing is ever interpreted, it is allway compiled to native code.
However alternative implimenations like MONO may offer interpreted modes of execution.
I started playing around with it because I'm interested in Intelligent Agents, and Intelligent Agents need a runtime environment.
cheers
Include123
|
|
|
|
 |
|
 |
So your little demo implements a mini version of assembler?
|
|
|
|
 |
|
 |
Yes, for a very specific ( read basic ) instruction set.
It also interprets that instruction set.
|
|
|
|
 |
|
 |
This is the kind of thing that should've been in the article in the first place.
Not everyone knows what a VM is or how they are useful so if you update the article to include some background information, this would be a useful introductory article.
Code by itself isn't all that useful: those who know what a VM is could write something like this themselves quite easily and those who don't won't have any idea what the article is about and will just ignore it.
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
 |
|
 |
You make a valid point. Well done.
|
|
|
|
 |
|
 |
It does not make sense to post an article with just some code. Every nerd can do that ...
Please try to type some comments and some more background info.
|
|
|
|
 |
|
 |
Sorry, feel free not to view it if it offends you
|
|
|
|
 |
|
 |
Why don't you post this response under a name instead of anonymous ?
And it is with a good reason I wondered why there is no background information. First of all it is easier when searching for a solution or some information concerning a problem one has. And as a second remark it is nicer to read some prefix info before diving in some sourcecode.
|
|
|
|
 |
|
 |
Accidental, I'm, new to the site. Somehow mozilla lost the logged-in cookie. Plus I'm lazy.
I realize it would be nice to have a detailed writeup, however
the site is called TheCodeProject, so code has to take primary importance. I figure that there will allways be a range of postings, from plain undecorated code to full blown design articles.
I hope to add more detail next time I submit.
Cheers
Include123
|
|
|
|
 |
|
 |
Are you a professional? If you are you should know that the docs are as important as the code.
Firstly, check other articles in the site -- there are few with just code.
Secondly, check your article's rating so far -- not too good (1.8 as I write this).
Code Project is a learning resource, not a code repository.
(It's first thing in the morning for me so if I sound a bit grumpy, that's why)
Dr Herbie.
|
|
|
|
 |
|
 |
Dr Herbie wrote:
Code Project is a learning resource, not a code repository.
You're right, initally it was a code repository but as submissions increased so did the importance of articles to complement the code.
To iterate is human, to recurse is devine.
|
|
|
|
 |
|
 |
"To iterate is human, to recurse is devine."
hmm, you are either being really clever or....
"devine": a small town in texas.
"divine": godlike.
I'm guessing you want to the latter
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
 |
|
 |
Read the C++ bible , chapter 5 i think - you'll know what i mean.
To iterate is human, to recurse is devine.
|
|
|
|
 |
|
 |
yes, but you spelt it wrong!
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
 |
|
 |
I am a professional, and I think documentation is overrated...
I'm not into popularity contests, so I dont care about ratings...
You can be grumpy, and I can not care
cheers
Include123
|
|
|
|
 |
|
 |
Fine, then let me ask this: why did you post the article in the first place if you were not going to explain anything about the code?
-Anatoly
Anatoly Ivasyuk is co-founder of DTLink Software, a company specializing in Internet software and technologies. He is the author of DTLink's Windows products: NeoPhoto, AnswerTool, FAQTool, and Personal Stock Monitor
|
|
|
|
 |
|
 |
As a pyschological experiment perhaps
I never said I would not explain anything, feel free to ask specifics.
I'm new here, how about about people trying courtesy and contructive questioning rather than whiny complaints.
|
|
|
|
 |
|
 |
Include123 wrote:
As a pyschological experiment perhaps
If you've read some of the other low-rated articles on this site you will see that it's already been tried and failed.
Include123 wrote:
I'm new here, how about about people trying courtesy and contructive questioning rather than whiny complaints.
As a new author what would have been better is if you took some time to read through some of the highly-rated articles and emulate them instead.
The problem is that anyone can dump a piece of code on a web page, and that's been happening all too often around here lately. Just a little extra effort in commenting the code and explaining the reasoning behind it will go a long way toward getting you some respect from other CodeProject authors and site visitors.
Anatoly Ivasyuk is co-founder of DTLink Software, a company specializing in Internet software and technologies. He is the author of DTLink's Windows products: NeoPhoto, AnswerTool, FAQTool, and Personal Stock Monitor
|
|
|
|
 |
|
 |
Documentation is overrated. Hmmm...
Perhaps he gets paid for code, but he's no professional.
Eric F. Vincent
Avoid having your ego so close to your position that when your position falls, your ego goes with it.
Colin Powell
|
|
|
|
 |
|
 |
Funny someone with a sig about ego's can be so unaware his is a problem...
Stop spouting the party line for a change, who are you to judge me?
|
|
|
|
 |
|
 |
I'm sorry but, I have to agree.
The code in this article may well be very intersting as well as novel.
But as an article I am afraid it has no feet. Maybe you can add some answers to my questions to improve the article.
What whoud I do with this VM?
What lessons were learned writing this code?
Did you find any special circumstance where this or a similar solution fitted well?
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
 |