Active Threads This:
Latest Threads About This Book
@venkats
Appears to be a broken link in Appendix 3 a(Web Resources) on Page 234, for article to “Tell, Don’t Ask”.
Link goes to: https:...
New
@venkats
In the section “Iterating a String” found in chapter 3 “Strings, Comparators, and Filters” there seems to be a typo:
“But we w...
New
Nothing surprising here, just adapting the form to the other examples.
Ah yes, compute() now returns an immutable list in all cases.
pa...
New
As usual, but the original code to be refactored was just too evil and had to be fixed.
package chapter11;
import org.junit.jupiter.api...
New
In this code:
We actually create the (temporary) file we want to read and delete it again at the end.
Default charsets for reading text...
New
The usual changes but:
The “FirstRepeatedLetter.findIn()” has been improved out of the box. In particular returning ‘\0’ is too C-like ...
New
Nothing special here, same changes as formerly, but we are using people.isEmpty() instead of people.size() == 0 for even better legibilit...
New
The same remarks apply as for “Refactoring the Traditional for Loop”
No init()
Negative tests which apply for input less than 1900, res...
New
The same remarks apply as for “Refactoring the Traditional for Loop”
No init()
Classes under test implement a common interface that is...
New
Suggestions for some JUnit test improvements in Refactoring the Traditional “for” loop p 181 ff
Below code for testing the original/cla...
New
Most Active This Week
Most Active This Month
Most Active This Year
Most Active Last Three Years
Learn and apply the powerful streams API and lambda expressions to create highly expressive, concise, and maintainable functional style c...
New
@venkats
On page 21:
For each price from the prices list that passes through the filter(), the mapToInt() method invokes the provided ...
New
On p.27, after “Found 2 names”, we read:
The filter() method returns an iterator just like the map() method does,
But it really return...
New
On page 91, we use a short method to request a stock ticker, class FinanceData
However, this method is based on java.net.URL which has a...
New
We read:
Recursion is a powerful and charming way to solve problems. It’s highly expressive—using recursion we can provide a solution t...
New
In several places, the method
String.toUpperCase()
is misspelled as
String.toUppercase()
sometimes via the :: method reference,
Stri...
New
Just some thoughts on being hard on exceptions in functional languages.
On p. 167 we read:
Functional style code is amazing, concise, ...
New
We find this code on page 61, for ListSelectFiles.java
final String[] files =
new File("fpij").list(new java.io.Filena...
New
As for FinanceData on page 91, the code for AirportInfo uses the suspect and soon-to-be-deprecated java.net.URL. Let’s use java.net.URI i...
New
As previously, the code uses
List<String> names = Arrays.asList(...);
which yields an “array-backed list”, rather than
List<S...
New
On page 148, “An optimization problem” we read:
We’ll employ a solution for a company that buys rods at wholesale and sells them at reta...
New
On page 90, CalculateNAVTest.java:
public class CalculateNAVTest {
@Test
public void computeStockWorth() {
final CalculateN...
New
It turns out that Try<T> can be ameliorated by judicious application of subclassing: no need to distinguish by actual type in the s...
New
@venkats
At 2/3rd of the page, we read;
Within the computeMaxProfit() method, we perform our task, and when it’s time to recurse we ro...
New
On page 174:
StreamAPI
Should probably be
Stream API
Also on page 174:
blow up with an exception
Suggesting to change this wh...
New
Most Active Over Three Years
The filter stream operation appears on several places in Chapter 2 and Chapter 3, so it’s difficult to say where to put this, but there s...
New
Nothing surprising here, just adapting the form to the other examples.
Ah yes, compute() now returns an immutable list in all cases.
pa...
New
I have been thinking about how to collect “two adjacent elements” in a stream, for example transform a stream of Long into a stream of Pa...
New
Suggestions for some JUnit test improvements in Refactoring the Traditional “for” loop p 181 ff
Below code for testing the original/cla...
New
@venkats
In the section “Iterating a String” found in chapter 3 “Strings, Comparators, and Filters” there seems to be a typo:
“But we w...
New
We read:
We are using the amazing feature of the switch expression of Java [Java 12]. If you’re using an older version of Java, you may...
New
A question to highlight is:
Is there a way to make sure that a stream is NOT parallel, and make this evident in the code?
As in:
strea...
New
As traditional , the “impure” code of page 207 in the form of a pretend test.
(Doesn’t “impure” refer to performing uncontrolled side ef...
New
Although now aged by 34 years:
“The Conception, Evolution, and Application of Functional Programming Languages”
by Paul Hudak (1989-09-...
New
I had real trouble understanding the “memoizer”, I suppose Java syntax does not help in thinking about what should be a one-liner in Lamb...
New
@venkats
Appears to be a broken link in Appendix 3 a(Web Resources) on Page 234, for article to “Tell, Don’t Ask”.
Link goes to: https:...
New
As usual, but the original code to be refactored was just too evil and had to be fixed.
package chapter11;
import org.junit.jupiter.api...
New
Nothing special here, same changes as formerly, but we are using people.isEmpty() instead of people.size() == 0 for even better legibilit...
New
The same remarks apply as for “Refactoring the Traditional for Loop”
No init()
Negative tests which apply for input less than 1900, res...
New
The same remarks apply as for “Refactoring the Traditional for Loop”
No init()
Classes under test implement a common interface that is...
New
Book Info
Publisher:
Pragmatic Bookshelf
Are you this book's author? To be notified of all posts made about it, sign up an account then click here, then select 'watching' from the bell icon in the top right corner.
Get money off!
The Pragmatic Bookshelf
35% off any eBook
Simply use coupon code "devtalk.com" at checkout. See full details here.