Language preferences on all posts? (Cagsy's blog)

Cags

Contributor
Joined
Feb 19, 2004
Messages
695
Location
Melton Mowbray, England
I noticed that in the Profile section there is a space for writing your language preferences. Is it at all possible that this information be shown with every post like the avatar, signature, post count and everything else. The reason I ask is I've lost count of the amount of threads where examples have been given in one language only to find the user only understands another. Users that had the foresight to add such information to their signature are rare in these parts.
 
This has come up at least a few times before and as I recall it isn't really an option in the forum.

What about .Net 1.1 vs 2.0? Things get complicated very quickly.

Since both C# and VB.Net are so widely available now, I think we should be encouraging people to recognize that if they know VB.Net, then they also know C# -- as Diesel, uh...so eloquently put it,
Diesel said:
What the ****! **** VB.NET. It's all the ****ing Same! Learn to program you dumbass!
Your first language was VB, right, Cags? How did you become multilingual? I bet at some point you recognized (the same as I) that C# and VB.Net are basically the same when you are using .Net constructs. Perhaps something in the tutorial section about reading C# for VB programmers and reading VB for C# programmers would do the trick? Then you, as a helper, can post in whatever language you are most comfortable and the person being helped can learn something new about .Net and be introduced to a new language. Because let's face it, other than a few mysterious syntactic differences, the stuff between the { }'s and Public *...End *'s is basically the same. Even in C++.Net these days.

Then again, I'm assuming users can actually think for themselves and aren't looking for handouts all the time...
 
My first language was VB6, which I taught myself before I started University. Then at University I studied abit of Java and some more VB6. I had never even heard of the .Net Framework untill I started my industrial placement year for my sandwich degree. I was hired as a basic HTML Web developer, but on my first day my employer turned around and said "We've changed our mind about what we want you todo. Here's C# write us a client application for our software suite.". I was shocked to say the least, but I sat down and taught myself C#. I would now call C# my main language, but most things are easily transferable between that and VB .Net based on my VB6 experience, plus a few titbits I've picked up along the way.

I think I may have posted the suggestion myself previously, or at least commented on somebody elses post. I guess I should have checked before posting, but it seemed a pertinent problem at the time. Whilst as you say it gets confusing based on language, version etc. I would have thought it should still be possible to display any information the user does put in the box, along with their signature. Alternatively perhaps at the very least a prompt could be added to the sign up process advising the new user to add such information to their signature or in their post. It's along time since I joined up, so I can't really remember the process, but I don't remember seeing anything like this.
 
It sounds like you had a bit more of a "forced march" from VB6 to C#. Plus, you went to college and have a solid computing/programming background which might be a bit much to expect for most users on this forum. For the record, I'm the same way. I learned C/C++ in college with a smidge of Java, picked up VB.Net for a rapid prototyping gig at work after college and then started making real programs in it. Given my background, translating from VB to C# was pretty easy with the exception of a few things like properties. My point is that we are probably unique in that we had the ambition and knowledge to do the translations on our own. Maybe I am asking too much for folks to help themselves.

From my experience administrating other forums (phpBB granted), simple, extra information is sometimes harder to put in than you would think. I don't know much about this forum though, so maybe there is something that can be done...

The big question, though, for the ultra n00bs who are looking for handouts and would be most affected by a C# post when they wanted VB, what is the probability they would actually put that sort of information in their profile? A quick, random survey of users with less than 100 posts shows that most don't have the necessary info anyway.
 
I learn't practically nothing about programming from University. I learnt a fair bit during my time there, but very little of it was actually taught. Ironically I failed a module on 2d graphics, then went on to spend my placement creating a GDI+ based Pocket PC client. Each class had a paint method that was called by the parent Canvas class, this avoided the need for anything based on the Control class allowing for a faster application and nice features such as translucent controls. Needless to say it was more complicated than the module.

If I typed everything I thought, I would seem as impatient and rude as Diesel can be at times. It really annoys me when somebody asks for a translation of something really simple like this...
C#:
If(a > b)
{
    Messagebox.Show("a is bigger");
}
else
{
    Messagebox.Show("b is bigger");
}
Maybe I've become jaded with experience, but how difficult can it be to work out that's a simple if statement. There are so few differences a trained monkey with a basic understanding of VB could translate it. I'm all for people learning, let's face it you look back at my posts, I imagine theres a fair few that make me look like an idiot (and no doubt theres more to come), but come on. It wouldn't surprise me if somebody asked how to convert this to VB.
C#:
System.IO.File.Exists("c:\file.xml");
In my opinion people that struggle with things like that shouldn't adventure out into forums, they should be reading books, tutorials or go to college. The problem is, they tend to be people that don't really want to learn, they want to be able to say 'look what I made', regardless of the fact its all cut and paste. When I was browsing through CodeProject.com the otherday I came across forum reports of somebody having the nerve to take the code from a tutorial (a Bubble Bobble clone written in .Net for PPC) compile it, and try to sell it on Handango.com.

The only thing that stops me berating people at times is the thought of how the Experts and Guru's such as the ever helpfull PlausiblyDamp et al must feel trying to drum information into my skull when I ask stupid question.

To prevent this post from becoming a complete diatribe and since I've already gone way of topic. I'd also like to mention that MrPaul, whilst being a newcomer to the community, has posted nothing but intelligent clearly explained posts. If MrPaul stays with us I personally feel they (I'd say he, but you never know) would be a good candidate for an expert ranking.

Maybe this thread should have been called Cagsy's blog.
 
The fact is that there are a lot of people who pop into the forum just beginning to learn or at most inexperienced. I happen to have a little experience in C++, so when I made the transition from VB6 to VB.Net it took me about a week, and when I made the transition from VB.Net to C# it took me about a day. For someone who has only VB experience (or worse yet, only VB6 experience), C# looks like Chinese and there is a good chance that they have no idea whether or not their particular version has a particular feature. The only real similar looking code is variable assignment and function invocation. Variable declarations, function definitions, especially properties, and all those scary curly braces don't mean anything to an inexperienced VB programmer.

It would be great if there were an option in the profile, right when you joined, where you could specify language and version, but it doesn't appear to be a possibility. I think the ultimate reality is that we just have to deal with it.
 
Is there a tutorial in our knowledge base for translating between C# and VB.Net and vice versa? Maybe if I have time I'll toss something together over the next few days. Or I could just start a quick post right now and people can just contribute as needed...not a formal tutorial or anything. What do you guys think? Of course it would be up to us to point out that it exists and link to it when translation questions come up, but it might be better off than what we currently have.
 
That sounds like a good idea, all it really needs to be is an explanation of converting the standard declarations, loops and conditional statements. Anything more complex can be added as and when thought of.
 
If you don't know both languages, just use the tool that converts C# to VB.Net and visa versa.

Thats how I learned most of the C# I know. I would write it in VB.Net and hit convert and see what changed. There really aren't that many differences and once you get a basic gist of C# you can at least vaguely figure out what someone is getting at.
 
I've started a thread for C# to/from VB.Net Recipes. I might have started off at too low a level, but it's a start. Feel free to add to it as there is a need.

Put a link to the conversion tool up there too, if you would.
 
Thanks for posting those up. They look pretty good for the most part.

I just tried out the C# to VB web translator...
C#:
for (int i = 0; i < 100; i++)
{
   //...
}
gave me
Visual Basic:
Dim i As Integer = 0
While i < 100
 System.Math.Min(System.Threading.Interlocked.Increment(i),i-1)
End While

Not quite how I would have translated that, but as the website says...it is experimental.
 
mskeel said:
Thanks for posting those up. They look pretty good for the most part.

I just tried out the C# to VB web translator...
C#:
for (int i = 0; i < 100; i++)
{
   //...
}
gave me
Visual Basic:
Dim i As Integer = 0
While i < 100
 System.Math.Min(System.Threading.Interlocked.Increment(i),i-1)
End While

Not quite how I would have translated that, but as the website says...it is experimental.

Wow, thats an odd translation. I think it depends on each site (there are others) if they're translating the C# code directly or if they're translating the IL Code. The IL code seems like it would be trickier.

That statement was pretty straight forward that it's a "for i = x to y" so it's pretty interesting that you got a Threading.Interlocked.Increment(i)... maybe thats the code that's behind a "+="
 
Back
Top