Visual Basic needs more credit
-
I would not hire you sorry. The reason you can not use the with operator in such a fashion is scope
This is hilarious. This guy is straight out of dailywtf.
-
Colborne_Greg wrote:
its not a with block
It's an object initializer, which is fully supported in C#, without needing an extra keyword. http://msdn.microsoft.com/en-us/library/bb384062.aspx[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
You sir, win the internet.
-
My employee cost vs performance says otherwise
Really? You have accurate data comparing those using 'with blocks' to those without? Those with C experience to those without? Those who know what a stack frame is compared to those who barely understand what a stack data structure is? Calls inside a 'with block' can either be accessing properties or local variables and it isn't immediately obvious which it is. You have to look up the page to see. Also, you're suppressing exceptions, which, if you're talking about cost of development, means your debugging cycle is a lot more intense because it doesn't blow up when something goes wrong.
-
You hang on there my friend and protect our beloved language. I used to be a VB.NET developer back in 2002 then I've seen the light (that would be C#), this is because I played with VB5 and VB6 during high school, because I played with QBasic during my early high school... C# pays more and is more respected by developers and generally the code written in C# tends to be higher quality as the VB.NET code tends to be written by old school guys with less OOP experience than those of C# (I am saying "tends" not all). Advice, move to C#
Make it simple, as simple as possible, but not simpler.
I think the OP needs some credit.. The intestinal fortitude required to even try to hold dialog favoring VB in anyway here is incredible. VB is my first language, partly because I've grown up my whole life under BASIC.. Partly because my first professional programming job was to convert VB6 to VB.NET and nearly every job since has required VB in one way or another. Who am I to question my employer on the politics of language? Who am I do judge my employer based on their chosen language? I pulled the trigger and learned C# and have projects I still maintain. Its different, but it works and it makes me more marketable to be able to work in both. Right now, VB.NET is the required language and is what pays my bills. When it comes to new projects where language isn't a requirement I find that any classic WinForm or windows service projects stay in VB but I aim to use C# for anything else if possible. Is C# still "the better language" if my code pattern mimics VB.NET concepts? Of course, regardless of right or wrong, it's still not VB. Is VB.NET any better of a language if my code pattern mimics C# concepts? Doubtful, because it's still VB.. I don't buy into this culture.
-
Yep, looks good to me.
You'll never get very far if all you do is follow instructions.
-
Really? You have accurate data comparing those using 'with blocks' to those without? Those with C experience to those without? Those who know what a stack frame is compared to those who barely understand what a stack data structure is? Calls inside a 'with block' can either be accessing properties or local variables and it isn't immediately obvious which it is. You have to look up the page to see. Also, you're suppressing exceptions, which, if you're talking about cost of development, means your debugging cycle is a lot more intense because it doesn't blow up when something goes wrong.
The entire difference between C# and VB are involved in that factoring, suppressing exceptions is not an acceptable thing for my employee's to do, suppressing exceptions happens by my efficiency team; who decided that at this moment didn't need to know the error. In visual basic with block
With CameraControl.LastKnownTaken DateTakenBlock.Text = .DateTaken FileNameBlock.Text = .FileName LatitudeBlock.Text = .Latitude LongitudeBlock.Text = .Longitude End With
notice the period, if you cant figure out that the words with a period before them belong to the with block I wouldn't hire you
-
You hang on there my friend and protect our beloved language. I used to be a VB.NET developer back in 2002 then I've seen the light (that would be C#), this is because I played with VB5 and VB6 during high school, because I played with QBasic during my early high school... C# pays more and is more respected by developers and generally the code written in C# tends to be higher quality as the VB.NET code tends to be written by old school guys with less OOP experience than those of C# (I am saying "tends" not all). Advice, move to C#
Make it simple, as simple as possible, but not simpler.
Visual basic 2013 is better then C#
-
It does not fail in C#.
class DataObj {
public int Height { get; set; }
}class Starter {
public static void Main() {
int Height = 23;
DataObj obj = new DataObj { Height = Height };
System.Console.WriteLine("Set to " + obj.Height);
}
}Compiles without warnings and gives the right answer. Once again, if you're going to make concrete statements about what is or isn't possible in a language, you need to check whether that statement is accurate first.
As I have learned but there is no period before either height so now the reader of the code has to guess at the scope of the object Real genius
-
No, for the love of something NO! It makes writing code easier for those that don't write code. It only exists as some one else pointed out (probably) in reaction to Borland's Delphi (Object Pascal) MS needed to make there Basic compiler have similar features to compete! Bad programmers can write bad code in any language, the language makes it easier (VB) compare to another (C#) but they compile to the same byte code, you can't tell the difference! :)
People that don't already write code are -cheaper per hour -easier to train -get the job done faster -get the job done without added flare -almost half the cost overall as other programmers -they write in full words (no bad habits)
-
Colborne_Greg wrote:
so not only do I not want it to fail for one error
It's wrong. If there's an unexpected error, then the loop should break. That's always better than hiding the exceptions.
Colborne_Greg wrote:
I don't want it to waste time trying to figure out anything related to that error.
You cannot be bothered to check your own code if it reports an error. I would recommend your users to make backups. Very frequent.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
This is only for displaying data. Apparently you want the user to wait for typos for each action, instead for a daily report of problems you are not god, you do not know every angle to program.
-
As I frequently say - it's not the tool that is used that's the problem, but the tool that uses it.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
That's why visual basic is great. I don't need to hire anyone who thinks they are a programmer. Its a tool that is easy to train people and allows me to pay them next to nothing.
-
I took a job once, with no knowledge of VB (Visual Studio 6). Hey, I just wanted a well paying part time job to finish my master's degree. One of the 'best practices' of the company was to always add "On Error Resume Next" at the beginning of each and every function. I asked why, and the reply was that it just works better that way. The job paid the bills, I graduated, I got a new job, the company went under (not because I left, but I saw the writing on the wall ahead of time - they had too many people and no contracts lined up).
On Error Resume Next Is from before the .net era and is a bad programming practice
-
How often I have seen something like that. And then the criminal who wrote this thinks he's being treated unjustly and exclaims something like "But it always has worked!". And then try to explain to Mr. Pointy Hair that this mess only pretended to work at best, fell flat on its face and was more busy covering it up than anything else at worst, and that looking away will not solve anything or save us one single cent.
The language is JavaScript. that of Mordor, which I will not utter here
I hold an A-7 computer expert classification, Commodore. I'm well acquainted with Dr. Daystrom's theories and discoveries. The basic design of all our ship's computers are JavaScript.First off criminal? no learn English maybe Secondly if you understood English you would know that a sentence doesn't start with and.
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
Let us accept the fact that our whole logic is built around our natural language, that is the HUMAN language. Therefore, the programming language that is closer to the HUMAN language is more suitable for expressing algorithms. In other words, "IF... THEN... ELSE..." is far more clear and closer to the HUMAN language than if... {... }... Prof. E. J. Yannakoudakis
-
The entire difference between C# and VB are involved in that factoring, suppressing exceptions is not an acceptable thing for my employee's to do, suppressing exceptions happens by my efficiency team; who decided that at this moment didn't need to know the error. In visual basic with block
With CameraControl.LastKnownTaken DateTakenBlock.Text = .DateTaken FileNameBlock.Text = .FileName LatitudeBlock.Text = .Latitude LongitudeBlock.Text = .Longitude End With
notice the period, if you cant figure out that the words with a period before them belong to the with block I wouldn't hire you
Let's get one thing straight, I'm the guy that does the hiring these days. I wouldn't hire you -- someone who so vehemently defends unmaintainable crap and touts it as a feature.
-
I wouldn't write such empty Try's but.... still I like it over this here ^^
} } }
}
}and this things aint better...
} //For } //If
} //Try
My entire company is based around dealing with behavior's of errors. When nothing is done for an error it was meant to be that way
-
Let us accept the fact that our whole logic is built around our natural language, that is the HUMAN language. Therefore, the programming language that is closer to the HUMAN language is more suitable for expressing algorithms. In other words, "IF... THEN... ELSE..." is far more clear and closer to the HUMAN language than if... {... }... Prof. E. J. Yannakoudakis
Yes also in C# there are two ways of writing an if statement such as If something do this result - only allows one line of code if something { do this result} - allows multiple lies of code if a coders places two lines of code in the first example the program fails...
-
Let's get one thing straight, I'm the guy that does the hiring these days. I wouldn't hire you -- someone who so vehemently defends unmaintainable crap and touts it as a feature.
I own 3 companies.
-
Colborne_Greg wrote:
second one fails
No, it doesn't. https://dotnetfiddle.net/J0N7Mm[^]
using System;
public class Program
{
public static void Main()
{
int height = 100;
var image = new Image { height = height };
Console.WriteLine("The image's height is {0}.", image.height);
}
}public class Image
{
public int height { get; set; }
}Output:
The image's height is 100.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Height = height breaks readability rules Having the period in visual basic easily allows the reader of the code to know the scope of the object, which is not so obvious
-
Height = height breaks readability rules Having the period in visual basic easily allows the reader of the code to know the scope of the object, which is not so obvious
If you're used to working in a case-sensitive language, the difference between
Height
andheight
is pretty obvious. And if you're that worried about it, you can always call your variable something else!
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer