Depends on the perspective you look at it from.
The NHL CBA is structured a lot like the NBA's, only in the NHL there is no such thing as a contract duration cap, which means no cap on the duration of a contract is required – because of that, CBA specialists in the NHL learned that the easiest way around signing what would otherwise be incredibly expensive unrestricted free agents is to sign them to lifetime (I use the term loosely) contracts where the aggregate cap hit (the average cost of the total value of the contract divided by it's years) is dropped by reducing the players actual salary (as in real dollars) at the end of the deal (under most circumstances) significantly, in years he's never actually expected to play. The beauty/curse of this is that the NHL can't viably prove that a team actually negotiated the players retirement into the contract, so it's not technically illegal, though it's obviously a loophole.
Personally, I think this is as close as you can get to laughing in the face of the rulebook, as it's quite obviously a legal loophole, and not a legitimate offer to allow these players to play well into their forties.
Yeah, I know, Recchi is still playing and he's 43, but the average retirement age is 38 in the NHL for a reason – most folks don't play very long past that, which says to me that any deal struck that allows a player to sign off numerous years into his forties, is little else but a cheap ploy to give aggregate cap hit relief to the club signing him, simply because they can.
The real issue with these types of contracts, however, comes if/when the player becomes an injury liability. Yes, the players can be placed on Long-Term Injured Reserve, and as a result the team can be alleviated cap-relief during the duration that player is injured, but not only in order to be placed on LTIR must a player have been evaluated by a doctor and deemed to miss a significant amount of time (I believe the minimum is seven games), but in the event they continually return, so too does their original cap hit. Not all players suffer injuries that severe to the point they'd be forced into injury-related early retirement, like Rick DiPietro of the New York Islanders, who signed a 15-year contract himself. When players like DiPietro start injuring themselves left-and-right, but are still under contract because they aren't forced into injury-related early retirement, the team is left with a nagging issue in the event the player thinks he is healthy enough to compete again – every time said player is brought back into the fold, the cap-hit returns, which prevents teams from being able to move on without that player at any point without the player (a) retiring, (b) being waived (and sent to the minors) or (c) traded. The player retiring is entirely on them, waiving a player with over a decade (or multiple years, period) left on his contract is an NHLPA nightmare, and trading a player who's oft-injured and has that many years/that much value left on his deal is damn-near impossible.