« first day (1680 days earlier)      last day (3275 days later) » 

7:00 PM
@Rahul Huh, really?
 
no problem
 
When we were working with scala, we practically cared none about optimization. I was told that Scala's applications are slow even after optimized, so we were told not to bother.
 
fge
@Rahul myth
Scala is supposed to stand for "SCAlable LAnguage"? Yeah, right. What a joke
 
He he that's right
So what you suggest so I should start with Scala or stick with java
 
@Rahul Java.
 
fge
7:07 PM
sigh that choice would not be as neutral as you'd expect it to be
 
Scala is a glass bottle - you can hammer a nail, craft a house or wreck a strawmen if you so wish, but that choice is simply mostly useless.
 
fge
If it were me I'd go for Java over Scala
Because I believe that Scala's premises are misguided
But that is my opinion only
 
I think Scala limited Java static import
SOp become print
Where so become static import
 
fge
Err
I don't believe this is the core of the problem, although that is indeed one problem
 
Why
 
fge
7:16 PM
If talking about Scala and only Scala, the problem with it is that its ABI constantly changes from version to version
 
Yes because of new language
When I see it uses Java runtime I thought why Java do the same
 
fge
Define "do the same"
 
I means why we can not write sop as p something like that
 
fge
Uh?
You lost me
 
@Rahul Isn't that CoffeeScript?
 
7:26 PM
Yes that is coffescript
 
In that case, not only doesn't Java do the same, it's nowhere near. Java and CoffeeScript are different in many ways.
 
Yeah but Java 8 is different still not able to write foo bar progamm
In Java 8
 
Java has verbose syntax, and for a good [ymmv] reason
 
fge
@Rahul define "foo bar"
 
My superblitz tournament has finished.
I'll leave you to being questioned by fge as I rest.
zzz~
 
7:40 PM
Like we write i %2 == 0 then print too else bar
It different in Java 8
 
fge
Eh?
Why?
There is no difference
 
I search on internet it uses quit different syntax
 
fge
There is no reason why Java 8 would have a syntax any different
Any code written in Java x where x < 8 is valid with Java 8
 
Yes that's valid but Java 8 has different syntax with interface loops and other stuff
 
fge
Eh?
It doesn't
There is a new API and that is the java.util.stream API
This, and lambdas
Now, it doesn't mean that you have to use that
 
7:48 PM
Yes lambdas
It reduces the line of code little bit like class::interface like that
That is uses in c++ with classes and there methods
@Unihedron you didn't sleep I always see you online in Java room and @fge you to
 
@Rahul: Please don't ping me unnecessarily. I have a setup to alert me in real life when I get notifications.
And that's a configuration I can block you from triggering.
 
OK sorry that
 
fge
8:14 PM
@Unihedron you shouldn't; just sleep, will ya?
@Rahul the use of :: in C++ and Java are very, very different
In Java that would be used as the operator between a method reference target (left side) and the method (right side)
This is quite different from C++
 
Yes I know but lamabs syntax scare me
 
fge
Why?
When you think about it, it's quite simple
 
gist.github.com/blouerat/53bbcf2d253c21053107 I see this and i thought they thinking about whole c++ cab be become java
And yes C++ quite different with java
In c++ when we define the class and class has method then it use as class::method and now I see in lambas java
 
@fge k
 
fge
8:41 PM
@Rahul in Java, the :: operator is used only in lambda expressions; on the left side of it is either a class reference, this or a variable reference (within scope)
On the right side is always a method
 
OK now I unterstand
 
fge
So, all of these are valid: MyClass::someMethod; MyClass::new (explicit call to a constructor); X[]::new (array constructor); this::someMethod (method on the current instance); someVar::someMethod (method call on a variable in scope)
 
Ohh OK
 
fge
The thing to recall is that the signature of the method reference has to match that of the @FunctionalInterface you aim to provide
/javadoc Stream#toArray(*)
 
Which one do you mean? (type the number)
1. java.util.stream.Stream#toArray()
2. java.util.stream.Stream#toArray(IntFunction)
 
fge
8:44 PM
2
 
@fge Object toArray(IntFunction generator): Returns an array containing the elements of this stream, using the provided generator function to allocate the returned array, as well as any additional arrays that might be required for a partitioned execution or for resizing. (1/2)
 
fge
^^^ Let's take this one
Say you have a List of some type X, List<X>
If for some reason you want to have a X[] of it, using the java.util.stream interface, you'd do:
theList.stream().toArray(X[]::new)
But then again arrays are peculiar beasts in Java
They account for more than 30% of all bytecodes
If you have a Supplier<T> where T is a type, you can give as an argument T::new
 
One more thing System.out::print is quite similar to std::cout
 
fge
Provided that T has an argumentless constructor
Maybe but they don't mean the same thing at all
System.out is a PrintStream
And PrintStream has a method named print -- in fact, several ones
In the most common situation you'd use System.out::print (or println) as a Consumer<Object>
 
Yes can I import like import System.out
Like in c++ using namespace std
 
fge
8:49 PM
No, not at all
C++ (and C for that matter) do have the notion of "function types"
Java doesn't
std::cout just tells you to use the cout function/method from namespace std
This is not at all what happens with Java
Recall that Java has nothing like function types
In C, or C++, you can declare, for instance, typedef int (*intProducer)(whatever, here);
Not so in Java
 
But like in Scala s.o.p just become println that mean they find ways to static import
Yes Java doesn't have that
 
fge
Uhwait
Let's not mix things
 
Yeah sorry
 
fge
And be aware that I don't know Scala and have no interest in learning it at all
If I were to really learn a "functional" language that would be Haskell, not Scala
 
Yes me to but Scala uses Java that's makes interest ing for Java guys
And don't aware of Haskell
@fge thanks for your all information may be I have start again with Java 8
gn
 
fge
9:12 PM
Scala uses the JVM, not the Java language
(though the Scala compiler has to be written in Java, that is true)
 

« first day (1680 days earlier)      last day (3275 days later) »