Skip to content

Instantly share code, notes, and snippets.

@foxiepaws
Created August 6, 2012 20:23
Show Gist options
  • Save foxiepaws/3278132 to your computer and use it in GitHub Desktop.
Save foxiepaws/3278132 to your computer and use it in GitHub Desktop.
insanity
// validate that critical values are set
if (
(mpd_conf_tb.Text == "") || (mpd_exec_tb.Text == "") || (musicdir_set.Text == "") || (playlistdir_set.Text == "") ||
(
LastFM_enable.Checked &&
(
(mpds_exec_tb.Text == "") || (mpds_conf_tb.Text == "") || (lastfm_username.Text == "") || (lastfm_pass.Text == "")
)
)
||
(
LibreFM_enable.Checked &&
(
(mpds_exec_tb.Text == "") || (mpds_conf_tb.Text == "") || (librefm_user.Text == "") || (librefm_pass.Text == "")
)
)
) // why use tons of if statements when i can just throw it together in one huge block?
{
MessageBox.Show("something wasn't set");
return;
}
// validate that critical values are set
if ((mpd_conf_tb.Text == "") || (mpd_exec_tb.Text == "") || (musicdir_set.Text == "") || (playlistdir_set.Text == "") || (LastFM_enable.Checked &&((mpds_exec_tb.Text == "") || (mpds_conf_tb.Text == "") || (lastfm_username.Text == "") || (lastfm_pass.Text == "")))||(LibreFM_enable.Checked &&((mpds_exec_tb.Text == "") || (mpds_conf_tb.Text == "") || (librefm_user.Text == "") || (librefm_pass.Text == "")))) // why use tons of if statements when i can just throw it together in one huge block?
{
MessageBox.Show("something wasn't set");
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment