It is longer than three weeks since I was attending that software craftsmanship conference in Wrocław. The seven-hour train journey was exhausting, but worth that amazing experience of meeting a lot of great people and learning something new about my job. Here I just want to share some thoughts with hope, that someone gets inspired.
Moore’s law of our times – Tomasz Kaczmarzyk (opening speak)
- “The software craftsmanship manifest” was reminded. I think that every programmer aspiring to be a professional should recall it more often than on the conference. I would say at least once a month! The thing is to keep the focusing on “raising the bar”.
- The next fun thing was a prediction of Uncle Bob, that “every 5 years the number of programmers doubles”. And here is my tweet about it:
- There was nice explanation what “10x programmer” really means in the context of software craftsmanship: maybe 1 senior programmer cannot be as much productive as 10 junior programmers, but he can improve them by teaching and helping. So senior guys step up and don’t hesitate to be mentors! I believe that teaching is a natural way to become an expert.
Thanks for reading!
Cheers, Rafał 🙂
After changing my IDE from Eclipse to IntelliJ, I suffered from lack of really helpful functionality of auto-completing method call arguments (topic on Stackoverflow).
The standard auto-completition wasn’t enough and “Ctrl+P” shortcut doesn’t satisfy me either.
Hopefully I found this issue: IDEABKL-5496 – Auto-filling the actual Java call arguments, where the last comment written just couple days ago has a great news for me!
Making long story short: some German developer made pretty cool plugin, that fix this problem!
Usage is very simple – you don’t need to know new shortcut, just press “Alt+Enter” and select “Fill …” from suggestions menu. It rocks!
First run some process in terminal, e.g. “git-cola” tool:
Then in terminal press “Ctrl+Z” and you should see following console output:
Then type “bg”:
Typically it’s bad to have test depended to each other. However in case of some integration testing, it can really help.
Example from JavaDoc:
Preconditions should be ideal for situations, where there is no specific business exceptions for checking arguments and performance is not an issue.
Here is more about checking conditions:
Getting started guide:
- cool way to verify throwing exceptions:
- instead of writing, “when-then”, just use “except”:
- to parameterize test with different data, use “where” syntax:
- in helper method use “assert” keyword:
I found this article with filter implementation:
Spring Security part VI : Session Timeout handling for Ajax calls
However in comment someone point that we can simply extend “LoginUrlAuthenticationEntryPoint”.
My solution sets only status 401 and doesn’t write anything to response body:
When our application server user proxy, that doesn’t set “X-Forwarded” headers with original request port, then we can use some hack in our application. Just ignore port when it is equal 80 or 443, cause it is default. For example instead of
"http://localhost:80/app", we will get
"https://localhost:443/app" will output
Inspired by Mat Banik strackoverflow answer – http://stackoverflow.com/a/5212336/5770135.