Here's another Cobra vs Dirty Harry similarity: Cobra starts with Sly taking out a bad guy in a store. One of the Dirty Harry films starts with him taking out bad guys in a store. I don't remember which film it is. I think it might be The Enforcer.
And yes, when you're in the mood for action, most of Sly's movies are quite enjoyable. I like Nighthawk, too. And the Death Wish quintology (?) as well. Bronson was almost always enjoyable, even if he mellowed a bit in his later years, with the made-for-TV Family of Cops movies.