|
I know that works, but I don't like it.
|
|
|
|
|
Glad to know I'm not alone!
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
No your not alone in thinking its uugly!
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I think I see the problem - you've got a redundant new int[,] in there!
int[,] numbers = { { 11, 21, 31 }, { 12, 22, 32 }, { 13, 23, 33 }, { 14, 24, 34 }, { 15, 25, 35 }, { 16, 26, 36 }, { 17, 27, 37 }, { 18, 28, 38 } };
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If you gave me that code as an answer, I would give you the first line in your signature as a response
|
|
|
|
|
OriginalGriff wrote:
Am I alone in thinking that's really nasty and unobvious?
Probably not, I bet a few others agree with you.
I personally don't find it ugly, specially with better formatting it can be quite readable.
|
|
|
|
|
The number 33 ticks me off a little bit, but other than that the line looks fine.
|
|
|
|
|
There is a phobia for that.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Wow, I like it, it is wonderful Yes, it is a bit unnatural.
By the way, for I while I thought it was Lua . However Lua output would have had more respect for the data structure.
Veni, vidi, vici.
|
|
|
|
|
What were you expecting?
The reasonable man adapts himself to the world; the unreasonable man adapts the world to himself.
Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
|
|
|
|
|
A compiler error would have been nice...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
?! On my machine it runs and does exactly what expected...
What do you want a compiler error for?!?!
|
|
|
|
|
To stop people doing it...if you declare something as a 2D array, then being able to use it as a 1D array is just...nasty...and it opens all sorts of "future behaviour" problems. Although MSDN does say "You can do this"[^] it doesn't lay down in stone the order in which such elements will be processed - which means that it could chanmge in future .NET releases, or be different between .NET and Mono for example.
It's just a trick - not something you should do in "real" code.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
OriginalGriff wrote: It's just a trick - not something you should do in "real" code.
There is all sorts of stuff like that though.
I would say that younger developers get the notion that once they 'learn' a new idiom that they start looking for places where it can be applied without any thought as to the maintenance cost or real applicability.
Of course I have seen developers into at least their late 30s doing that as well. And defend the usage as ideal based on rationalizations that it requires fewer lines and that real developers should understand that code anyways. Never seen a rationalization that actually supported delivering code though.
|
|
|
|
|
Had it been a jagged array int[][] numbers = { new int[] { 11, 21, 31 }, new int[] { 12, 22, 32 }...
I would expect and is getting an error.
The reasonable man adapts himself to the world; the unreasonable man adapts the world to himself.
Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
|
|
|
|
|
I agree - but the code does what it says (if you get me) i.e. for each integer in the collection of numbers ... It's sort of spookily nice.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
programming questions need to get addressed to Christan Grausss.
However, yes it looks crap - i recommend you quit writing code like that
Bryce
MCAD
---
|
|
|
|
|
What is the (missing) problem exactly?
You might not be alone, but this doesn't steer any emotion other than indifference to me...
modified 30-Oct-13 23:47pm.
|
|
|
|
|
Just needs more line feeds is all.
At least it doesn't use var .
|
|
|
|
|
OriginalGriff wrote: Am I alone in thinking that's really nasty and unobvious? The way all code should be
-- RP
|
|
|
|
|
|
you're in the wrong forum
|
|
|
|
|
Hi Peter,
Please do not post programming questions in The Lounge. Use the Q/A Section[^].
Also please use the "code" feature (from the toolbar) for your code, so that it can be readable.
And do not cross-post, be patient and someone will answer your question. You cannot ask the same question at multiple places.
|
|
|
|
|
What part of "if you need specific help please use the programming forums." did you assume did not apply to you?
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
"Scientists have found a planet way out in the cosmos that's close in size and content to Earth - an astronomical first.
But hold off on the travel plans. This rocky world is so close to its sun that it's at least 2,000 degrees hotter than here, almost certainly too hot for life."
If it's 2000 degrees hotter, how the f*ck does that qualify as "earth-like"?That's like saying Europa is "earth-like" because it's freakin' round. But whoa up there, big fella. Europa has no atmosphere, is covered in frozen methane, and it doesn't really get any heat from the sun.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|