Wanted: C# code review

E

Emma Burrows

Hello all,

I've been writing C# applications and web sites for some time, but I'm now
planning to share my latest code with the world at www.codeproject.com. The
code works fine, but I'd like someone with a bit more experience and some
spare time to take a look at how it's organised. Being self-taught, I don't
have much experience of coding standards, and I'd like a code review to see
if I'm making the best use of the language, the framework etc.

The application sets up a low-level keyboard hook using the Windows API from
C# in order to prevent unforeseen effects when a baby or other animal is
having a go at the keyboard. So if you have some spare time and opinions to
offer, let me know!

Thanks,

Emma
(remove nospam and asterisk in email address)
 
I

Ignacio Machin \( .NET/ C# MVP \)

Ho,

What the code does?

My advise is to check MSDN for example of how they write the code. also MS
has a document where they state theirs recommended practices for writing
code, I had the link but cannot fnd it now :(
 
E

Emma Burrows

Ignacio Machin ( .NET/ C# MVP ) said:
What the code does?

Specifically, it sets up a low-level keyboard hook so that no other
applications get keyboard messages, and then displays various shapes when
keys are pressed. (I got tired of my baby son deleting files, opening web
pages and moving things around every time he got hold of my keyboard...)
My advise is to check MSDN for example of how they write the code. also MS
has a document where they state theirs recommended practices for writing
code, I had the link but cannot fnd it now :(

Thanks for the tip. I remember reading their guidelines and hopefully I have
followed them. But that's all theory; I just want to check I've actually put
some of it into practice. :)

Cheers,

Emma
 
C

clintonG

Here's some good advice: Use Visual Studio to Refactor your code. The VB
weenies currently have more choices when refactoring because a bunch of VB
sissies cried when Refactoring was provided for C# but not for VB at that
current point in time. So Microsoft over-compensated and bought an
application add-in from an ISV for VB cry babies because listening to a baby
cry gets on everybody's nerves.

Meanwhile, C# developers will have to wait to catch up with additional
refactoring support which is nothing new and would almost have certainly
been provided for the VB sissies too if they hadn't started crying and
sh!tting in their diapers.

Refactoring is the first thing you want to consider though...

Then you also want to run your code through FxCop which Microsoft uses to
test applications submitted by those in the partner program who are writing
applications to obtain points required for advanced certified partner
status. No need to go over-board with what FxCop find(it will mark code with
flags you've never heard of before) so do pay attention to what it finds and
apply the critical responses. No need to go over-board. Finally, use
contemporary naming and style conventions you can learn by reading
Microsoft's documents combined with documents published by C# MVPs who have
been certified. If English is not your native language have somebody
proof-read your work before submitting to public scrutiny.

So tell me (us) what topic are you planning to publish?

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
 
M

Michael Nemtsev

Hello Emma,

Comments have been sent

BTW, I recomend to scrutinize these resources
a) http://www.idesign.net/idesign/download/IDesign CSharp Coding Standard.zip
b) http://msdn.microsoft.com/library/d...y/en-us/vsent7/html/vxconcodingtechniques.asp

EB> Hello all,
EB>
EB> I've been writing C# applications and web sites for some time, but
EB> I'm now planning to share my latest code with the world at
EB> www.codeproject.com. The code works fine, but I'd like someone with
EB> a bit more experience and some spare time to take a look at how it's
EB> organised. Being self-taught, I don't have much experience of coding
EB> standards, and I'd like a code review to see if I'm making the best
EB> use of the language, the framework etc.
EB>
EB> The application sets up a low-level keyboard hook using the Windows
EB> API from C# in order to prevent unforeseen effects when a baby or
EB> other animal is having a go at the keyboard. So if you have some
EB> spare time and opinions to offer, let me know!
EB>
EB> Thanks,
EB>
EB> Emma
EB> (remove nospam and asterisk in email address)
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
E

Emma Burrows

clintonG said:
Here's some good advice: Use Visual Studio to Refactor your code. The VB
weenies...

Having been a VB weenie in my time, I can't say I agree with that aspect of
your post, but thank you very much for the suggestions. Refactoring is a bit
thin in VS 2005 Express Edition, but what there is is already useful; I can
see how the features in the full product would help. I've also downloaded
FxCop, which came up with a couple of things I will change.
So tell me (us) what topic are you planning to publish?

The article will just be about the low-level keyboard hook I've implemented
to stop keyboard events going any further than the application. Nothing that
isn't documented elsewhere, but it might be useful to someone.

Thanks!
 
C

clintonG

I started "developing" using the VB syntax and grammar myself but after a
couple of years I woke up after having a common sense attack.

<%= Clinton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top