PlantUML[1]: Drawing any diagram helps me to have something concrete as it makes me think of the various components, connections and the invariants. It also gives a bigger picture. It is also very easy to learn and can be embedded anywhere rendered by Plant UML server or the rendering can be handled by your internal plant UML service. [1] - https://plantuml.com/
There are several VS Code plugins for PlantUML and Graphviz that allow for live rendering. That has proved very useful for communicating ideas without needing a drag-and-drop interface, and the result is a file that I can drop into a git repository.
Ask HN: Which tools have made you a much better programmer?
481–490 of 519 posts
Re: Ask HN: Which tools have made you a much better programmer?
#482Earlier quoted context omitted.
An excellent list. Regarding functional programming, I recommend starting with a gentle approach that doesn't require picking up a new language: 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. 2. Take the time to really understand what side effects are, and start avoiding them everywhere they are not necessary. Keep…
> 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. I am not very comfortable with this. How can I learn to do this in traditionally non-FP languages like Java? (Am CS undergrad student)
https://developer.ibm.com/technologies/java/series/java-8-id...
List of articles relating to idiomatic Java 8 code. Some of these touch on using lambdas and functional idioms.
https://developer.ibm.com/articles/j-java8idioms3/
This one shows a few of the functional-styled methods that can be used (foreach, takewhile, iterate, etc.).
https://developer.ibm.com/articles/j-java8idioms2/
Shows the collection pipeline pattern.
I have experience with the same things in C# and other languages, the way they're using them in these articles are what I'd expect from a comparable API.
Re: Ask HN: Which tools have made you a much better programmer?
#483Earlier quoted context omitted.
bashrc snippet (with extra newlines, for folks on mobile apps like materialistic that don't understand code formatting): # I do this an embarrassing amount alias fgf='fg' alias fgfg='fg' alias gf='fg' alias gfg='fg'
This resonates... from mine: alias emcas='emacs' alias emac='emacs' alias emasc='emacs' alias enacs='emacs' alias emas='emacs' alias emascs='emacs' alias eamcs='emacs' alias eemacs='emacs'
Re: Ask HN: Which tools have made you a much better programmer?
#484Earlier quoted context omitted.
I upvoted the parent and want to emphasize vim key bindings. This is not necessarily vim the editor, it's your editor of choice in vim mode. Learning to use vim is like learning to touch type: it's initially a pain, but it's hard to ever go back once you've mastered the basics. If you haven't learned to touch type (it happens, I didn't learn until I was 22), then first learn that, then learn vim. FYI: Remap your caps…
> FYI: Remap your capslock key to escape to use Vim more effectively. That's more one way of doing things rather than a "FYI". Eg I switched capslock with ctrl. There are many ways to exit insert mode, I prefer: inoremap jk inoremap kj
inoremap as this helps you train your fingers to stop using
Re: Ask HN: Which tools have made you a much better programmer?
#485Swapbar at the bottom of the screen and in SDSF always have SET DISPLAY ON.
Other than that, its hardware lapton keyboard type. I am faster when pgup / pgdn and home/end are separte keys rather than combination of fn and other keys.
Re: Ask HN: Which tools have made you a much better programmer?
#486Earlier quoted context omitted.
An excellent list. Regarding functional programming, I recommend starting with a gentle approach that doesn't require picking up a new language: 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. 2. Take the time to really understand what side effects are, and start avoiding them everywhere they are not necessary. Keep…
> 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. I am not very comfortable with this. How can I learn to do this in traditionally non-FP languages like Java? (Am CS undergrad student)
MAP: Take a collection, say a list/array or a dictionary/hash, and perform some function on each member of the collection, returning a new collection who's members are the return values for each original member. It's a loop, but no loop!
REDUCE: Do the same thing as map, but carry along an output variable, and have your function's output for each member (potentially) mutate that output variable. Summing is a basic example.
I'm not specifically recommending preferring this in Java as a step towards functional programming. It's in, uh, more terse languages like Python and Ruby where the payoff is obvious [1][2]. And among not-functional programming languages, it's not just dynamic languages, either. Consider Dart (and seriously, consider Dart) [3]. Also, Javascript, which has had many features shoehorned-in over the years, has these and related functions.
[0] https://www.java67.com/2016/09/map-reduce-example-java8.html
[1] Double some numbers Python: result = map(lambda x: x + x, array_of_numbers)
[2] In Ruby: result = array_of_numbers.map{|x| x + x}
[3] In Dart: result = arrayOfNumbers.map((x) => x + x).toList();
Re: Ask HN: Which tools have made you a much better programmer?
#487Earlier quoted context omitted.
> 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. I am not very comfortable with this. How can I learn to do this in traditionally non-FP languages like Java? (Am CS undergrad student)
I can't speak authoritatively about Java, but it looks like map-reduce is available in Java 8 by casting a collection to a stream [0]. Considering the definitions of map and reduce can help one see how they can replace loops/counters: MAP: Take a collection, say a list/array or a dictionary/hash, and perform some function on each member of the collection, returning a new collection who's members are the return values…
Re: Ask HN: Which tools have made you a much better programmer?
#488Earlier quoted context omitted.
> 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. I am not very comfortable with this. How can I learn to do this in traditionally non-FP languages like Java? (Am CS undergrad student)
I can't speak authoritatively about Java, but it looks like map-reduce is available in Java 8 by casting a collection to a stream [0]. Considering the definitions of map and reduce can help one see how they can replace loops/counters: MAP: Take a collection, say a list/array or a dictionary/hash, and perform some function on each member of the collection, returning a new collection who's members are the return values…
Re: Ask HN: Which tools have made you a much better programmer?
#489Earlier quoted context omitted.
> 1. Stop creating counters/loops and become facile with map, reduce, and the like. This will shift your thinking away from blocks and toward functions. I am not very comfortable with this. How can I learn to do this in traditionally non-FP languages like Java? (Am CS undergrad student)
I can't speak authoritatively about Java, but it looks like map-reduce is available in Java 8 by casting a collection to a stream [0]. Considering the definitions of map and reduce can help one see how they can replace loops/counters: MAP: Take a collection, say a list/array or a dictionary/hash, and perform some function on each member of the collection, returning a new collection who's members are the return values…
My school (Macalester College) recently started introducing some fp constructs/concepts in our intro class such as map, reduce like you mentioned.
It was long after I took it and now I am TA-ing. Oddly enough, I am more comfortable approaching this style in Kotlin.
Re: Ask HN: Which tools have made you a much better programmer?
#490IntelliJ IDEA has taken refactoring from being a chore to being trivial, consequently making me much more likely to clean up ugly code when I encounter it. Black, the Python code formatter, means I don't have to spend a single brain cycle on styling the code. mypy (with a strict configuration) has forced me to think about types, making for code which is much easier to follow and integrate with. No more `if isinstance…