|
I suspect the code is in VB (VB.NET). What did you expect from these Devs.
|
|
|
|
|
You know, considering VB was around much longer than C#, and save for something like 4 functions in VB that have no corresponding C# equivalent (or at least that used to be the case,) there is pretty much a one to one mapping between the two languages, I am going to go out on a limb and call that an ignorant statement. Have you ever done VB? Do you know the language? Again, I'll venture out, and conclude the answer is "no."
|
|
|
|
|
So you're the one person that uses VB.NET. Hi!
Jeremy Falcon
|
|
|
|
|
VB sucks. This is the underlying truth. I've been dealt with it. Now cleared that garbage with .NET bleach called GC.
|
|
|
|
|
Found another loop digging through looking for something.
Iterator<Foo> i = foos.iterator();
while (i.hasNext()) {
i.next();
}
Elephant elephant elephant, sunshine sunshine sunshine
|
|
|
|
|
What's the problem? The loop is twice as fast...
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
I prefer Vivian Stanshall's (Bonzo Dog Doo Dah Band) take on your sig:
Neil Innes remembers that the band were reportedly stopped by a local U.S. sheriff and asked if they were carrying any firearms or drugs. When they denied both, the officer asked how they were going to defend themselves. Stanshall piped up from the back of the minibus, "With good manners!"
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
That makes sense in the given content
void DoNothing() {
Iterator<Foo> i = foos.iterator();
while (i.hasNext()) {
i.next();
}
}
|
|
|
|
|
When I read that Swift to JavaScript comparison[^]... I had quite a big laugh!
Apple wanted a language that would be modern, fast and safe. To anyone who has done a bit of Objective-C in the past, hearing the term “modern” should be music to his or her ears. Apple has delivered in that regard, with adding plenty of syntactic sugar onto the language. It is evident that they were inspired by modern scripting languages such as Ruby, Python, Groovy and of course JavaScript.
Well, if that if where they get their inspiration for a "modern" language, I can be forgiven for ignoring Swift then, I guess!
(PS: I do Xamarin, long live C# )
|
|
|
|
|
I am not a Swift fan, but it has some advantages as I learned in the recent WWDC Videos as great type safety, optimization while compiling and linking and purity by coding. So Swift isnt really a scripting language but the successor of Objective-C.
I have written some C# for years and it is fine, but never Xamarin. But I think cant do all iOS stuff on Xamarin and the performance isnt too great.
Code in Swift has often only few lines of code: that scaries me.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I like how "the bad" isn't actually bad, but how a proper language should work. Like type-safety and none of that weird (and unpredictable) truthy falsey stuff
Edsger Dijkstra once said "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." I guess the same is true for JavaScript
|
|
|
|
|
I particularly liked his example of something "bad":
var myValue = "FOO";
myValue = 5;
WTF - why would you do that?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I had a JavaScript function (concocted by some coworkers) that I had to use. It was quite a big function and I wasn't very familiar with the domain, so I looked up a usage example, applied that to my own code, inspected the return value, processed it and tested some more. So after weeks of development my code suddenly broke. I had hit an edge case where the function suddenly returned something completely different (most of the time it would return an object with some values, but this time an array with completely other objects was returned)
WHYYYYY!?!?!?!?
|
|
|
|
|
Those cow-orkers were complete idiots.
And JavaScript is a back-asswards language that needs to be replaced with something that actually makes sense.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Not hard to beat JavaScript. One of the worse languages developed. Too many weird things that have to be understood. Looks like C but not anything like any other C style syntax language. Then it is used for Web stuff, and it became more ridiculous. Does not play nice with XML and yet different. If it had played nice with HTML I would have said fine. By that I mean being able to just put code in the middle and not having to do any special formatting fixing to make it work. We have been stuck with this abomination way to long.
|
|
|
|
|
Foo foo = null;
for(Foo bar: Foobars){
foo = bar;
}
if(foo == null){
return someErroR;
}
Then also:
int i = 0;
for(String s : stringArray){
if(i > 0){
stringArray[i] = joinCharacter + stringArray[i];
}
i++;
}
Elephant elephant elephant, sunshine sunshine sunshine
|
|
|
|
|
The second one would fall flat on its face in C#. Does it actually work in Java? If it does, that's a huge WTF.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Are you talking about the foreach syntax?
Elephant elephant elephant, sunshine sunshine sunshine
|
|
|
|
|
No, the modification of the collection while looping it.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Brisingr Aerowing wrote: No, the modification of the collection while looping it. I've had issues trying to remove elements from a collection while looping but I have not had an issue just changing a value of the collection items, have you?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I believe Brisingr is thinking of when you iterate through a enumerable and you attempt to update the ienumerable item.
Like the following:
for(String s : stringArray){
if(i > 0){
s = joinCharacter + stringArray[i];
}
i++;
}
It's fine to update the other referenced collection (stringArray[i]).
Brisingr probably was just thinking about that. Not trying to start a battle by speaking for him though.
|
|
|
|
|
Hate to say it, but that should work just fine, even in a C# foreach.
It's just the product of a deranged mind.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I've had code like that crash several times. It seemed kinda hit or miss. Never figured out what happened.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I'm trying to figure out how some code wires up, but it's a spider web. I'll leave all the goodness out and just get right to the point - I'm cruising around through files and notice, upon going to definition, there's an empty interface. I'm in the habbit of cleaning up code, so I remove it. Compilation error. Why ? Because all this stuff implements this interface for no other reason then to be passed around "generically" through the code.......
Elephant elephant elephant, sunshine sunshine sunshine
modified 19-Jul-16 14:52pm.
|
|
|
|
|