By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,573 Members | 3,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,573 IT Pros & Developers. It's quick & easy.

Confused beginner

P: n/a
I am doing the first walk through on the Visual Studio .Net walkthrough book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~
Nov 17 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a

"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

What errors are you getting when you build?
Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}
This looks a bit fuzzy.

(case sensative remember). Try this:

public Authors1 GetAuthors()

and

Authors1 authors = new Authors1();

(or the other way, depending on how the Authors1 class is named)

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}
I'm guessing on this one (based on the above):

public Authors1 UpdateAuthors(Authors1 authorChanges)


I tired to put this a couple of different places, but it always fails?

Thanks in advance!~

Nov 17 '05 #2

P: n/a
"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Are you putting these method decarations inside a class declaration?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #3

P: n/a


"Chance Hopkins" wrote:

"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

What errors are you getting when you build?


*****
c:\inetpub\wwwroot\AuthorsWebService\AuthorsServic e.asmx.cs(138): Expected
class, delegate, enum, interface, or struct
c:\inetpub\wwwroot\AuthorsWebService\AuthorsServic e.asmx.cs(148): Expected
class, delegate, enum, interface, or struct
c:\inetpub\wwwroot\AuthorsWebService\AuthorsServic e.asmx.cs(159): Type or
namespace definition, or end-of-file expected
*****
Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}


This looks a bit fuzzy.

(case sensative remember). Try this:

public Authors1 GetAuthors()

and

Authors1 authors = new Authors1();

(or the other way, depending on how the Authors1 class is named)

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}


I'm guessing on this one (based on the above):

public Authors1 UpdateAuthors(Authors1 authorChanges)


I tired to put this a couple of different places, but it always fails?

Thanks in advance!~



Also, do you have to declare a comment before you start something new like
this?

blaze
Nov 17 '05 #4

P: n/a


"Richard Blewett [DevelopMentor]" wrote:
"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Are you putting these method decarations inside a class declaration?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


I think the answer to that is:

I am putting it inside the AuthorsService.asmx.cs file? Sorry I just
ordered some beginner books on C#, just can't believe the walkthrough fails?

I have also tried this with a VB project with more failures. I would rather
learn C# if I'm going to learn something!

Thanks again!
Nov 17 '05 #5

P: n/a
Dude, you're just starting to learn programming, and you begin by trying to
write a Web Service? that could have something to do with it. You might want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience with
programming. Get yourself a beginning-level programming book, and work your
way up from there. You really don't want to present yourself with too many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~

Nov 17 '05 #6

P: n/a
I have 2 books on the way. I know a TON about web services and how to use
them and the way XML interacts with apps. I am a very experienced network
engineer with a pretty good grasp on technology. I just don't know how to
program, but am learning by myself. Do you have a suggested reading on the
"hello world" console app?

Thanks!

Blaze

"Kevin Spencer" wrote:
Dude, you're just starting to learn programming, and you begin by trying to
write a Web Service? that could have something to do with it. You might want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience with
programming. Get yourself a beginning-level programming book, and work your
way up from there. You really don't want to present yourself with too many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
I am doing the first walk through on the Visual Studio .Net walkthrough
book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that the build fails with what
the
book tells me to do.

Specifically, I am doing this:
[WebMethod]
public authors1 GetAuthors()
{
authors1 authors = new Authors1();
sqlDataAdapter1.Fill(authors);
return authors;
}

[WebMethod]
public authors1 UpdateAuthors(authors1 authorChanges)
{
if (authorChanges != null)
{
sqlDataAdapter1.Update(authorChanges);
returen authorChanges;
}
else
return null;
}
}

I tired to put this a couple of different places, but it always fails?

Thanks in advance!~


Nov 17 '05 #7

P: n/a
Hi Blaze,

I respect your skill with respect to networks. While I am familiar with
networks to the extent that I have to write software that runs on them (and
therefore know a moderate amount about everything), I would hardly want to
jump right into network engineering! I am well aware of my deficiencies in
that area! ;-)

As to the "hello world" app, let me explain a bit.

There are 3 major concepts to programming that are important to understand:
input, output, and processing. Each of these is a world unto itself of
information to be learned and understood. Typically, a programming course or
book will start with what is well-known as a "hello world" app. Don't ask me
where "hello world" came from - probably the same place as "foo bar." Of
course, it doesn't have the same colorful flavor! Someone way back when
decided upon it, and it was picked up and embraced as something easily
recognizable to the community. I'm sure you have similar expressions in
network engineering.

The purpose of a "hello world" application is to introduce the developer to
one of these three concepts: output. Output can take on many forms, but the
earliest and simplest form remains the command-line, or "console" as it is
known today. The only thing that a console app puts out is text. And the
only thing it accepts is text. So, it clears away all the extraneous stuff
to enable the beginner to concentrate of pure concept.

A console app that writes "hello world" would look something like the
following:

namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("hello world.");
}
}
}

Very simple and straightforward. It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment Threading
model, and output.

All of these could be discussed, studied and understood before moving on to
the next step, which would be input. For that, the developer would add
something like:

string s = Console.ReadLine();
Console.WriteLine(s);

This introduces a couple more concepts: variables, data types, and output.
Again, each new concept would be studied and understood before moving on.

Most beginning-level books and courses (good ones) include a "hello world"
app to start with. Learning programming is like eating an elephant. It can
be done, but is best done in small "bytes." ;-)

From there, the beginning-level developer adds a bit more, building on what
has already been learned, and often adding to the same program in the
process. Processing could be introduced with something like the following:

int i = 2;
int i2 = 3;
var i3 = i + i2;
Console.WriteLine("i = " + i.ToString());
Console.WriteLine("i2 = " + i2.ToString());
Console.WriteLine("i + i2 = " + i3.ToString());

Again, a simple, but powerful and clear example, which also introduces the
concept of Methods (the Int32.ToString() Method),
and operators ("+"), as well as operator overloading ("+" used for addition,
as well as for string concatentation).

After that, other basic concepts, like sequence, selection, and iteration
could be introduced, studied, and mastered.

The idea here is that all programming, from a simple Console app to a Web
Service, does the same things "under the hood." Programming is like
mathematics (actually, programming *is* mathematics), which is all based on
counting at the lowest level. Addition is counting up. Subtraction is
counting down. Multiplication is counting addition operations. Division is
counting subtraction operations. Fractions express division operations. And
so on, defining arithmetic. Algebra is arithmetic with symbols representing
numbers and arithmetic statements that evaluate to numbers. And so on.

The same goes for programming. All programming is based upon the concepts of
input, output, and processing, and involves sequence, selection, and
iteration. Text is just numeric values translated into graphical
representations of the letters that correspond to the numbers. Graphics, and
graphical user interfaces, for example, are simply long strings of numbers
which are broken up into substrings of equal length, each representing a
combination of 3 numbers whose values represent intensities of red, green,
and blue, and displayed by coloring pixels on the screen with the color
values represented by those numbers, one line on top of the other, creating
a rectangle.

Each level of programming builds on the level below it. Skipping the lower
levels, while an attractive prospect to some, tends to cripple the student
at some point, requiring a re-learning of that which was skipped previously.
Sort of like trying to learn calculus after skipping trigonometry.

If you start with the basics, however, and work your way up, it isn't really
hard at all.

For the most part, of course! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Blaze" <Bl***@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I have 2 books on the way. I know a TON about web services and how to use
them and the way XML interacts with apps. I am a very experienced network
engineer with a pretty good grasp on technology. I just don't know how to
program, but am learning by myself. Do you have a suggested reading on the
"hello world" console app?

Thanks!

Blaze

"Kevin Spencer" wrote:
Dude, you're just starting to learn programming, and you begin by trying
to
write a Web Service? that could have something to do with it. You might
want
to start with a simple "hello world" console app.

A book about Visual Studio.Net presupposes that one has some experience
with
programming. Get yourself a beginning-level programming book, and work
your
way up from there. You really don't want to present yourself with too
many
challenges at first; you'll get frustrated and quit!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

Nov 17 '05 #8

P: n/a
>
namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("hello world.");
}
}
}

Very simple and straightforward. It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment
Threading model, and output.


A couple of things here:

Firstly the code won't compile as it stands - this is the simplest app you
can write in C#, paste it into a .cs file created with notepad and once
saved, run csc.exe against the file. This will print out "Hello world".

class App
{
static void Main()
{
System.Console.WriteLine("Hello world");
}
}

This is as much as anyone needs to get started. And then the rest of your
post is great Kevin about taking it further. We can introduce the using
statement

using System;
class App
{
static void Main()
{
Console.WriteLine("Hello world");
}
}

Note that this means you no longer have to write System.Console and is a way
of saving yourself some typing when you use alot of types from the same
namespace.

Secondly: introducing concepts such as COM apartment threading to someone
just starting out is way too much information and something that is
absolutely not necessary at this stage.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #9

P: n/a
LOL... Thank you for all the information, I will use it in all gratefullness
as I learn a new avenue in the computer world.

BTW, I agree about the Apartment Threading... I live in a house and don't
like to sew:)

Thanks guys... You've pointed me in the right direction.

See you back here in a few weeks when I get my books and start away!

Blaze

"Richard Blewett [DevelopMentor]" wrote:

namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("hello world.");
}
}
}

Very simple and straightforward. It does introduce a few concepts, such as
namespaces, classes, the Main() method, Single Threaded Apartment
Threading model, and output.


A couple of things here:

Firstly the code won't compile as it stands - this is the simplest app you
can write in C#, paste it into a .cs file created with notepad and once
saved, run csc.exe against the file. This will print out "Hello world".

class App
{
static void Main()
{
System.Console.WriteLine("Hello world");
}
}

This is as much as anyone needs to get started. And then the rest of your
post is great Kevin about taking it further. We can introduce the using
statement

using System;
class App
{
static void Main()
{
Console.WriteLine("Hello world");
}
}

Note that this means you no longer have to write System.Console and is a way
of saving yourself some typing when you use alot of types from the same
namespace.

Secondly: introducing concepts such as COM apartment threading to someone
just starting out is way too much information and something that is
absolutely not necessary at this stage.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Nov 17 '05 #10

P: n/a
> Firstly the code won't compile as it stands

Firstly, I compiled it in Visual Studio, where I wrote it, and it ran.
this is the simplest app you can write in C#, paste it into a .cs file
created with notepad and once saved, run csc.exe against the file. This
will print out "Hello world".
My point was not to show the OP the simplest code he could write. The point
of the code examples was to illustrate the concept of starting small, and
building up from there. Your criticisms do nothing to clarify the issue at
hand; they simply obfuscate the issue to an admitted beginner.

Programming is all about requirements. The primary requirement which my post
was designed to satisfy was the requirement of assisting the OP with his
question. The requirement I was satisfying with my illustration was to
illustrate the concept of starting small, and building up one's knowledge a
piece at a time.

Anything added to an application, which impedes the satisfaction of the
requirements of an application is not logical. This holds true for
communication as well. Any information which is given in the context of
helping a person to understand an issue he/she has requested information
about, and does not provide further or better understanding regarding that
issue, but instead "muddies the water," is not beneficial, and therefore not
logical.

In other words, the code which I posted was not intended as a primer for
beginning programmers, nor was it presented as such. It was presented as an
illustration of what the proverbial "hello world" example, which the OP
asked about, might look, in order to clarify the reference to it.

Specifically, the entire message was written as an answer to the following
question from the OP:
Do you have a suggested reading on the
"hello world" console app?
From reading the question, I determined that he did not know what I was
referring to when referencing the proverbial "hello world" app. So, I begain
with some explanatory remarks, followed by some illustrative examples, which
served the purpose of clarifying the explanatory remarks. These illustrative
examples were prefaced with this statement:
A console app that writes "hello world" would look something like the
following:


Note the usage of the phrase "something like" in the sentence. This clearly
indicates that the examples to follow were to be illustrative of a concept
(the "hello world" app, which exists in many different forms around the
word), not a tutorial on programming.

