The material to which you refer is simply wrong and outdated. RFC 1878, Variable Length Subnet Table For IPv4 (December 1995) explains it:
Subnets and Networks
The number of available network and host addresses are derived from
the number of bits used for subnet masking. The tables below depict
the number of subnetting bits and the resulting network, broadcast
address, and host addresses. Please note that all-zeros and all-ones
subnets are included in Tables 1-1 and 1-2 per the current,
standards-based practice for using all definable subnets .
Your (incorrect) reading material is really mixing up CIDR (Classless Inter-Domain Routing) with an old practice from classful addressing. Under classful addressing, a subnet was a network with a mask longer than the natural class mask, and all the subnets of a classful network had to be the same size.
Under CIDR (RFCs 1517, 1518, and 1519 in the year 1993), there are no more network classes, and every network is a subnet of
0.0.0.0/0. The subnets of a larger network can be variable sizes, and it is impossible to determine what would be the all-zeroes and all-ones subnets of a variably subnetted network because the all-zeros and all-ones subnets could be further subnetted.
The practice of reserving the all-zeroes and all-ones subnets died with network classes.
The term subnet really does not mean what it used to mean. It used to mean a network with a longer mask that the natural mask of the class. Under CIDR and VLSM, subnet is usually a verb meaning to divide a network of any size into larger networks (smaller hosts), or it is often used to refer to a network derived from a smaller network (larger hosts). Today, a network of any size is really just a network because all networks are subnets of the