|
Member 9993589 wrote: vb only developers ... can switch to c# easly [sic] but their hearts shall always stick with vb ... I love vb
I was tempted to mark this as abuse.
Once you lose your pride the rest is easy.
In the end, only three things matter: how much you loved, how gently you lived, and how gracefully you let go of things not meant for you. – Buddha
|
|
|
|
|
"I was tempted to mark this as abuse. Big Grin | "
Looking funy
|
|
|
|
|
Anything you can do in C# you can do in VB.
But...it doesn't work the other way round: and for that I'm truly glad. VB is a very old language which was designed to be used by non-programmers, and it retains some of that to this day. Most of the stuff you can do in VB that you can't in C# improves the quality of code and the ease of maintenance. String typing rather than weak typing is the major plus here, but any language which retains "On Error Resume Next" should be recycled as firelighters...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: Anything you can do in C# you can do in VB.
Unsafe code?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
All VB code is unsafe!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: Most of the stuff you can do in VB that you can't in C# improves the quality of code and the ease of maintenance. String typing rather than weak typing is the major plus here
I'll just mention dynamic then.
OriginalGriff wrote: On Error Resume Next
Ever seen an empty catch?
Don't blame crappy programming on the language.
Basic was originally pushed as a beginners language, but after all the bashing all beginners nowadays learn Java or C#.
Take another good look at Q&A some time. I'd say there are more stupid questions regarding C# than VB.Net nowadays.
Not to mention JavaScript.
|
|
|
|
|
Jörgen Andersson wrote: I'll just mention dynamic then
Please, don't. var was bad enough, but at least it has a need - Linq won't work without it. dynamic is a retrograde step IMO.
Jörgen Andersson wrote: Ever seen an empty catch?
On Error Resume Next is like an invisible empty catch block round every single line of code...empty catch is bad enough, but when you can't even see them?
Jörgen Andersson wrote: Don't blame crappy programming on the language.
I don't: you can write cr@p code in any language and (with a bit of work sometimes) you can write excellent code in every language. But some languages encourage good code, by making it harder to make mistakes. And some languages encourage cr@p code by making it harder to do things properly!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: var was bad enough, but at least it has a need - Linq won't work without it
Really?
I'm not having a good enough understanding of the plumbing behind Linq to be able to say you're wrong, but you can always select real types instead of anonymous types if you want to.
But yeah, the freaks that are known as linq to SQL spit and Linq to XML might be a different story.
OriginalGriff wrote: Error Resume Next is like an invisible empty catch block
It's rather quite visible.
The problem is rather, that actually handling errors in old VB was even worse. Just taste the syntax "On Error Goto ...", yes it says GOTO
I don't understand the need to always be backward compatible.
|
|
|
|
|
Afraid so - Linq works by creating anonymous types which are specific to the query - so if you don't have a "define this from context" variable type it can't do things like this:
var v = myCollection.Where(w => w.ID < 10).Select(s => new {ID = s.ID, Name = s.Name}); Because you can't declare
IEnumerable<WhatNameWillTheCompilerGiveThatDamnThing> v = ...
It only annoys me when people use it as a shortcut datatype:
var v = 123; Or to be really annoying
var v = GetSomething(somethingElse); because it may save you 5 seconds typing, but I'm going to have to hunt down the method declaration to try and work out the heck you are doing...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
And if you don't create anonymous types?
You'll get:
Person v = myCollection.Where(w => w.ID < 10).Select(s => new Person {ID = s.ID, Name = s.Name});
Works just fine converting types this way too, consider:
class Program
{
static void Main(string[] args)
{
List<SalesPerson> SalesPersons = new List<SalesPerson>();
SalesPersons.Add(new SalesPerson { ID = 1, Name = "Adam", IQ = 30 });
SalesPersons.Add(new SalesPerson { ID = 2, Name = "Benny", IQ = 40 });
SalesPersons.Add(new SalesPerson { ID = 3, Name = "C***", IQ = 20 });
List<Person> Persons = SalesPersons.Where(item => item.Name.StartsWith("B")).Select(item => new Person { ID = item.ID, Name = item.Name }).ToList();
Console.WriteLine(Persons.FirstOrDefault().Name);
Console.ReadKey();
}
}
public class Person
{
public int ID { get; set; }
public string Name { get; set; }
}
public class SalesPerson
{
public int ID { get; set; }
public string Name { get; set; }
public int IQ { get; set; }
}
Nothing anonymous there.
I do that a lot since I hate the fact that anonymous classes are local to the method they're created in.
So Ok that was not entirely true, you can actually pass anonymous types between methods, if you reuse the definition the compiler actually reuses the anonymous class. But that would require a lot of casting.
|
|
|
|
|
Was I that far off the target?
|
|
|
|
|
Jörgen Andersson wrote: Ever seen an empty catch? Hey! You been lookin' at my code?!
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
There are perfectly legitimate reasons to have an empty catch block.
Just can't think of any right now.
|
|
|
|
|
OriginalGriff wrote: Anything you can do in C# you can do in VB.
Events based on delegates with non-void returns?
(My personal favorite.)
|
|
|
|
|
IMHO, problem-solving skills are more important than programming language skills. Once you are able to architect a solution, the language is not that important. Try to enhance your problem-solving skills. What the end user wants is a working solution, and is, more often than not, not bothered about what's under the hood.
Having said that, its better to work in a modern language, and VB is not likely one of them. Its better to learn languages useful for the web - HTML5, CSS, JS.
|
|
|
|
|
Absolutely you are right. I think too much and i have confidence and i can say i can solve any challanging problem in vb. But i want to tell that i am in a far village where internet is available but there is no any city near and this is backward area and i am not in contact with professional peoples where from i can take some work and do it by myself.
I shall like if someone gives me some programming work i shall do it free of cost because whole day i am free in these days. And it is better to do something than doing nothing.
I learnt programming by myself in home but i never did professional working i don,t know what is professionalism. So please someone attach with me i shall server him/her free and in result i shall become professional.
|
|
|
|
|
Only once i went to a city which is far from here and i stayed there 3 months and from there i came to know vb don,t have demand in markete. After this i searched internet and i found vb realy don,t have demand in markete.
|
|
|
|
|
There is a demand. Not a big demand, but it's there. All our new projects are in C# but we have legacy VB.NET apps, including one set of web services we just worked on to handle our migration from AS/400 to Oracle. There are probably a lot of shops like ours.
Do learn C#, though. I fought it for years, and now I love it. I do miss certain functions from VB, though.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
I know html, css, javascript, asp.net(razor view), php and many others but i am not professional in any of them.
|
|
|
|
|
Really nice that you know a number of languages, sitting in not-so-big-a-place. So, you know much more than we think you know - which is good for you now.
Now, to improve your professionalism, one way (since you have a reasonably good internet connection) is to go through other's articles and code. Look at this page[^] to get some ideas about how others have created their solutions in HTML5 - I mean, study the code. Come up with your own problems, and solutions based on the learning. You also need to improve your English, for which you need to catch a local person who knows reasonably good English.
Here is a challenge for you:
- Post your first tip or technical blog on this site.
- By date: 11 Aug 2015, two months from now.
- Should be a nice solution to a small problem you choose.
Will you take up this challenge? Yes. Start today ... now.
With this, you'll slowly and gradually improve your professionalism
Don't mind if your initial attempts don't succeed to your liking, but continue to persist. Never give up.
|
|
|
|
|
"- Post your first tip or technical blog on this site."
What mean by first tip and technical blog mean separate technical blog except this site.
Please explain in some details so that i can understand task fully.
|
|
|
|
|
At this place[^], you can post your tip.
--------------------------
From that site, here is the definition of a Tip:
"What is a Tip/Trick?
A tip ... is meant primarily to provide a quick coding solution or tip. Tips and Tricks are not as exhaustive or extensive, nor do they require as much detail as an article to explain a problem and its solution. ... A tip might be only a couple of paragraphs. Tips simply state a problem and a solution."
-----------------------------------
This is what I'd like you to post within the next two months. Of course, this requires a lot of effort on your side, and quite some learning. Your tip should be a really good one, standing on its own strength, and without any loop-holes.
We'll come to Technical Blog later (once you post the Tip).
|
|
|
|
|
VB and C# are both .NET. The biggest difference is some syntax.
If you know your stuff syntax shouldn't be a problem.
I started out in VB.NET and I love it. There's a lot of undeserved hate towards VB.
That said I started doing C# because it's much more main stream. After about a month of working in C# it just came natural.
|
|
|
|
|
Learn C#, C++ or Java. In your case, C# is the best bet.
Sure, there are other languages, but they are secondary, so have fun finding work after that first job.
Oh, and learn punctuation and how to use the shift key. Based on your writing, I'd toss your resume in the trash no matter what languages you knew.
|
|
|
|
|
Well I go with the suck it up response. I came up via VB, in the early 00s I took the team, 5 developers, from VB to c# because that is what the market wants and that is what most of the support resources are coded in. The more time you spend working in c# the more comfortable you will get.
So stop moaning, suck it up, and get on with it!
And 'bro' is not a sign of respect in most cultures.
Never underestimate the power of human stupidity
RAH
|
|
|
|