The usage of the 1 prefix in the on join event is irrelevant when combined with the * wildcard. Also most networks require you to have ops in the channel before allowing you to set a mode and/or kick (likewise with ban), and your code doesn't check for that.
The usage of the @ character in the prefix section of the on join event (as shown in Riamus' code) ensures that the client (person/bot) running the code has ops in the channel before issuing the ban command.
If you were to look at the actual sequence of events that are completed when the ban command is issued with the -k switch, you would see that the ban mode is set first, then the person is kicked.
For the above reasons, I find that Riamus' code to be superior.