A) 2 years of programming experience in any language is not a waste of time even if you never touch that language again,
B) Sunk costs, if the previous 2 years were a mistake, then don't repeat that mistake by sticking to a language and framework you don't like.
C) 2 years is nothing.
At 35 now I certainly don't consider any of that time wasted. I would suggest if you are "frowning" now - as you put in your comment - to get out and do something that doesn't make you frown... the cup of coffee will still be there, I guarantee it.