4 ms·
Java <= 1.4 had nothing like Go's maps, slices, channels (quite useful to build queues and FIFOs), or interfaces. So no, its not like Java <= 1.4 at all, and t
by luriel 14y ago
Java <= 1.4 had nothing like Go's maps, slices, channels (quite useful to build queues and FIFOs), or interfaces.
So no, its not like Java <= 1.4 at all, and that is without going into all the other fundamental language, library and philosophy differences.
- danieldk 14y agoIndeed, Go goes much further than Java before 1.5, since it does allow you to specify types for maps, lists, and channels. Still, it would be nice if you wrote, say a matrix package, that you could simply specialize data structures for double or single precision. You see such shortcomings in the standard library as well, for instance for the ParseFloat string conversion functions in strconv, you have to specify the number of bits of the data type. It would be much better if the return type was some generic type for fractional numbers. Now, if you want to have a single precision double, you have to specify that you want to have a 32-bit float and then cast it to a float32. That said, I believe that Go needs generics, but I'd rather see them implement them properly than to rush.
- pjmlp 14y agointerfaces are part of Java since 1.0 maps in Java 1.3 (older documentation is not available online): http://docs.oracle.com/javase/1.3/docs/api/java/util/HashMap.html http://docs.oracle.com/javase/1.3/docs/api/java/util/HashMap... channels for queues and FIFOS: http://docs.oracle.com/javase/1.3/docs/api/java/util/LinkedList.html http://docs.oracle.com/javase/1.3/docs/api/java/util/LinkedL... better yet after 1.5: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concu... Many of the array slices algorithms can be made via the Arrays class http://docs.oracle.com/javase/1.3/docs/api/java/util/Arrays.html http://docs.oracle.com/javase/1.3/docs/api/java/util/Arrays....
- luriel 14y agoNone of those things are like in Go, which was precisely my point.
- pjmlp 14y agoDifferent ways to write the same thing don't warrant a language change. I have Go experience, didn't not find any of the features you referred that different than similar features in other more established languages. Go is amazing for people with limited language experience, which have not tried the wide spectrum of languages and abstractions that are already available.