Make a semicolon optional #4690
-
SummaryMy idea is to make a semicolon optional using System
using System.Security.Cryptography
namespace gRPCTestTiEventsy
{
public class User
{
public string Email { get set }
public string PasswordHash { get set }
public User(string email, string password)
{
Email = email
PasswordHash = HashPassword(password)
}
private static string HashPassword(string password)
{
byte[] salt
byte[] buffer2
if (password == null)
throw new ArgumentNullException("password")
using (var bytes = new Rfc2898DeriveBytes(password, 0x10, 0x3e8))
{
salt = bytes.Salt
buffer2 = bytes.GetBytes(0x20)
}
var dst = new byte[0x31]
Buffer.BlockCopy(salt, 0, dst, 1, 0x10)
Buffer.BlockCopy(buffer2, 0, dst, 0x11, 0x20)
return Convert.ToBase64String(dst)
}
}
} MotivationMany languages (Kotlin, Go, Python, JavaScript) reject a semicolon.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
No. |
Beta Was this translation helpful? Give feedback.
-
Duplicate of #496 and dotnet/roslyn#5355. |
Beta Was this translation helpful? Give feedback.
-
No semicolon will make syntax much more complex. Statement boudaries will require to be inferred, which can be not robust when little typo. |
Beta Was this translation helpful? Give feedback.
No.
https://twitter.com/jaredpar/status/1010195445887336450