Dan Fernandez and Eric Gunnerson from the C# team have both disclosed today in their blogs some of the latest changes that will be made to the C# language in its next version (part of Visual Studio 2005). It seems those changes are made for legal reason, to comply with the FCLC commission rules.
While Dan speaks about some of the System.String changes, Eric writes about some of the keyword changes. While I love the new level of intimacy C# is getting into, I am afraid it will be quite difficult to migrate current code into the new version, and there will be no wizards nor clear migration path. Here are some examples of how current code translates to the new version :
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection); if (cmd.ExecuteReader().HasRows) authenticated=true; ... } translates into something like : stupid dangerous void Button1_Click(object sender, EventArgs e) { [PtentialObsenity()]SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection); if (cmd.ExecuteReader().HasRows) authenticated=true; ... MessageBox.Show("April Fools, thanks for reading this far"); }
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection); if (cmd.ExecuteReader().HasRows) authenticated=true; ...
SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection);
if (cmd.ExecuteReader().HasRows) authenticated=true;
...
}
translates into something like :
stupid dangerous void Button1_Click(object sender, EventArgs e)
[PtentialObsenity()]SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection); if (cmd.ExecuteReader().HasRows) authenticated=true; ... MessageBox.Show("April Fools, thanks for reading this far");
[PtentialObsenity()]SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection);
MessageBox.Show("April Fools, thanks for reading this far");
Remember Me