News for hackers. Stuff that matters.
Re:Read this post ‘unless’ you’re not a Ruby developer by TomSwirly on Tuesday December 13, 2022 @08:12AM (#33968366)

    die "Port numbers below 1024 are forbidden"
        if $port < 1024;
is hardly unreadable spaghetti code.
Re:Read this post ‘unless’ you’re not a Ruby developer by gpvos on Tuesday December 13, 2022 @01:34PM (#33973579)
Okay. Now compare:

    die "You may only use port numbers 1024 and higher"
        unless $port >= 1024 || is_root(current_uid());

    die "Port numbers 1024 are forbidden"
        if $port < 1024 && !is_root(current_uid());
Re:Read this post ‘unless’ you’re not a Ruby developer by hashhar on Monday December 19, 2022 @04:54AM (#34050308)
My head hurts! Does unless apply to both branches or just one. The if example is easier for sure.