Definitely agree that Darkness should be castable on yourself or other friendly creature.
However, as I understand it, creatures outside the spell should be able to attack creatures inside it, just with Disadvantage. In 5e, unless a creature takes the Hide Action, their position is always known due to sound/footprints/etc.
From the Vision and Light section of the PHB:
Darkness is a heavily obscured area which "...blocks vision entirely. A creature effectively suffers from the Blinded condition when trying to see something in that area."
Blinded: "Attack rolls against the creature have advantage, and the creature's Attack rolls have disadvantage."