|
Does anyone know how to install the Roslyn compiler for Visual Studio 2012 on Windows 10 ?
Download Microsoft “Roslyn” CTP from Official Microsoft Download Center[^]
I receive an error on installation and google is not really helpful. I tried several things like compatibility mode and checking the .Net installation. All seems fine (SDK installed) except that Windows 10 is not indicated as OS on the download page.
Here is the error:
[276C:211C][2016-04-18T14:25:28]: Burn v3.6.2719.0, path: C:\Users\VincentM\Downloads\RoslynSetup.exe, cmdline: '-burn.unelevated BurnPipe.{32143D4F-4C78-45CB-988A-A6B93A37845C} {2CF91043-F7AA-4AC1-B07E-82DE3CD5DCE8} 4204'
[276C:211C][2016-04-18T14:25:29]: Setting string variable 'WixBundleLog' to value 'C:\Users\VincentM\AppData\Local\Temp\Microsoft Roslyn CTP_20160418142529.log'
[276C:211C][2016-04-18T14:25:29]: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\VincentM\Downloads\RoslynSetup.exe'
[276C:211C][2016-04-18T14:25:29]: Setting string variable 'WixBundleName' to value 'Microsoft "Roslyn" CTP - September 2012'
[276C:211C][2016-04-18T14:25:29]: Detect 1 packages
[276C:211C][2016-04-18T14:25:29]: Setting numeric variable 'VisualStudio11SdkInstalled' to value 1
[276C:211C][2016-04-18T14:25:29]: Setting numeric variable 'VisualStudio11ProCoreInstalled' to value 1
[276C:211C][2016-04-18T14:25:29]: Detected package: Roslyn.msi, state: Absent, cached: None
[276C:211C][2016-04-18T14:25:29]: Condition 'VisualStudio11ProCoreInstalled' evaluates to true.
[276C:211C][2016-04-18T14:25:29]: Condition '(VisualStudio11ProCoreInstalled AND VisualStudio11SdkInstalled) OR (NOT VisualStudio11ProCoreInstalled AND NOT VisualStudio11SdkInstalled)' evaluates to true.
[276C:211C][2016-04-18T14:25:29]: Detect complete, result: 0x0
[276C:211C][2016-04-18T14:25:30]: Plan 1 packages, action: Install
[276C:211C][2016-04-18T14:25:30]: Setting string variable 'WixBundleRollbackLog_Roslyn.msi' to value 'C:\Users\VincentM\AppData\Local\Temp\Microsoft Roslyn CTP_20160418142529_0_Roslyn.msi_rollback.log'
[276C:211C][2016-04-18T14:25:30]: Setting string variable 'WixBundleLog_Roslyn.msi' to value 'C:\Users\VincentM\AppData\Local\Temp\Microsoft Roslyn CTP_20160418142529_0_Roslyn.msi.log'
[276C:211C][2016-04-18T14:25:30]: Planned package: Roslyn.msi, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[276C:211C][2016-04-18T14:25:30]: Plan complete, result: 0x0
[276C:211C][2016-04-18T14:25:30]: Apply begin
[106C:274C][2016-04-18T14:25:30]: Creating a system restore point.
[106C:274C][2016-04-18T14:25:30]: Created a system restore point.
[106C:274C][2016-04-18T14:25:31]: Caching bundle from: 'C:\Users\VincentM\AppData\Local\Temp{c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}.be\RoslynSetup.exe' to: 'C:\ProgramData\Package Cache{c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}\RoslynSetup.exe'
[106C:274C][2016-04-18T14:25:31]: Registering bundle dependency provider: {c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}, version: 1.2.20906.1
[106C:11F0][2016-04-18T14:25:31]: Verified acquired payload: Roslyn.msi at path: C:\ProgramData\Package Cache.unverified\Roslyn.msi, moving to: C:\ProgramData\Package Cache{9C2B4CBE-16F1-40DD-BCFB-80CB112D092D}v1.2.20906.1\Roslyn.msi.
[106C:11F0][2016-04-18T14:25:31]: Verified acquired payload: cab380791BEDCBEA1CB60710969DD36BD8A at path: C:\ProgramData\Package Cache.unverified\cab380791BEDCBEA1CB60710969DD36BD8A, moving to: C:\ProgramData\Package Cache{9C2B4CBE-16F1-40DD-BCFB-80CB112D092D}v1.2.20906.1\Roslyn.cab.
[106C:274C][2016-04-18T14:25:31]: Applying execute package: Roslyn.msi, action: Install, path: C:\ProgramData\Package Cache{9C2B4CBE-16F1-40DD-BCFB-80CB112D092D}v1.2.20906.1\Roslyn.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" ARPSYSTEMCOMPONENT="1"'
[106C:274C][2016-04-18T14:25:40]: Error 0x80070643: Failed to install MSI package.
[106C:274C][2016-04-18T14:25:40]: Error 0x80070643: Failed to execute MSI package.
[276C:211C][2016-04-18T14:25:40]: Error 0x80070643: Failed to configure per-machine MSI package.
[276C:211C][2016-04-18T14:25:40]: Error 0x80070643: Failed to execute MSI package.
[106C:274C][2016-04-18T14:25:40]: Skipped rollback of package: Roslyn.msi, action: Uninstall, already: Absent
[106C:274C][2016-04-18T14:25:40]: Removing cached package: Roslyn.msi, from path: C:\ProgramData\Package Cache{9C2B4CBE-16F1-40DD-BCFB-80CB112D092D}v1.2.20906.1\
[106C:274C][2016-04-18T14:25:40]: Removing bundle dependency provider: {c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}
[106C:274C][2016-04-18T14:25:40]: Removing cached bundle: {c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}, from path: C:\ProgramData\Package Cache{c6fd3e8f-5a1b-4b3a-82fe-f080a0ee2fe3}\
[276C:211C][2016-04-18T14:25:41]: Apply complete, result: 0x80070643, restart: None, ba requested restart: No
thanks!
(PS: I mainly use it for the interactive C# compiler, any good alternatives on that are also welcome)
|
|
|
|
|
Error 0x80070643 points to a .NET Framework update installation error[^].
I suspect that the Roslyn installer is trying to install an update to .NET 4.5; since Windows 10 comes with .NET 4.6 "baked-in", the update can't be applied.
Unfortunately, that means your only option will be to upgrade to VS2015. Depending on what you're doing, and the size of your company, you might be able to use Community edition[^], which is effectively a free version of VS2015 Pro.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how to declare the controller to add the lines in the database at the same time
<form class="formulaire" action="/Create/Id" method="post">
<div id="person">
<input type="Text" id="" name="name_person" value=""/>
<input type="email" id="" name="email" value=""/>
<input type="phone" id="" name="phone" value=""/>
</div>
<div id="person">
<input type="Text" id="" name="name_person" value=""/>
<input type="email" id="" name="email" value=""/>
<input type="phone" id="" name="phone" value=""/>
</div>
<div id="person">
<input type="Text" id="" name="name_person" value=""/>
<input type="email" id="" name="email" value=""/>
<input type="phone" id="" name="phone" value=""/>
</div>
<div id="person">
<input type="Text" id="" name="name_person" value=""/>
<input type="email" id="" name="email" value=""/>
<input type="phone" id="" name="phone" value=""/>
</div>
<div id="person">
<input type="Text" id="" name="name_person" value=""/>
<input type="email" id="" name="email" value=""/>
<input type="phone" id="" name="phone" value=""/>
</div>
<input type="submit" name="enregistrer" value="Enregistrer" />
</form>
|
|
|
|
|
You have just given us a dump of an HTML fragment. You are completely missing any C# context here at all, and seem to expect us to make assumptions about your codebase. I assume this is an ASP MVC page, for instance. If so, you really need to ask a fuller question in the ASP.NET forum here - remember to include as much detail as possible.
This space for rent
|
|
|
|
|
Hi All
Would appreciate some help on the following code which results in the form disappearing, rather than persisiting. Probably something really silly (code newbie, please be gentle).
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace TCPReader
{
public class frmConfiguration : System.Windows.Forms.Form
{
private void frmConfiguration_Load(object sender, System.EventArgs e)
{
}
private System.Windows.Forms.Button btnok;
private System.Windows.Forms.Button button2;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
public USBReader.readerqueue m_queue;
public USBReader.Socketclient m_sclient;
public System.Threading.Thread thread1;
public System.Threading.Thread threadClient;
private System.Windows.Forms.TextBox txtipaddres;
private System.Windows.Forms.TextBox txtportno;
private void btnok_Click(object sender, System.EventArgs e)
{
try
{
bool flag = txtipaddres.Text != "" && txtportno.Text != "";
if (!flag)
{
System.Windows.Forms.MessageBox.Show("Enter IP Address and Port No to Connet\n to the Node", "Node Control", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
Show();
}
else
{
System.IO.TextWriter textWriter = System.IO.File.CreateText(System.Windows.Forms.Application.StartupPath + "\\IPAddress.txt");
textWriter.WriteLine(txtportno.Text + ";" + txtipaddres.Text);
textWriter.Close();
DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
}
catch (System.Exception e1)
{
}
}
private void button2_Click(object sender, System.EventArgs e)
{
DialogResult = System.Windows.Forms.DialogResult.Cancel;
Close();
}
private void Configuration_Load(object sender, System.EventArgs e)
{
bool flag = !System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\IPAddress.txt");
if (!flag)
{
System.IO.TextReader textReader = System.IO.File.OpenText(System.Windows.Forms.Application.StartupPath + "\\IPAddress.txt");
string s = textReader.ReadLine();
textReader.Close();
char[] chArr = new char[] { ';' };
string[] sArr = s.Split(chArr);
txtportno.Text = sArr[0];
txtipaddres.Text = sArr[1];
}
else
{
txtipaddres.Text = "";
txtportno.Text = "";
}
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnok = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtipaddres = new System.Windows.Forms.TextBox();
this.txtportno = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.SystemColors.HotTrack;
this.label1.Location = new System.Drawing.Point(24, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(73, 18);
this.label1.TabIndex = 2;
this.label1.Text = "IP Address";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.SystemColors.HotTrack;
this.label2.Location = new System.Drawing.Point(42, 72);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(55, 18);
this.label2.TabIndex = 3;
this.label2.Text = "Port No";
//
// btnok
//
this.btnok.BackColor = System.Drawing.Color.AliceBlue;
this.btnok.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnok.Font = new System.Drawing.Font("Palatino Linotype", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnok.ForeColor = System.Drawing.SystemColors.HotTrack;
this.btnok.Location = new System.Drawing.Point(103, 114);
this.btnok.Name = "btnok";
this.btnok.Size = new System.Drawing.Size(69, 23);
this.btnok.TabIndex = 3;
this.btnok.Text = "O&k";
this.btnok.UseVisualStyleBackColor = false;
this.btnok.Click += new System.EventHandler(this.btnok_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.AliceBlue;
this.button2.Cursor = System.Windows.Forms.Cursors.Default;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button2.Font = new System.Drawing.Font("Palatino Linotype", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button2.ForeColor = System.Drawing.SystemColors.HotTrack;
this.button2.Location = new System.Drawing.Point(189, 114);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(69, 23);
this.button2.TabIndex = 4;
this.button2.Text = "&Cancel";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtipaddres);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtportno);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnok);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox1.ForeColor = System.Drawing.SystemColors.HotTrack;
this.groupBox1.Location = new System.Drawing.Point(23, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(288, 158);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Configuration";
this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
//
// txtipaddres
//
this.txtipaddres.BackColor = System.Drawing.SystemColors.Window;
this.txtipaddres.Location = new System.Drawing.Point(103, 36);
this.txtipaddres.Name = "txtipaddres";
this.txtipaddres.Size = new System.Drawing.Size(155, 25);
this.txtipaddres.TabIndex = 1;
this.txtipaddres.TextChanged += new System.EventHandler(this.txtipaddres_TextChanged);
//
// txtportno
//
this.txtportno.BackColor = System.Drawing.SystemColors.Window;
this.txtportno.Location = new System.Drawing.Point(103, 72);
this.txtportno.Name = "txtportno";
this.txtportno.Size = new System.Drawing.Size(155, 25);
this.txtportno.TabIndex = 2;
//
// frmConfiguration
//
this.AcceptButton = this.btnok;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Snow;
this.ClientSize = new System.Drawing.Size(335, 197);
this.ControlBox = false;
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "frmConfiguration";
this.Load += new System.EventHandler(this.Configuration_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
protected override void Dispose(bool disposing)
{
bool flag = !disposing || (components == null);
if (!flag)
components.Dispose();
base.Dispose(disposing);
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void txtipaddres_TextChanged(object sender, EventArgs e)
{
}
} // class frmConfiguration
}</pre>
Regards
Active
|
|
|
|
|
You don't tell us when it disappears, but if it's when you press a button then it's because you told it to:
private void btnok_Click(object sender, System.EventArgs e)
{
try
{
bool flag = txtipaddres.Text != "" && txtportno.Text != "";
if (!flag)
{
System.Windows.Forms.MessageBox.Show("Enter IP Address and Port No to Connet\n to the Node", "Node Control", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
Show();
}
else
{
System.IO.TextWriter textWriter = System.IO.File.CreateText(System.Windows.Forms.Application.StartupPath + "\\IPAddress.txt");
textWriter.WriteLine(txtportno.Text + ";" + txtipaddres.Text);
textWriter.Close();
DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
}
catch (System.Exception e1)
{
}
}
private void button2_Click(object sender, System.EventArgs e)
{
DialogResult = System.Windows.Forms.DialogResult.Cancel;
Close();
} That's what Form.Close does: closes the current form.
BTW: Don't swallow your exceptions: they mean you don't find out why it failed (or that it failed in this case). Report 'em, log 'em, whatever. But empty catch blocks don't help anyone - least of all you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks OriginalGriff
Apologies, should have made my description clearer, the form never actually appears (or if it does then it quickly disappears), it is the only form currently and I am not entering / selecting anything (I don't get the chance).
Any thoughts appreciated.
Regards
Active
|
|
|
|
|
So what code are you displaying it with?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I had expected that the following should make the form appear -
private void frmConfiguration_Load(object sender, System.EventArgs e)
{
}
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnok = new System.Windows.Forms.Button();
etc ...
Regards
Active
|
|
|
|
|
No - what code makes the form display?
Are you creating it in Main (in process.cs)?
Or do you display it from an existing form?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks, I was missing the .Run in main, thought it was something silly.
The form now appears but it is blank (no text, fields etc displaying), probably something else missing.
Regards
Active
|
|
|
|
|
I don't see any form constructor in your code? So what is calling InitializeComponent - if you don't call that in a constructor, then there will be nothing to show!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
As you say the form constructor was missing (previously created by another form), silly me, again. Now working.
I appreciate your help OriginalGriff, thanks again.
Regards
Active
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
BTW: Are you creating all this by hand? If so, why?
You do realise that VS can create a "tidier" version of all that for you automatically?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Then where is the code to display the form? It won't appears magically... (except for the initial form which is initialized by the application).
Philippe Mori
|
|
|
|
|
Please let me know the name of your software so I never use it. Anything with a namespace of TCPReader, but you don't know how to figure out why a form isn't appearing, is very scary.
--
Chizl
|
|
|
|
|
The short version: "How do you use Enums in C# as: structural element ? design strategy ? Do you see any special "danger" in using elaborate Enum structures ?"
In the last few years, somehow I have moved to more, and more, frequent use of Enums in C# ... without having, at any point in time, made a conscious decision to do so (though reading code examples by people I consider .NET gurus here on CP, and on StkO, is probably an influence). Of course, I like the idea that Enums are memory-parsimonious, simple, relatively light-weight, and I like what using the [Flags] attribute lets you do. I really like the fact Enum values are compile-time constants that can be used in a 'Switch statement block.
I've come to believe that use of Enums + Interfaces (and generic Interfaces) are, as well, very powerful tools for application design (this may be so obvious to many of you reading this that you may wonder: "where has he been ?").
I've also come to think of Enums as a form of "self-documentation" in Code, as a design-organizing principle ... I am very curious how you react to that idea.
I have, lately, been reading the historical record of various advices on best practices with Enums given my MS over time.
And, I am aware of the argument/concept that creating an app with a large dependency on Enums may result in "future fragility:" an update changes one of the Enums ... adds a new value, makes some Enum value == 0 ... and code-breaks all over the place. I wonder if there's any qualitative difference ... vis a vis an app's future modifications ... between dependency-with-Enums and dependency because of reliance on Interfaces, or Class/Struct OOP design ?
I've recently been experimenting with Enums, doing things using "nested Enums:
[Description("The Play")]
[Status("Tests Valid 03/23/2016")]
public enum ThePlay
{
Act1 = 1, Act2 = 2, Act3 = 3
}
[Description("The Murder")]
[Status("Act1 changed 12/02/2015")]
public enum Act1
{
Scene1Suspects = 1, Scene2TheDetectives = 2
}
[Description("The Suspects")]
[Status("Scene1Suspects added 12/02/2015")]
[Flags]
public enum Scene1Suspects
{
None = 0x0,
Butler = 0x2,
LadyX = 0x4,
LordX = 0x8,
Gardener = 0x10
} And, I find it easy to parse these (using Reflection) and construct a UI (like a TreeView) at run-time.using the Enums' names, values, and the content of any Attributes; it's easy to detect if the Enum uses 'Flags, relatively easy to make (using a TreeView) a node structure that enforces multiple child node checkboxes to be checked ... and, by the same token, easy enough to create a node structure that allows only one child node CheckBox to be checked
Possible drawbacks to using Enums as more than "simple" design-elements ?
1. no generic constraints of Type 'Enum allowed in generic objects: Jon Skeet has a "work-around" for this (which I haven't tried): [^]
2. more work required to serialize an Enum so it retains "Label" content.
3. Enums are not as "Type safe;" they're just "dumb wrappers" over some block of allocated integral Types.
4. an example of arguments against using Enums is presented in this article which provides code for a Class based alternative: [^].
appreciate your response.
thanks, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
|
Thanks, Garth, I will take another look at Sergey's article.
I am looking for "opinions," here, not necessarily "answers"
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
A few notes on my opinions/usages on enums:
1. I quite love enums. Especially when you use them to specify an argument to a function
Like enforcing a constraint,
enum month { jan, feb, ... , dec };
2. I know there are pitfalls, but if you know them, enums are really powerful. They are self-documenting. Code looks much better at the point of call.
Just imagine:
var lines = x.Split( new[] {"\r\n"}, SplitOptions.RemoveEmptyEntries);
The latter argument could have been a boolean, but then the code would have been much harder to understand:
<br />
var lines = x.Split( new[] {"\r\n"}, true);
3. One of the possible problems when using enums is when you add a new value. In this case, you'll pretty much need to update all the code that used switch -es based on this enum. That's why I strive to have as few functions that require a switch based on all possible values.
4. About "future fragility": If other code depends on exact enum values, I usually put a comment on top of the enum
enum month { jan = 1, feb = 2, ... , dec = 12 };
5. "Nested" enums. I have used something more or less similar in my code, but never more than 2 levels deep. So far, I haven't encountered any pitfalls.
6. Took a look at the Class based alternative - clearly, there are some scenarios for it, but I think most of the time, it's overkill (my personal opinion, of course )
Best,
John
-- Log Wizard - a Log Viewer that is easy and fun to use!
|
|
|
|
|
Thanks, John, for your comments !
I'm doing an interesting experiment right now, kind of "pushing the limits" of what one can do with Enums, using nesting, Attributes, etc. I may have gotten a little "carried away" with it, and will re-evaluate it after I restore my big-picture perspective ... look at what it would mean to use classes, and structs (with named constants, etc.) to replace the Enums, taking advantage of inheritance.
See what happens when you don't have to work for a living ?
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
BillWoodruff wrote: Thanks, John, for your comments !
My pleasure
I'm quite interested in the results, since as I said, I pretty much love Enums, especially how they are implemented in C# (clearly, they're not perfect, but I would say I'm quite happy with the current implementation).
About "pushing the limits" - I used to sometimes do that when I actually had the time , back in my C++ days (for instance, SMART_ASSERT).
Some of my "pushing the limits" experiments ended up as purely theoretical - that is, it's cool to be able to do it, but who's ever gonna understand/use it?
I am aware of the named constants instead of enums, I think I actually saw some java examples of it a long time ago. My take is that with disciplined (and smart) programmers, usually enums are enough.
And if we add the multitude of tools we now have at our disposal (such as, Resharper comes to mind; go inside the body of an enum switch -> Alt-Enter -> generate case labels), I still favor enums (vs named constants).
BillWoodruff wrote: See what happens when you don't have to work for a living ?
He he, don't we all wish to be able to not work for a living?
Best,
John
-- Log Wizard - a Log Viewer that is easy and fun to use!
|
|
|
|
|
|
|