Mistři v programování na #hovnokod


Anonymous,

public static bool ToBoolean(this string value)
        {
            switch (value.ToLower())
            {
                case "true":
                    return true;
                case "t":
                    return true;
                case "1":
                    return true;
                case "0":
                    return false;
                case "false":
                    return false;
                case "f":
                    return false;
                default:
                    throw new InvalidCastException("You can't cast a weird value to a bool!");
            }
        }

Anonymous,

update updateResult.Result is bool :)

private static bool StartUpdate()
		{
			Logger logger = new Logger();
			_updateMgr = new UpdateManager(logger);
			UpdateResult updateResult = _updateMgr.UpdateDB();			

			if (!updateResult.Result)
			{
				return false;
			}
			return true;
		}

Anonymous,

Zlomiť ruky, aby tento človek už nemohol chytiť klávesnicu....

string IUser.TicketFiltersJson
{
	get { return null; }
	set { }
}

Anonymous,

Aby bylo jasno ...

public class BooleanValues
    {
        public const string True = "1";
        public const string True2 = "true";
        public const string True3 = "True";
        public const string True4 = "TRUE";
        public const string False = "0";
        public const string False2 = "";
        public const string False3 = "false";
        public const string False4 = "False";
        public const string False5 = "FALSE";

        public BooleanValues();
    }

Anonymous,