Mathematics development can sometimes **exceed** the practical needs, right?

I read below paragraph from the book "A Friendly Introduction to Number Theory":

The use of "$$i$$" to denote the square root of negative $$1$$ dates back to the days when people viewed such numbers with great suspicion and, indeed, felt that they were so far fom being real numbers that they deserved to be called imaginar. In these more enlightened times we recognize that all1 numbers are, to some extent, abstractions that can be used to solve certain sorts of problems. For example, negative numbers (which were not used by European mathematicians even in the fourteenth century, although they were in use in India as early as AD 600) are not needed for counting cattle, but they are useful in keeping track of who owes how many cattle to whom. Fractions arise naturally when people start dealing with objects that can be subdivided, such as bushels of wheat or felds of corn. Irational numbers-that is, numbers that are not factions-appear in even the simplest sorts of measurements, as the Pythagoreans discovered when they found that the diagonal of certain geometric fgures may be incommensurable with their sides.

And...

...but even if we introduce more general irational numbers, we still won't be able to solve the very simple equation $$x^2 + 1 = 0$$. Since this equation doesn't have any solutions in "real numbers," there's nothing to stop us fom creating a new sort of number to be a solution and giving that new number the name i. This is no diﬀerent fom observing that since the equation $$x^2 - 5 = 0$$ has no solution in factions, we are fee to create a solution and call it $$J$$. In fact, we're even doing the same thing when we observe that $$3x - 7 = 0$$ has no solutions in whole numbers, so we create a solution and call it $$i$$.

As I recall from other readings, when people invented the complex number, it merely served as a bizarre way to solve some hard equations. There was no practical/massive application of such invention until years later in the electrical engineering, communication and other physics areas.

So it gives me an impression that mathematics development can sometimes exceed the practical needs. Some currently seemingly bizarre solutions/operations look that way only because a proper context just haven't revealed itself yet.

Is my understanding sound?

Yes, this happens many times. Mathematics developed purely for internal mathematical reasons, later turns out to have applications elsewhere.

See the essay by Wigner, "The unreasonable effectiveness of mathematics in the natural sciences"

I heard many years ago a lecture by Heisenberg. He told how, in finding the first things about quantum mechanics, he came up with a strange sort of multiplication, which was not commutative. When he told a mathematician, he got the reply, "Oh, yes. That is called matrix multiplication. It was intruduced by Cayley a hundred years ago."

It is well known when and why complex numbers were introduced. When you solve a cubic equation which has 3 real roots, using Cardano's formula, you obtain square roots of negative numbers in your formula, so to obtain the correct result you have to do arithmetic with complex numbers.

Of course, when Cardano's formula was discovered, it had no practical application (and perhaps has no practical application to this day). But complex numbers are important in many modern applications. Mathematicians invent things very much ahead of time, if we are speaking of applications.

A great example is binary arithmetic. When Boole first presented his work on the subject he introduced it saying, "I give you a fascinating system that has absolutely no application."*

Eventually the Navy used it to replace base 10 arithmetic in computers they were building, getting us to the world we know today.

• Source: Dr. Goldbeck's Calc 1 class.
• Dr. Goldbeck sounds unbelievable. – Francois Ziegler Oct 7 '18 at 3:53

For a skeptical balance I recommend "Solving Wigners Mystery: The Reasonable (Though Perhaps Limited) Effectiveness of Mathematics in the Natural Sciences" which argues that:

...the connections between mathematics and the natural sciences are, and always have been, rationally although fallibly forged links, not a collection of mysterious parallelisms.