Tuesday, July 25, 2017
First look at Kotlin
Unless you live under rock, you should have at least heard about Kotlin, the language now official on Android. People bash and bash java these days constantly complaining about its verboseness (but no one type all that get/set methods when you can have your IDE generate it ok?) and just have to invent something else.
Just about every language has to find a new way to spell "function". Well javascript and Pascal uses it directly "function". C does not need it because everything are functions. Scala and Groovy call it "def" and Kotlin calls it "fun". Ok, hope you are having fun with Kotlin. Besides "fun", the Kotlin syntax for other things are quite elaborate.
Ok how do you do a hello world? Sure you can try it right on the browser.
Ok how about outside the browser, ok you need IntelliJ or Android Studio. Waita minute I want general purpose stuff first, sure there is command line compiler. But that's.. for Linux only?
See here.
In the programming world seems like everybody uses the Mac and everyone despise Windows. Further looking shows that only very recent updates included a Windows install. Still not in the kotlinlang.org page yet. Definitely there was no hurry to support Windows.
Ok just why do we need Kotlin when there is Java for Android?
See the comparison here.
Kotlin offers a ton of new things but is it worth the learning curve.
I believe Java, if used right, serve the purpose of programming Android (and many other things) well. Only thing about Java is it isn't native code and always require the runtime environment, so if you need system level as-fast-as-you-can things you need something else. I am in no hurry learning Kotlin.
Monday, July 17, 2017
Death to C?
Saw this article about Death to C, and Death to C, ++.
C is old, but it is such important programming language... much of today's systems still based on it, and yes, it is easy to create subtle bugs for bad guys to exploit. Yes pointers are frustrating. But I definitely do NOT want to do C for a living. I need the String type and higher level things like in Java. I am not going to fool around with char *. I am not going to fight pointers for a living.
Wow, people are trying to replace C (and C++) with a rather new language called Rust. Look it won the first place for "most loved programming language" in some developer's survey.
Look at its syntax... newer language just has to be Pascal like with return type behind the method...and has to have functional programming language things like closures.
Part of C's merit is... its SIMPLE syntax. Rust seems to have too complex a syntax for me. Why do people embrace it? I guess I need to read some more about it..
It seems to be strong at concurrency things though.. that stuff is hard.
I am just glad I am not doing much low level things.
But C is here to stay. It just won't disappear any time soon.
Now about the survey... some of these I never heard of, but why is groovy so low. It is a such awesome twist to java.
Friday, July 14, 2017
Dev Bootcamp.. why it did not succeed?
Saw this story today. Dev Bootcamp, a software developer training company, is shutting down.
http://www.chicagotribune.com/bluesky/originals/ct-bsi-dev-bootcamp-shutting-down-20170713-story.html.
When I first heard about it in the news I was like, "dang, why am I not doing a business like this." It would be an awesome thing to do. Look, there is the need... people need skills and updating their skills. Sure, you can get tutorials for just about everything out there. But it is much much more effective if you have a live instructor and some fun projects to work on, and you get to work with classmates that's even better. That university classes are too expensive! (and you actually don't get much) I think there will be people who want to learn a thing or two without paying too big a fortune.
I don't quite understand this line:
"(D)espite tremendous efforts from a lot of talented people, we’ve determined that we simply can’t achieve a sustainable business model without compromising our mission of delivering a high-quality coding education that is accessible to a diverse population of students,”
I don't understand this line either: Just what is this microscope?
"Coding schools have been under increasing pressure in recent years, as for-profit schools go under the microscope nationwide and coding schools attempt to prove their worth"
So what is the issue here? no one sign up? why? too expensive or no one wants to learn? BTW, too many programming jobs are going overseas... perhaps even the most skillful developer would have trouble making a living.
There is gotta be a way to run a successful training business.
Thursday, June 8, 2017
Java and UTF-8 encoding
Java supports Unicode since day 1. The professor who introduced me to Java says, "look you don't have to limit yourself English in variable names and strings, you can use Unicode which support just about every language out there!" Ooh now that's forward thinking. The then leading language of the day C++ no way had that. Then he added, "but unfortunately there aren't many Unicode editors out there yet". That was 20+ years ago.
Now there are Unicode editors of course.
But can you actually work with non-English things.
public class UnicodeTest {
public static void main(String arg[]) {
String test = "你好,世界";
System.out.println(test);
}
}
First need to compile with UTF-8 encoding:
javac -encoding "UTF-8" UnicodeTest.javaWhat do you expect to see? whatever in test variable of course. Yes I expect you can get that if I run it within an IDE. But at the DOS prompt? boom I get junk characters. The command prompt does not like it. Theoretically setting some code page command will work but does not work for me. Got a workaround... using bytes array.
public class UnicodeTest {
public static void main(String arg[]) {
String test = "你好,世界";
// System.out.println(test);
try {
byte[] bytes = test.getBytes("UTF-8");
System.out.write(bytes);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Waita minute still junk. But I can pipe to a file. java UnicodeTest > output.txt.
Ah ha I got what I need... in a file.
Monday, May 22, 2017
Ultra Street Fighter II - the Final Challengers
Look! Nintendo has came up with a new innovative gaming system.. the Nintendo Switch!
And not surprisingly there are classics like Mario Cart, Zelda etc... oh and there is https://en.wikipedia.org/wiki/Ultra_Street_Fighter_II:_The_Final_Challengers. It is 30-year anniversary of the Street Fighter series... and who would give there is yet one more version of this?
Now let's do a little recap... the original Street Fighter was actually not that fun.. slow and very difficult to execute but powerful special moves and left player is Ryu right player is Ken... Street Fighter II was hugely innovative and successful.. EIGHT characters each have different moves and background music! So cool that there are rows of quarters lined up to play... and then there was Champion Edition ooh boss vs boss! And then someone made wacky hacks.. .and then there was Hyper Fighting! Faster and new moves and stuff... and then Super was a major disappointment. It was SLOW (because it used Champion Edition' speed when everyone is used to Hyper Fighting). and gosh the sound is horrible with a wacky new sound system. New characters aren't so fun... The SUPER meter takes so long to fill up each round... But there is one thing that SUPER debuted.. the combo counter. And then it got faster with Super Turbo.. faster.. and then gosh MUCH MUCH MORE difficult. I am a decent player who can probably finish Hyper Fighting on a quarter and I can barely beat one or two rounds... and then the world is TIRED of the same old graphics and stuff.. Street Fighter then started something entirely new... the Alpha series... then some 3D (kinda blocky) things... some cross-over editions such as vs XMen and all that... there are so many before reaching Street Fighter III. SFIII is new graphics but still 2D. What? just one super out of 2 or 3? oh well the world gets a bit tired of the whole thing after decades... then Playstation things come with SF 4 and 5... Still kinda 2D fighting but a lot of graphics power nowadays..
Why did Nintendo decide to do 1 more Street Fighter II and using the crappiest version: Super? Probably can do Alpha series.. or modern series.. but it can be nostalgia factor and processing power may be limited on the Nintendo Switch.
Oooh... there are Evil Ryu and (new) Violent Ken! oh and that's it? I am a bit disappointed. Well Evil Ryu is out for decades ok?
Can anyone explain why the hell take out Ryu's sign:
Subscribe to:
Posts (Atom)