Personally, I have better things to do with my time than critique the
responses of others in my attempts to give aid to those who need it. When I
do, it is because there is something in the response that either conveys
incorrect information, or may otherwise be counter-productive to the aid of
the person asking for help. If a response fails to help, or needs further
clarification, I tend to post my own response separately.

As for the critique, I find it lacking in merit. The criticisms are
completely matters of opinion, and are about issues which are not germain to
the issue of helping answer the OP's questions. In some cases, the
criticisms are just plain wrong ("the code won't compile as it stands").

Admittedly, I am in an irritable mood right now, for reasons that are
personal to me. However, I might ask, how does this critique of your
critique make *you* feel?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:%2****************@tk2msftngp13.phx.gbl...

namespace ConsoleTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("hello world.");
}
}
}

Very simple and straightforward. It does introduce a few concepts, such
as namespaces, classes, the Main() method, Single Threaded Apartment
Threading model, and output.


A couple of things here:

Firstly the code won't compile as it stands - this is the simplest app you
can write in C#, paste it into a .cs file created with notepad and once
saved, run csc.exe against the file. This will print out "Hello world".

class App
{
static void Main()
{
System.Console.WriteLine("Hello world");
}
}

This is as much as anyone needs to get started. And then the rest of your
post is great Kevin about taking it further. We can introduce the using
statement

using System;
class App
{
static void Main()
{
Console.WriteLine("Hello world");
}
}

Note that this means you no longer have to write System.Console and is a
way of saving yourself some typing when you use alot of types from the
same namespace.

Secondly: introducing concepts such as COM apartment threading to someone
just starting out is way too much information and something that is
absolutely not necessary at this stage.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Nov 17 '05 #11

P: n/a
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uN**************@TK2MSFTNGP14.phx.gbl...
Firstly the code won't compile as it stands


Firstly, I compiled it in Visual Studio, where I wrote it, and it ran.
this is the simplest app you can write in C#, paste it into a .cs file
created with notepad and once saved, run csc.exe against the file. This
will print out "Hello world".


My point was not to show the OP the simplest code he could write. The
point of the code examples was to illustrate the concept of starting
small, and building up from there. Your criticisms do nothing to clarify
the issue at hand; they simply obfuscate the issue to an admitted
beginner.

Programming is all about requirements. The primary requirement which my
post was designed to satisfy was the requirement of assisting the OP with
his question. The requirement I was satisfying with my illustration was to
illustrate the concept of starting small, and building up one's knowledge
a piece at a time.

Anything added to an application, which impedes the satisfaction of the
requirements of an application is not logical. This holds true for
communication as well. Any information which is given in the context of
helping a person to understand an issue he/she has requested information
about, and does not provide further or better understanding regarding that
issue, but instead "muddies the water," is not beneficial, and therefore
not logical.

In other words, the code which I posted was not intended as a primer for
beginning programmers, nor was it presented as such. It was presented as
an illustration of what the proverbial "hello world" example, which the OP
asked about, might look, in order to clarify the reference to it.

Specifically, the entire message was written as an answer to the following
question from the OP:
Do you have a suggested reading on the
"hello world" console app?


From reading the question, I determined that he did not know what I was
referring to when referencing the proverbial "hello world" app. So, I
begain with some explanatory remarks, followed by some illustrative
examples, which served the purpose of clarifying the explanatory remarks.
These illustrative examples were prefaced with this statement:
A console app that writes "hello world" would look something like the
following:


Note the usage of the phrase "something like" in the sentence. This
clearly indicates that the examples to follow were to be illustrative of a
concept (the "hello world" app, which exists in many different forms
around the word), not a tutorial on programming.

Personally, I have better things to do with my time than critique the
responses of others in my attempts to give aid to those who need it. When
I do, it is because there is something in the response that either conveys
incorrect information, or may otherwise be counter-productive to the aid
of the person asking for help. If a response fails to help, or needs
further clarification, I tend to post my own response separately.

As for the critique, I find it lacking in merit. The criticisms are
completely matters of opinion, and are about issues which are not germain
to the issue of helping answer the OP's questions. In some cases, the
criticisms are just plain wrong ("the code won't compile as it stands").

Admittedly, I am in an irritable mood right now, for reasons that are
personal to me. However, I might ask, how does this critique of your
critique make *you* feel?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox


Sorry Kevin,

I my post obviously came off far ruder than I meant. All I was saying was
that if the OP cut and pasted your code into a file and ran the compiler
against it it would not have succeeded because there was no "using System;"
at the top and so using Console.WriteLine would not have worked.

Most of the rest of my post was meant to be a reponse to the OP to get him
started with total bare bones which your post then built up from excellently
(as I thought I said).

Finally about apartment threading, if the OP hasn't done programming (let
alone COM) then the [STAThread] attribute is more info than he needs and may
just confuse matters - but as you say, I guess thats a matter of opinion.

Sorry for any offence

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 17 '05 #12

P: n/a
Thanks for understanding my bad mood, Richard. No offense taken.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co
dot uk> wrote in message news:ua**************@TK2MSFTNGP14.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uN**************@TK2MSFTNGP14.phx.gbl...
Firstly the code won't compile as it stands


Firstly, I compiled it in Visual Studio, where I wrote it, and it ran.
this is the simplest app you can write in C#, paste it into a .cs file
created with notepad and once saved, run csc.exe against the file. This
will print out "Hello world".


My point was not to show the OP the simplest code he could write. The
point of the code examples was to illustrate the concept of starting
small, and building up from there. Your criticisms do nothing to clarify
the issue at hand; they simply obfuscate the issue to an admitted
beginner.

Programming is all about requirements. The primary requirement which my
post was designed to satisfy was the requirement of assisting the OP with
his question. The requirement I was satisfying with my illustration was
to illustrate the concept of starting small, and building up one's
knowledge a piece at a time.

Anything added to an application, which impedes the satisfaction of the
requirements of an application is not logical. This holds true for
communication as well. Any information which is given in the context of
helping a person to understand an issue he/she has requested information
about, and does not provide further or better understanding regarding
that issue, but instead "muddies the water," is not beneficial, and
therefore not logical.

In other words, the code which I posted was not intended as a primer for
beginning programmers, nor was it presented as such. It was presented as
an illustration of what the proverbial "hello world" example, which the
OP asked about, might look, in order to clarify the reference to it.

Specifically, the entire message was written as an answer to the
following question from the OP:
Do you have a suggested reading on the
"hello world" console app?


From reading the question, I determined that he did not know what I was
referring to when referencing the proverbial "hello world" app. So, I
begain with some explanatory remarks, followed by some illustrative
examples, which served the purpose of clarifying the explanatory remarks.
These illustrative examples were prefaced with this statement:
A console app that writes "hello world" would look something like the
following:


Note the usage of the phrase "something like" in the sentence. This
clearly indicates that the examples to follow were to be illustrative of
a concept (the "hello world" app, which exists in many different forms
around the word), not a tutorial on programming.

Personally, I have better things to do with my time than critique the
responses of others in my attempts to give aid to those who need it. When
I do, it is because there is something in the response that either
conveys incorrect information, or may otherwise be counter-productive to
the aid of the person asking for help. If a response fails to help, or
needs further clarification, I tend to post my own response separately.

As for the critique, I find it lacking in merit. The criticisms are
completely matters of opinion, and are about issues which are not germain
to the issue of helping answer the OP's questions. In some cases, the
criticisms are just plain wrong ("the code won't compile as it stands").

Admittedly, I am in an irritable mood right now, for reasons that are
personal to me. However, I might ask, how does this critique of your
critique make *you* feel?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox


Sorry Kevin,

I my post obviously came off far ruder than I meant. All I was saying was
that if the OP cut and pasted your code into a file and ran the compiler
against it it would not have succeeded because there was no "using
System;" at the top and so using Console.WriteLine would not have worked.

Most of the rest of my post was meant to be a reponse to the OP to get him
started with total bare bones which your post then built up from
excellently (as I thought I said).

Finally about apartment threading, if the OP hasn't done programming (let
alone COM) then the [STAThread] attribute is more info than he needs and
may just confuse matters - but as you say, I guess thats a matter of
opinion.

Sorry for any offence

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Nov 17 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.