News for hackers. Stuff that matters.
Re:Generating a Java program with 90% less code by edflsafoiewq on Wednesday December 04, 2019 @02:09PM (#21705792)
Is this really true? The hard part of renaming a class isn't usually changing the name Foo -> Bar, it's finding all the variables with type Foo named stuff like result_foo and renaming them result_bar. Can it help with that?
Re:Generating a Java program with 90% less code by dnautics on Wednesday December 04, 2019 @02:16PM (#21705863)
Static typing can help with a lot of things but it can't fix this error:

    pub fn add(a: i64, b: i64) i64 {
      return a - b;
    }
Re:Generating a Java program with 90% less code by maxdamantus on Wednesday December 04, 2019 @02:51PM (#21706199)
Actually, it kind of can:

https://tryidris.herokuapp.com/compile#YWRkIDogSW50IC0+IElud...

The above link refers to the following Idris code:

  add : Int -> Int -> Int
  add a b = a - b

  addTest : add 4 5 = 9
  addTest = Refl
Re:Generating a Java program with 90% less code by reitzensteinm on Wednesday December 04, 2019 @03:02PM (#21706320)
That unit test would be just as easily implemented with dynamic typing.
Re:Generating a Java program with 90% less code by exitheone on Wednesday December 04, 2019 @03:04PM (#21706330)
yes, intellij for java will also rename all local variables and all mentions of the class in comments.
Re:Generating a Java program with 90% less code by edflsafoiewq on Wednesday December 04, 2019 @05:05PM (#21707712)
How exactly does that work? How does it decide what variables to rename and what to rename them to?