Jim Lynch Codes
  • Blog
  • About Jim

Writings about one coder's stories & experiences.

Returning Multiple Values From a Function

1/18/2016

0 Comments

 
This tip works for many languages, and it’s not explicitly stated all the time when starting out. I had already known that you could do this, but kudos to the book “Javascript & JQuery” by Jon Duckett for inspiring me to write a post about it. It’s a very colorful and friendly book that is actually read fun to read which is a huge accomplishment for a book about programming. Anyway, this is a useful little tip to remember when crafting your functions.  
 
Let’s think about the function signature in different (statically typed) languages. Remember, the compile breaks out of the function when return method is called, and nothing after it is run. The function defines a return type, and to a naive programmer looking at the signature it seems that one can only return a single thing. And it’s true- you can only return one thing. But, that thing can be an Object or an Array.

Read More
0 Comments

Interesting Code Flowcharting Technique

1/18/2016

0 Comments

 
This is a really cool, simple method for sketching out what you want your code to do. I came across this flowcharting method from page 23 of the great book “Javascript and JQuery” by Jon Duckett (screenshots below). He describes the motivation for them like this:

“Often scripts will need to perform different tasks in different situation. You can use flowcharts to work out how the task fit together. The flowcharts show the paths between in step.”

Read More
0 Comments

Interesting Podcast Episode on the Beginnings of Angular.

1/6/2016

0 Comments

 
Link to the original video:
​https://devchat.tv/adventures-in-angular/001-aia-the-birth-of-angular-1
This is the very first podcast in a long series of Angular podcasts. I’m just getting into them now myself, but I liked this first one a lot and wanted to share it in a blog post. ​

Read More
0 Comments

Beware of the If-Semicolon Bugs!

12/23/2015

0 Comments

 
This has happened to me enough times before for me to be embarrassed by it, and for that reason I'm writing this blog post about it. If you have an if statement that is always returning true (it feels something like, "GAAAHH, why does my if statement always return true!) then this could be your problem (and solution!). I noticed this mistake again today working in Actionscript 3 while fixing a bug in Head Exploder. Here's a simplified version of the as3 code:
var smallNumber:Number = 1;
var bigNumber:Number = 100;

if (smallNumber > bigNumber)
{
     trace("Uh oh!");
}

Read More
0 Comments

Controlling the Tab Key (in As3) with TabIndex & TabEnabled

12/15/2015

0 Comments

 
Picture
In the world today users will take for granted the ability to use the tab key on the keyboard to navigate between text fields in a form. In Flash you are building dialog boxes from shapes and TextFields so it can't guess how you want the tabs to be controlled. Luckily, you are given total control over this because text fields have the properties tabIndex and tabEnabled.

Tab index – This is an integer that basically allows you to put this text field in a list relative to all the other fields. The first one we should have a tabIndex of one, the second tabIndex of two, and so on. So suppose now you have the text field with tab index of one selected (which for TextFields just means that there is a cursor blinking inside of it). Then pressing tab will move your cursor to the TextField with index two. If you press tab again when the selection is on the text field the highest index then the list will loop back around, and the one that has index one will be selected.


Read More
0 Comments

    ​Author

    Picture
    The posts on this site are written and maintained by Jim Lynch. About Jim...
    Picture
    Follow @JimLynchCodes
    Follow @JimLynchCodes

    Categories

    All
    Actionscript 3
    Angular
    AngularJS
    Automated Testing
    AWS Lambda
    Behavior Driven Development
    Blockchain
    Blogging
    Business Building
    C#
    C / C++
    ClojureScript / Clojure
    Coding
    Community Service
    CS Philosophy
    Css / Scss
    Dev Ops
    Firebase
    Fitness
    Flash
    Front End
    Functional Programming
    Git
    Go Lang
    Haskell
    Illustrations
    Investing
    Java
    Javascript
    Lean
    Life
    Linux
    Logic Pro
    Music
    Node.js
    Planning
    Productivity
    Professionalism
    Python
    React
    Redux / Ngrx
    Refactoring
    Reusable Components
    Rust
    Security
    Serverless
    Shell Scripting
    Swift
    Test Driven Development
    Things
    TypeScript
    Useful Sites
    Useful Tools
    Video
    Website Development
    WebStorm
    Writing

    Archives

    March 2023
    August 2021
    February 2021
    January 2021
    October 2020
    September 2020
    May 2020
    April 2020
    February 2020
    January 2020
    December 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015

    RSS Feed

  • Blog
  • About Jim
JimLynchCodes © 2023