Saturday, July 30, 2016

International Nodebots Day

Yesterday the local JavaScript user group had an International Nodebots Day event. I took my daughter. It was a lot of fun, I highly recommend doing that kind of thing with your kids.

My kid also gave me a conundrum this week. She had an idea for an app, that she was wanting me to make. I haven't programmed for Android, and I haven't programmed Java in a long time. So, I may be learning that too, or make a decision between that and this. So....

As for what I have done this week. Nothing, but I have gotten my tablet up and running again. So, I'm hopeful that it will continue to cooperate.

What I've Learned

What do you need to write programs? If it is a complied language you need a compiler. If it is an interpreted language you need an interpreter. Also, you need something to write the code in, like Notepad.

This is an advantage for Javascript as the interepreter is built in to most browsers and all of the major ones.

However, I would recomend and IDE if you are intending to code. An IDE, or Integrated Development Environment, tend to have certain functionality that is helpful for programming.

Of particular use is syntax highlighting and autocomplete. Syntax highlighting changes how the text is displayed. Keywords, variables, strings all show up in different colors, fonts, etc. This makes it easier to understand what is happening in the code. Autocomplete offers suggested words based on the meters typed so far, the words coming from the context of the code and keywords. This helps with spelling of variable names, for instance. In an interpreted language, such a misspelling would break the program and be difficult to find.

I'm not sure if this installment was as helpful as I would hope.

Sunday, July 24, 2016

Summer Break

So, I had started an update when the tablet I was working on decided to stop working. I decided to give it a couple days to run out of juice to see if it would reset. It did, then went back to a blank screen after I started the first app. So, boo.

The update I had started was about how little I had done. I need to make this a bigger priority, or decide it's not going to be a priority.

I still want to learn JavaScript, and I still think that this it's the way to keep me accountable, but is this the time to do it?

In fact I just showed to myself that it is trivial to move the script to it's own file, by copying the code to a separate file and removing it from the html file. I'm not completely happy with it because I have references to html objects in the code, it will be a rewrite to remove those.

What I have learned so far.

Some of this is stuff I have known, but it is stuff I have learned to this point.

There are two types of programming languages (plus machine language which is written in a form a computer can understand). Languages are either compiled or interpreted. Compiled languages are written in a human readable form and then compiled into a machine readable form one time, creating an executable that will be run when necessary. Interpreted languages are written in a human readable form and then interpreted at run time into machine readable form, and will be interpreted every time the code is run.

The advantage of compiled languages is the executable tends to be faster and smaller in memory. The disadvantage is that the program will have to be recompiled to target a different architecture (PC, Mac, mobile) which may also require some changes in the program as well.

The advantage of interpreted languages, also commonly called scripting languages, is that they can be run, often without change, on many platforms. The disadvantage, is the programs can be larger and slower and often are limited in their ability to access the hardware of the machine.

That was then. Now there are languages that are compiled and interpreted, like Java. Also some languages are transpiled, written in one language and the transpiled into another language, often JavaScript.

The advantage of a language that is compiled to a bytecode and then that bytecode is interpreted on the machine is speed closer to a compiled language and the ability to run on any machine. Disadvantages include a limit to access to the hardware.

Now, transpiling, is a completely different issue. Much like human languages, computer languages affect how you think and how you can express things. So if you need to do certain things, it might be easier to write it in a different language, then transpile it to the language needed. These are usually done with languages designed to transpile, for example CoffeeScript and TypeScript both transpile into JavaScript.

I did not think I would end up writing this much about languages alone, so I will try and put more of what I have learned in future updates. I am a little reluctant to make such a promise, though, for some reason (-cough- -cough- complex math -cough-).