andrewducker: (Default)
[personal profile] andrewducker
And also for anyone who can tell me what stupid mistake was made in this
code:

if (!OpalControlsHelper.ProgrammaticChangeOccurring)
      this.dummySchemeCombo.Text = "No";
      this.dataHeldCombo.Text="No";

I'm so tempted to start coding in Python, where you can't make this kind of mistake.

Oh, and as a note - I didn't make this mistake, I just spent 2 hours tracking it down.  My current mistakes mostly seem to revolve around unthought of results of multiple sections of event-driven code interacting in unforseen ways.

Date: 2006-03-25 11:16 am (UTC)
From: [identity profile] stillcarl.livejournal.com
Spaces around the "=" - or not in the second line?

Date: 2006-03-25 11:27 am (UTC)
From: [identity profile] azalemeth.livejournal.com
Don't switch languages - switch IDEs. If I type "if (something)" without a nice { or corresponding inline statement, I get a lovely wavy red line and little triangle in the line numbers telling me I've forgotten it. I love XCode, it is a many-trick pony....

Date: 2006-03-25 11:41 am (UTC)
From: [identity profile] hawkida.livejournal.com
I'm only guessing, I'm not familiar with the language but I reckon the first "no" is conditional and the second will happen all the time. It looks like missing out the enclosing {} is allowed but it needs to be there this time to tell the programme which bits of the following code it encompasses. Do I win?

Date: 2006-03-25 11:48 am (UTC)
From: [identity profile] hawkida.livejournal.com
Hurrah! And what do points make?

Date: 2006-03-25 12:19 pm (UTC)
From: [identity profile] robhu.livejournal.com
I imagine he's using VS.NET which does that.

Date: 2006-03-25 12:21 pm (UTC)
From: [identity profile] robhu.livejournal.com
Arrggh! I feel stupid now! And the comment about Python totally gives it away!

Date: 2006-03-25 12:37 pm (UTC)
From: [identity profile] odheirre.livejournal.com
In Code Complete, Cooper has a whole section about braces and indenting where he yells about this type of error.

Date: 2006-03-25 02:37 pm (UTC)

Date: 2006-03-25 02:38 pm (UTC)
From: [identity profile] johnbobshaun.livejournal.com
Oops, beaten to it :-)

Date: 2006-03-25 03:01 pm (UTC)
From: [identity profile] figg.livejournal.com
You might want to look at Boo. (Boo's Features (http://boo.codehaus.org/Language+Features), Boo on Wikipedia (http://en.wikipedia.org/wiki/Boo_programming_language)). It has a python like syntax, and runs on the CLI/.NET.

Haskell uses semantic whitespace too.

Date: 2006-03-25 05:22 pm (UTC)
From: [identity profile] sbisson.livejournal.com
Well, there's IronPython, so you don't need to leave .NET.

Date: 2006-03-25 05:24 pm (UTC)
From: [identity profile] sbisson.livejournal.com
Which has since moved here as a MS sponsored project.

Date: 2006-03-25 05:40 pm (UTC)
darkoshi: (Default)
From: [personal profile] darkoshi
Missing brackets. But at least it is indented nice. How does Python handle that?

Date: 2006-03-25 07:45 pm (UTC)
From: [identity profile] odheirre.livejournal.com
It's good, almost great. There's a lot of picky stuff that I question, and it's like reading a reference work from forward to back. I'd suggest Pragmatic Programmer -- it has the same "feel" and purpose, but takes a broader approach to good coding and is a better read, IMHO.

And darn it, it's McConnell, not Cooper. I've had Asylum on the brain lately.

Date: 2006-03-26 09:03 am (UTC)
From: [identity profile] robhu.livejournal.com
No it doesn't - but didn't the person above say that you got a wavy line without brackets or inline code?

Personally VS.NET is the best IDE I've ever used. There is a guy at work who uses Eclipse, but that's because it's the the best IDE for Action Script (which is what he mainly does).

Whatever criticism people have of Microsoft they make good IDEs (and mice although I believe someone else makes their mice).

Date: 2006-03-26 09:28 am (UTC)
From: [identity profile] robhu.livejournal.com
No, it's perfectly valid if a little misleading ;-)

Date: 2006-03-26 11:31 am (UTC)
From: [identity profile] azalemeth.livejournal.com
Inline ifs are meant for "small" if statements, although they're rather pointless - instead of "if (something) { do something } else {do something else}" over many lines, you have "something ? do this : do that", mainly used as part of an express (i.e. a = flag ? a : b;), but also if you've got small things to do.

I personally hate them to death as they're confusing, and lead to situations such as above, but, er, different. Ahh welL!

Date: 2006-03-26 05:31 pm (UTC)
From: [identity profile] azalemeth.livejournal.com
Yeah, that's very useful. Can you get what you're using to do it?

Date: 2006-03-27 10:14 am (UTC)
From: [identity profile] channelpenguin.livejournal.com
oh yeah Pragmatic Programmer is ace. Reminds me, I lost my copy YEARS ago...

Date: 2006-03-27 10:15 am (UTC)
From: [identity profile] channelpenguin.livejournal.com
YICK!!! Hideous. primitive. I HATE languages that have any sort of meaning or restriction for whitespace....

March 2026

S M T W T F S
1 2 3 4 56 7
8 9 10 11 12 13 14
15 161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 16th, 2026 01:41 pm
Powered by Dreamwidth Studios