As other people have pointed out, in your particular example, whether you calculate $P(Y | X)$ directly from your data or you use Bayes Theorem it makes no difference. Now you posed the following question
I still don't understand why I would estimate the parameters using the "long way" (see my comment in answer to @dnqxt). Suppose I have a relatively small sample of patients for which I have the information about having cancer or not and having tested positive or not on the test. Why estimate $P(C|+)$ by calculating $P(+|C)P(C)P(+|C)P(C)+P(+|\bar{C})P(\bar{C})$ when I can estimate it directly by calculating P(C|+) on my sample?
The answer is, you wouldn't use Bayes Theorem for this problem because there is no need. The canonical problem where Bayes Theorem shows up is when you aren't given the actual data, but you are given estimates of the probabilities. Usually it's stated like "Suppose the prevalence of this disease in the population is $p_1$, and the test has a sensitivity of $p_2$ and a specificity of $p_3$ etc. You test positive. What's the probability you actually have the disease. Without any other information, the only way to proceed is with Bayes Theorem
The other place that Bayes theorem shows up is hinted at in the title of that book chapter, namely in Naive Bayes, where you have some categorical outcome $Y$ and you want to correctly classify which group it belongs to based on some arbitrary feature vector $X = (X_1, \dots, X_n)$. If the features are all binary or categorical, then with enough data you again don't need to use Bayes theorem because you can estimate $P(Y|X)$ directly (at least in theory). But when you start throwing in continuous features things get more difficult, and one way to proceed is by using Bayes theorem to write it as
$P(Y | X_1, \dots, X_n) \propto P(X_1, \dots, X_n | Y)P(Y)$,
where $\propto$ denotes proportionality. You then make some assumptions about $P(X_1, \dots, X_n | Y)$ and $P(Y)$ to make the calculation simpler (the "naive" part of naive Bayes) and voila!, you have a naive bayes classifier. See https://en.wikipedia.org/wiki/Naive_Bayes_classifier for more info