Can someone further explain how the pre commit phase works? I don't get how/why "pre commits" work without feature branches?
How are my changes shared with the reviewer, if I there is no feature branch? Is my local code uploaded to that review tool mentioned in the article? And then what happens if the reviewer requests changes?
I probably did get this completely wrong, so thanks in advance for pushing me in the right direction.
You got it right. There is a separate set of tooling layered on top of the VCS, which maintains a sub-history of each commit. The tool (Gerrit, Phabricator, etc.) tracks this relationship between commits, and whatever is eventually merged into the repo.
This architecture assigns each line of code a nested history: the public commit log, and also the sub-history of each commit, which evolved during code review.
IMO it would be better if the code review changes were manifest in the public commit log (e.g. via feature branches), instead of being tracked separately. The code review layers add duplicative complexity.
Perforce (the origin of Piper) has a concept of changelists. Some changelists are submitted (committed) while others are not. So the review works by uploading your changelist to Perforce, then pointing people to that changelist. It's like an unnamed feature branch that can't easily be rebased off of. Changelists do have a base, and you do a "g4 sync" to essentially rebase off of master. Does that make sense?
When people talk about making a single global change to update all clients when they change an interface, are they updating unsubmitted changelists too?
Unsubmitted changes at Google usually come in one of two flavors, short-lived (abandoned or submitted within a few days) or perpetual. The latter flavor is often for "I think we might want this". It's not uncommon for those to be completely rewritten if they're actually needed. There's usually a preference for submitting useful things (with tests!) and flag gating them to cut down on bitrot.
I have seen exceptions -- I reported a bug in a fiddly bit of epoll-related code and an engineer on my team had a multi-year-old fix -- he hadn't submitted it because he wasn't confident he'd found an actual bug. The final changelist number was more than double the original CL number (unsubmitted changes get re-numbered to fit in sequence when they're submitted -- the original number redirects to the final submitted version in our tooling).
Well, the act of submitting a changelist essentially runs a test suite which requires that the changelist has no merge conflicts with the head and that the relevant tests pass. From that it follows that if someone changes an interface, you'll get either merge conflicts or test failures on your own changelist. Meaning - it's the changelists authors task to sync it up to the current head state so the refactorers won't touch unsubmitted changelists.
It's pretty much the same as GitHub pull requests - the changelists are supposed to be decently short lived and if the master code changes it's up to you to resolve conflicts and get it into a mergeable state again.
every CL (changelist) gets 2 CL numbers, an original (OCL) and committed (CL) number. so CL #s are monotonically increasing, but less than 1/2 are ever actually committed.
when the CL is first uploaded or sent for review the OCL is assigned, the CL number is assigned on commit.
We are using Kotlin in production for two projects.
One is a spring boot backend for an online banking app for a large european bank. The other is an Android app for an NGO that gives out microloans to farmers who would not get a loan from a bank.
I find Kotlin a low-risk alternative to Java. Your code still feels like a normal Java project: You use the same frameworks, you have excellent tool support, you can keep searching for java questions on stackoverflow. Kotlin is fast and fully compatible with your Java code.
We are hiring at the moment, and our offer asks for an experienced Java/Spring developer. We just mention Kotlin at the end of the description.
Kotlin is not the right tool if you "hate" Java. It feels like the language that the Java 8 team would have built if backwards compatibility was not an issue.
Apart from some very useful syntactic sugar, it has
- no checked exceptions
- classes and methods are by default final
- no primitives that need to be (auto)boxed to and from objects
- no "static" context
- first class functions
- named function arguments that can have defaults
- null safety
- less broken generics
I like Java as a platform, and I think the language is perfectly fine. But Kotlin offers a cleanup and improvement, at almost no cost.
I have always found it surprising that someone may honestly think that upvoting and downvoting can be used to express agreement or disagreement. If you strongly agree or disagree, just reply with a post of your own; up/downvoting is there so you could express your opinion on the quality of the post rather than whether you think that what it is saying is true or false.
Paul Graham, who started HN, is one of those people: https://news.ycombinator.com/item?id=117171 . Generally, HN strongly discourages "me too" or "i agree" type comments. We prefer to just upvote comments in order to keep discussion threads interesting and on-topic.
It's pretty much upvote to agree, downvote if it doesn't contribute.
Of course the next highest child is then always the next most agreed upon counter argument since they should reply instead of downvote, which can make HN feel a bit contrary but full of good discourse
That many phone manufactures don't update their software is not an Android problem. Would Lenovo update their devices more often when their operating system was not based on Android? Would Apple update less often when iOS was based on Android?
Lenovo, Samsung, Apple and Google are all in complete control of the devices they sell: they all control hardware, software and services themselves.
If the software is based on Android or not has nothing to do with how often these devices get updates.
It supports java 7 syntax. Invoke dynamic you mentioned is a jvm feature, which dalvic isn't one. I think the lack of nio is an annoyance that can be fixed tho.
What I miss on every HN app I tried is a focus on search.
Maybe I'm using HN differently than most people, but I usually look for discussions on topics I'm interested in, instead of reading the top posts on all topics.
For example: I'm an Android developer, so I often browse hacker news by searching for "Android" in topics and comments, to see if there are any interesting discussions.
A great app for my usecase would allow me to search and quickly repeat previous searches right from the startpage.
You could add widgets that jump directly into saved searches.
and when you open it in Chrome-Android use the 'save to homescreen' option so that Chrome adds an icon on your homescreen, which opens the specific page
How are my changes shared with the reviewer, if I there is no feature branch? Is my local code uploaded to that review tool mentioned in the article? And then what happens if the reviewer requests changes?
I probably did get this completely wrong, so thanks in advance for pushing me in the right direction.