pull down to refresh

I haven't read into it much but here is what I get:
In the C++ standard committee a vote failed about a suggestion by Google Devs breaking ABI compatibility in favor of performance. So now Google is developing a new language called Carbon to:
Once we can migrate code into Carbon, we will have a simplified language with room in the design space to add any necessary annotations or features, and infrastructure like generics to support safer design patterns. Longer term, we will build on this to introduce a safe Carbon subset.
  • I am slightly concerned because it feels like another Rust which has a very steep learning curve imo (maybe you disagree). Also I haven't read anything about a garbage collector yet which is top 1 on my personal whishlist but also a nightmare for performance optimization I imagine.
  • The thought of programming Java with annotations but getting C++ level performance sound very appealing. Bidirectional interoperability with C and C++ is also huge.
Idk guys, is this a thing I should spend time with for amazing job opportunities in 3 years? Or another https://killedbygoogle.com/ soon?
The thought of programming Java with annotations but getting C++ level performance sound very appealing.
It does? I freaking hate Java. More of a ruby guy myself. Import your ruby.h file into your C project (Yes C not C++) and compile it for C level performance. Now that is appealing, at least to me.
reply
What do you hate about Java?
reply
I definitely have a "first love" bias. As in the first language I learned can do no wrong and everything else just looks terrible (though ruby and python are so similar that I can easily switch to that)
You know just compare these two examples:
Ruby (this ruby code is not good, but you can tell it was made for people who are new and just trying to learn) https://medium.com/@PolinaHackTech/count-vowels-in-a-string-in-ruby-app-academy-prep-work-20700832d2f5
Java:
public class CountVowelConsonant { public static void main(String[] args) { //Counter variable to store the count of vowels and consonant int vCount = 0, cCount = 0; //Declare a string String str = "This is a really simple sentence"; //Converting entire string to lower case to reduce the comparisons str = str.toLowerCase(); for(int i = 0; i < str.length(); i++) { //Checks whether a character is a vowel if(str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o' || str.charAt(i) == 'u') { //Increments the vowel counter vCount++; } //Checks whether a character is a consonant else if(str.charAt(i) >= 'a' && str.charAt(i)<='z') { //Increments the consonant counter cCount++; } } System.out.println("Number of vowels: " + vCount); System.out.println("Number of consonants: " + cCount); } }
Ruby
def count_vowels(string) vowels = 0 counter = 0 while counter < string.length do if string[counter]=="a" || string[counter]=="e" || string[counter]=="i" || string[counter]=="o" || string[counter]=="u" vowels += 1 end counter += 1 end return vowels end def count_consonants(string) consonants = 0 counter = 0 while counter < string.length do if string[counter]!="a" && string[counter]!="e" && string[counter]!="i" && string[counter]!="o" && string[counter]!="u" && string[counter]!=" " puts consonants += 1 end counter += 1 end return consonants end vowels = count_vowels("La la Land i like a lot") consonants = count_consonants("La la Land i like a lot") puts "#{vowels + consonants}"
But you know, maybe the more honest answer is that I don't know java and I do know ruby.
reply
No no, I get that. Programming Java is always a whole thing instead of just a small script. That makes it ugly. I get that.
reply
This example says nothing about the language but the programmers. The java code is not as elegantly written as the ruby code.
Indeed, putting everything in the main method instead of creating two separate ones is lazy and amateurish, and would not pass a serious code review.
reply
Btw: The language is still experimental, thus has no useful dependencies/frameworks yet and is not bootstrapped yet.
reply