2017-04-30

Some thoughts on being a polyglot developer

A few days ago I gave two talks during our company conference MATHEMA Campus. One introduced the jshell, the other one offered a glipse at the Dart programming language. While demoing jshel I entered a lambda expression. I srewed up the input, using => instead of ->. The reason: in Dart => is used for one line functions, as in

test(var i) => i * i;

main() {
  print(test(4));
}

The Dart talk was scheduled for the following day so my brain must have pressed fast forward.

Smile

C#, by the way, uses => for lambda expressions. C, on the other hand, uses -> in conjunction with a pointer to access members of a sctruct or union. Then again, ES6 introduced arrow functions that look like this one:

let test = (x,y) => x*y;

One more thing... Swift also knows ->. Here it is a function type. AnyObject -> Void is the type of a function that accepts AnyObject and returns Void.

That's it for today, I think my next post will be called LET it be. Guess what I will cover...

Smile

If you mixed language constructs while try to be a polyglot developer, please feel free to share them

2017-04-23

An update to my Temperature Converter

Today I updated my Flutter sample app called Temperature Converter. It now makes use of Flutter's InputDecoration to show an error message if the input value is no floating point number. Here is how it looks like:
The following screenshot shows a valid input.
As you can see, the app disables the Calculate button accordingly. This is done by setting the onPressed parameter to null. To find out more, please grab the source at GitHub.

2017-04-17

Quick tip: copy ip address to clipboard

My Mac runs Windows 10 in a virtual machine that is connected to the host using a network bridge. This way both host and client share the same network. Now you may be asking why I would need that. On Windows I use Visual Studio and Xamarin to create native iOS and Android apps. Using the Xamarin Mac agent I can both build and run the iOS app. But Android? The virtualized Windows can neither run Intel HAXM nor Hyper-V as VirtualBox does not support this type of nested virtualization. However, on the host (macOS) I can easily launch another VirtualBox client, for example Android x86. After adb connect ... I can use the simulated device to launch and debug apps. Here is a small shell function that copies the ip address to the clipboard:

function ipaddress {
    ipconfig getifaddr en0 | pbcopy
}