Re: [DISCUSS] Introduce CREATE TABLE LIKE grammer

2024-10-29 Thread guo Maxwell
So we should be able to start voting on this now. guo Maxwell 于2024年10月28日周一 17:20写道: > Here is the latest updated CEP-43 > > > > guo Maxwell 于2024年10月24日周四 19:53写道: > >> yes,you are right. I wi

Re: [Discuss] Repair inside C*

2024-10-29 Thread Jaydeep Chovatia
>Repairs causing a node to OOM is not unusual. I've been working with a customer in this situation the past few weeks. Getting fixes out, or mitigating the problem, is not always as quick as one hopes (see my previous comment about how the repair_session_size setting gets easily clobbered today)

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Caleb Rackliffe
Josh's example of "good" usage seems defensible, because the declared type is already obfuscated to Collection anyway, and my eyeballs are going to skip to the right anyway to see the instantiated type. I'm +0 on prohibiting it in non-test code, and -1 on prohibiting it in tests. On Tue, Oct 29, 2

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Josh McKenzie
> how we are going to enforce that _at scale_ Without digging into our infrastructure, I'd assume rolling a check into our checkstyle targets would cover it. Have different for regular and test so could have two different rules. > Now, when I want to know type information my eyes have to jump al

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Yifan Cai
I am in favor of *disallowing* the `var` keyword. It does not provide a good readability, especially in the environments w/o type inference, e.g. text editor or github site. It could introduce performance degradation without being noticed. Consider the following code for example, Set allNames()

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Jon Haddad
When I first saw var as a Java keyword, my initial reaction was one of skepticism for the reasons already mentioned. However, in practice, I've been using var for years across many code bases (Java and Kotlin) and have never had an issue with readability. I find it to be significantly more pleasa

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Štefan Miklošovič
I get that there might be some situations when its usage does not pose any imminent problem but the question is how we are going to enforce that _at scale_? What is allowed and what not ... Sure we can have a code style for that, but its existence itself does not guarantee that everybody will adher

Re: [Discuss] Repair inside C*

2024-10-29 Thread Mick Semb Wever
Jaydeep, your replies address my main concerns, there's a few questions of curiosity as replies inline below… > >Without any per-table scheduling and history (IIUC) a node would have > to restart the repairs for all keyspaces and tables. > > The above-mentioned quote should work fine and wi

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Josh McKenzie
(sorry for the double-post) Jeremy Hanna kicked this link to a style guideline re: inference my way. Interesting read for those that are curious: https://openjdk.org/projects/amber/guides/lvti-style-guide On Tue, Oct 29, 2024, at 2:47 PM, Josh McKenzie wrote: > To illustrate my position from ab

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Benedict Elliott Smith
> Good usage: >> Collection names = new ArrayList<>(); > becomes >> var names = new ArrayList(); > This “good” usage quickly becomes bad, as you’re going to have to mix “good” and “bad” together, e.g.: >> var names1 = new ArrayList(); >> Collection names2 = myObject.getNames(); Now, when I

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Josh McKenzie
To illustrate my position from above: Good usage: > Collection names = new ArrayList<>(); becomes > var names = new ArrayList(); Bad usage: > Collection names = myObject.getNames(); becomes > var names = myObject.getNames(); Effectively, anything that's not clearly redundant in assignment should

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread David Capwell
I am one of the people using var, and this mostly comes from me doing “int” and having IntelliJ fix it (faster than typing out Future>>>)… so its a faster version for me… Personally I find that while I am writing the code I like var, but as I hone it I tend to remove it to improve readability.

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Dinesh Joshi
I lean on the side of being explicit but I want to recognize that there are exceptions to every rule. There are situations where it might be acceptable to use var and may help productivity. We should enumerate it in our code style / developer docs. I think it is ok to use var in scripts or test cas

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Štefan Miklošovič
Yes, for now it is pretty much just in SAI. I wanted to know if this is a thing from now on or where we are at with that ... I am afraid that if we don't make this "right" then we will end up with a codebase with inconsistent usage of that and it will be even worse to navigate in it in the long te

Re: [Discuss] Repair inside C*

2024-10-29 Thread Jaydeep Chovatia
>Since the auto repair is running from within Cassandra, we might have more control over this and implement a proper cleanup of such snapshots. Rightly said, Alexander. Having internal knowledge of Cassandra, we can do a lot more. For example, for better Incremental Reliability reliability, Andy T

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Brandon Williams
On Tue, Oct 29, 2024 at 12:15 PM Štefan Miklošovič wrote: > I think this is a new concept here which was introduced recently with support > of Java 11 / Java 17 after we dropped 8. To put a finer point on that, 4.1 has 3 hits, none of which are valid, while 5.0 has 172. If 'sai' is added to the

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Benedict Elliott Smith
I’m glad you brought this up Stefan, I’d been meaning to raise this myself. var is valuable for hacking and scripting, but I think it is counterproductive for a codebase like ours, that is mostly read not written, and where this keyword creates inconsistencies in where information for navigating

Re: [DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Josh McKenzie
Not having type inference has made me grumpy about working on our codebase vs. tinkering in C# for the past decade. So you can guess where I stand on that. :) I'm all for us adopting it in scenarios where the type of an object is immediately obvious (i.e. doesn't require navigation to a method o

[DISCUSS] Usage of "var" instead of types in the code

2024-10-29 Thread Štefan Miklošovič
Hello, this should give you an idea grep --include '*.java' -r 'var ' src/ test/ I think this is a new concept here which was introduced recently with support of Java 11 / Java 17 after we dropped 8. What is your opinion? Are we free to use it wherever we want? I am quite conservative in this