And from a visual point of view, "modern ranged combat" is dull compared to melee fights. There is a reason George Lucas created the lightsabers. From a visual standpoint, the lightsaber fights are memorable and exciting, mostly anyway. And very few people would disagree with that, regardless of what they think of the movies themselves.
(just for the record: more Star Trek than Star Wars here, but I enjoyed the original trilogy a lot)
I am always in two minds about this.
First, I will agree in milliseconds that a lightsaber fight/a sword fight (which it of course basically is) or similar is way more cinematic and enjoyable to watch than a gunfight. It is easier to choreograph changing tides of battle which is what we want to see in a dramatic fight scene - "he's got it, oh noooo, he's been countered, yessss, he escaped and now the final blow. Yes! Yesyesyes! Cigarette?" Add to that the extra spoon of cool when you are able to deflect gunfire with a melee weapon - not as good cinematically as a pure sword fight but just cool.
Then again, despite all the coolness, I always feel that the explanations why melee vs guns works are whimsical in many stories (commenting in general here). It just doesn't fly with me then. Sure, modern combat today, and that won't change probably, has a lot of close combat where knife beats machine gun IRL. But that needs the correct setup and we often do not get it (case in point: Episode 3, or was it 2, the "gladiator" scene). Often enough people rush in with their swords over open terrain - the proverbial "knife to a gunfight" - yet we are to believe it may work.
Then again, that is my personal view and if in doubt my personal problem. Oh, and of course only counts for "glorious battle", as Klingons would say. If you want to depict the madness of war, gunfire is clearly better. People dropping left and right and you don't even see the enemy.
But yeah, that was kinda off topic, please excuse me.