Comments Can Hurt
-
I have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
-
I have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
Brady Kelly wrote:
and the "error message" was my own comment.
:laugh: :laugh: :laugh: :laugh: :thumbsup::thumbsup:
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
-
I have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
Ouch. :laugh:
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 have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
Brady Kelly wrote:
and I assumed it was the CLR complaining
That's what happens when you create professional looking comments. If you'd written "hey, dumb*ss, you can't do this!" you would have figured it out right away! :laugh: Marc
Latest Article - Merkle Trees Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
-
Brady Kelly wrote:
and I assumed it was the CLR complaining
That's what happens when you create professional looking comments. If you'd written "hey, dumb*ss, you can't do this!" you would have figured it out right away! :laugh: Marc
Latest Article - Merkle Trees Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
:laugh:
Immanentize the Eschaton!
-
I have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
-
I have a few SQL scripts as embedded resources in my app, for EF seeding. To make sure other coders, or me much later, don't go looking for these scripts, I added the following comment to the first line of each one:
-- This file is used as an embedded resource and not included in the build output.
Then I build a little
ResourceManager
that for now just reads embedded files, and when I tried it out:var script = ResourceManager.ReadEmbeddedTextFile("SeedIdTypes.sql");
and hovered over the
script
destination var, I never saw past the comment, which I had forgotten about, sayingThis file is used as an embedded resource and not included in the build output
, and I assumed it was the CLR complaining about my build settings for the script file. A wasted half hour later, I looked closer, and saw the SQL, realised the script was being read, and the "error message" was my own comment. :laugh: :-OImmanentize the Eschaton!
Ouch! I have been bitten in the rear with similar comments. Now I sign my comments with my initials and data. An added benefit, I can search for my comments.
-- This file is used as an embedded resource and not included in the build output. [BK 20170418]
Yusuf May I help you?
-
Ouch! I have been bitten in the rear with similar comments. Now I sign my comments with my initials and data. An added benefit, I can search for my comments.
-- This file is used as an embedded resource and not included in the build output. [BK 20170418]
Yusuf May I help you?
I used to do exactly the same, but I so seldom work on shared code-based these days, it's all my own, so that sort of ell by the wayside. Except I used to put the [BK 20170418] first, so it's always in the same left side of the sreen, regardless of comment length.
Immanentize the Eschaton!
-
Brady Kelly wrote:
and I assumed it was the CLR complaining
That's what happens when you create professional looking comments. If you'd written "hey, dumb*ss, you can't do this!" you would have figured it out right away! :laugh: Marc
Latest Article - Merkle Trees Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
How is it you've lucked out and never had an IDE call you a dumb*ss?
Software Zen:
delete this;