Saturday, May 2, 2020

Idea: Configs and Stream Debug

0 lượt xem comment 0 comments

I work with Java for a long time. I always used eclipse. I like eclipse IDE. However I need to admit eclipse is pretty much dead, specially scala IDE wish I used a lot but unfortunate is long dead. So IntelliJ Idea is alive and has some interesting features like being alive first of all and also easily I could say performance is pretty good and you dont want need to install lots of plugins. So I made a video showing some configs that will make your life easier if you came from eclipse like me and also share some killer features for Java Streams Debug.
I always like eclipse but I dont have issues using Idea, I believe 2 things. First of all changing editors, IDE is always good for experience and open your mind and secondly, you should not be attache to any language, IDE, editor or tool, these things are tools and there is the best too for the jobs, this tools dont define you and you are bigger than this tools. So the tools should serve you and not the other way around.  So Let's get started!


Show me the code

Here we have a simple stream code in Java 8, however, this stream codes can get pretty messy and hard to debug.

List<String> rawValues = Arrays.asList(new String[] { "Peter","Adam", "Allan","Anna","John","Paul","Peter" });
List<String> people = rawValues
.stream()
.distinct()
.sorted()
.filter( name -> name.startsWith("A"))
.map(String::toUpperCase)
.limit(2)
.collect(Collectors.toList());
System.out.println("first 2 People who started with A: " + people);
view raw People.java hosted with ❤ by GitHub
https://gist.github.com/diegopacheco/8d5c3ea0e2e82acdcc5d3fb3ab2d7e23

The complete code is here on my github.

Video


IntelliJ Idea Java: Configs and Stream Debug from Diego Pacheco on Vimeo.

Cheers,
Diego Pacheco
Tags: video, code,

comment 0 comments

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.