Pages

Monday, May 20, 2019

Learning to code

My brother recently suggested that we work on developing a helper app for a board game that we both play, as it'd be useful and, more importantly, give us a good excuse to do something together. (As parents of large families with young kids, it can be pretty difficult finding time to actually do this!) There was just one little problem with his suggestion—he's a software engineer; I am most definitely not. The only computer related class I took in college was a freshman intro to computers class, which was about as exciting as it sounds.

Ok, that's a little misleading. I've been messing around with computers since I was a little kid (including dabbling with several incarnations of BASIC), and have done a few of those online interactive language introductions (such as JavaScript). In college I worked for a small company where, among other things, I was their "computer guy" by virtue of knowing more about computers than anyone else, so I was responsible for networking, installation, and general troubleshooting.

Anyway, my brother wants to write this new app in C#, so I figured that if I'm to be of any actual assistance, I'd better learn the language! I ran through the relevant interactive intro courses on Codecademy and SoloLearn, which is roughly equivalent to reading the rules of chess but not actually playing a game.

We hadn't yet found time to get together and work on the project, so I considered what to do next in order to keep learning. A couple of years ago, after doing the JavaScript intro, I had started working on a console version of FreeCell, as it seemed like an appropriate learning challenge: clear, but uncomplicated rules, but also non-trivial to implement (at least for someone of my experience). I hadn't ever finished that project, so I thought it would be nice to do it in C#.

Shortly after I started working on that, my wife and I had a new baby! After coming home from the hospital, I started getting up at 3am to take care of him, so my wife could get some uninterrupted sleep, and I needed something to keep my mind off, well, sleeping. Working on this C# program was a great project for these early morning hours, and I made a lot of progress!

We'll call that phase 1 of learning to program in C#. Here are a few of the key things I learned (in no particular order):

  1. When I was "learning" JavaScript, I was just using an online code editor, which had some built in formatting features and error detection, but nothing like Intellisense in Visual Studio, which I've been using for C#. A feature like Intellisense is pretty amazing.
  2. It's amazing for several reasons: one, it helps reduce the drudgery of repeatedly typing the same sorts of things over and over again. (I'm not talking about code re-use here, but basic things like names) Two, it helps reveal to the novice (me) the internal logic of the language by showing me the sorts of things the compiler is looking for. Three, by reminding me of the arguments required by different methods. There is value in making errors, in that they are an opportunity for learning (and learning more concretely), but too many errors just leads to frustration and negatively impacts learning. Intellisense doesn't do the programming for me, as I still have to choose the correct options and use them correctly once I have them on the page.
  3. I was at first frustrated by the fact that C# is much more strongly typed than JavaScript, as it made certain trivial things more difficult. However, at a certain point in writing my JavaScript program, I had started to encounter unexpected behavior which took a long time to figure out, and some of it was due to implicit type conversion happening "under the hood". C# has been making me work harder to get things set up, but this has had the very important effect of making me think more carefully about what my variables and objects are doing! Rather than just stabbing at particular outcomes, I am thinking more about how the computer "thinks" about things.
  4. Oh dear, there is a lot more to learn! Continuing with the chess analogy I used earlier, I now know the basic rules, and have learned the basic principles of development (a term applicable to both chess and software!), but I am almost completely ignorant of combinations or structure.
Working on my C# console version of FreeCell (which is now basically complete), I had to repeatedly consult reference materials in order to figure out good solutions to individual challenges. The process of trying to solve those was very educational--much better than doing pre-built exercises!

I may revisit the FreeCell project in order to explore user interface development (a text-based card game is pretty clunky), but for now I'm moving on. My next personal project will be re-writing a a spreadsheet "app" I made many years ago, which I called "Improv Randomizer", which takes a variety of categories of musical forms and features, and within each category generates a random option to be used as a creative constraint in improvisation exercises. Unlike FreeCell, I am not aware of any actual apps that do this, so there is a (slight) real-world purpose to this project! The logic of the program is fairly simple (randomly access list elements), so the main learning challenge will be developing the UI. Even a simple Windows UI would be an improvement over my current spreadsheet version (although I could probably improve the spreadsheet version too).


Saturday, March 22, 2008

Reflection on the Passion of Our Lord

Oh Jesus,

You humbled yourself to the point of death, death upon the cross. Yet, even as the thorns were fashioned into a crown, so the cross became your throne, upon which you became the Savior and King of the world. The nails became your scepter, with which you destroyed the power of sin and death, casting down him who had made himself prince of this world.

This prince, that ancient dragon who even now seeks to devour those who would be your subjects and disciples – what power does he have before you? Could you not have vanquished all your foes with a single word? You who could have summoned legions of angels to do battle for you – why did you choose thorns, cross and nails as your weapons instead?

You possessed everything, but you poured yourself out to the point of becoming as nothing. Through you, the universe was created, but you put yourself into the hands of mortal man. You would not even boast of the brilliance of this plan, for in all things your only concern was to do the will of the Father. You did not insist on your own methods, your own way, but instead prayed, “Not my will but yours be done.”

What then do you mean when you say to us, “If anyone would be my disciple, he must deny himself, take up his cross and follow me”?

To rejoice in doing the will of the Father as though it were better than possessing all the treasures of the world? To become as a servant to all? To put aside the pursuits of pride and seek humility? To pour out my life as an offering of love?

Oh Jesus, this is too great a thing for me! I cannot carry my cross – I am too weak and afraid. If I were to try to carry it on my own and make my own path with it, as soon as put it on my shoulder I would drop it and run away. I need you to come alongside me, behind and before me, and lay upon my shoulders that cross that you have fashioned for me, so that my burden might be light and easy, that I might learn from you and find eternal rest for my soul.

Thursday, February 28, 2008

Jesus said this to indicate the kind of death by which Peter would glorify God. Then he said to him, "Follow me!" (John 21:19 NIV)
Sometimes, I am of the opinion that being fabulously successful under the world's definition is how God wants me to best glorify Him. But here, John states that it is Peter's death that would glorify God (this is not to say that nothing else that Peter would do would bring glory to God). Perhaps we should devote more thought to how our death can be an opportunity for God to be glorified. And of course, the days and months and years preceding that time, all the way to the present as well.

Friday, February 08, 2008

The Call of Wisdom

The Call of Wisdom
Does not wisdom call out?
Does not understanding raise her voice?
On the heights along the way,
where the paths meet, she takes her stand;
beside the gates leading into the city,
at the entrances, she cries aloud:

“To you, O men, I call out;
I raise my voice to all mankind.
You who are simple, gain prudence;
you who are foolish, gain understanding.
Listen, for I have worthy things to say;
I open my lips to speak what is right.
My mouth speaks what is true,
for my lips detest wickedness.
All the words of my mouth are just;
none of them is crooked or perverse.
To the discerning all of them are right;
they are faultless to those who have knowledge.
Choose my instruction instead of silver,
knowledge rather than choice gold,
for wisdom is more precious than rubies,
and nothing you desire can compare with her.

“I, wisdom, dwell together with prudence;
I possess knowledge and discretion.
To fear the Lord is to hate evil;
I hate pride and arrogance,
evil behavior and perverse speech.
Counsel and sound judgment are mine;
I have understanding and power.
By me kings reign
and rulers make laws that are just;
by me princes govern
and all nobles who rule the earth.
I love those who love me
and those who seek me find me.
With me are riches and honor,
enduring wealth and prosperity.
My fruit is better than fine gold;
what I yield surpasses choice silver.
I walk in the way of righteousness,
along the paths of justice,
bestowing wealth on those who love me
and making their treasuries full.”
(Proverbs 8:1-21 NIV)

Blessed is the man,
who does not walk in the counsel of the wicked
or stand in the way of sinners,
or sit in the seat of mockers.
But his delight is in the law of the Lord,
and on his law he meditates day and night.
He is like a tree planted by streams of water,
which yields its fruit in season
and whose leaf does not wither.
Whatever he does prospers.
(Psalm 1:1-3 NIV)

Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy and my burden is light.
(Matthew 11:28-30 NIV)

“He who as hears to hear, let him hear.
(Mark 4:9 NIV)
To what, to whom am I listening throughout the hours of the day? From whom do I receive instruction in the way that I should live? What thoughts and ideas form the internal dialog between my heart and mind? What do I contemplate as I dream about life?

To push those questions in the direction of the passages quoted above: Do I welcome, do I love the Wisdom of God, or do I instead love the wisdom of another? What do I delight in – every word that comes from the mouth of God, or do I delight more in hearing the voice of another? Do I take to heart the instruction of Jesus and learn from him, or do I resist his direction and follow the way of another?
This day I call heaven and earth as witnesses against you that I have set before you life and death, blessing and curses. Now choose life, so that you and your children may live and that you may love the Lord your God, listen to his voice, and hold fast to him. For the Lord is your life. . . [emphasis mine]
(Deuteronomy 30:19-20a NIV)
Which life will I choose?
Which life will you choose?

Monday, October 22, 2007

Behold, he stands at the door and knocks

I have truly fallen far from you, Jesus, though not in the way I would normally mean by "falling" -- it is more that I am aware that my love has grown cold. A prideful voice in me suggests that this awareness is due to some heightened spiritual sensitivity on my part, and that I should give myself some credit for it. Yet who am I that I should boast of spiritual sensitivity? I have done little to increase in that and much to cause a deadening of my senses. No, any sensitivity is purely the work of Grace. It is you, calling me back from the brink of destruction, warning me that I am about to fall headlong into the vast ocean of my passions.

The desires in my heart are breeding and growing out of control. You stand at the door and knock, offering my soul that excellent medicine which is your very self -- perhaps that is why I am avoiding you, because I have grown attached to my present state and realize that letting you in will mean the death of these disordered desires. At least, that is the perception, though in fact you bring order and redemption to the desires of the heart.

Right now there is a certain agony, for I know you are near; I can hear you knocking, calling from just a short distance away. Such tension is unbearable; I will not be able to last much longer. When I can bear it no more, I will either go and open the door and let you in, or I will run away and stop my ears so that I can pretend you are not there. Which will I choose to do? O God do not abandon me! Do not let me stray far from your side, but come and rescue me. If I flee from your presence, come and find me and call me once again.

I am confident of this: You will follow me all the way to the gates of hell itself and extend your hand to me, that I might grasp your hand and be saved. O God, may I have the strength to cry out to you in the hour of my death!

Sunday, April 08, 2007

Humility

From 1st Peter 5:
All of you, clothe yourselves with humility toward one another, because, "God opposes the proud but gives grace to the humble." Humble yourselves, therefore, under God's mighty hand, that he may lift you up in due time. (vss. 5b-6 NIV)
How do I clothe myself with humility? How do I humble myself? Every time I attempt to do so, by this means or that means, I find myself taking credit for it. And even if I give God credit for accomplishing something in me, in my heart I become proud of the fact that I gave credit to God for helping me be humble. And if I give credit to God for helping me give credit to him. . . . the same result. Everywhere I turn, my pride confronts me.

Even in writing this, I find myself admiring myself, saying, "Ahh, what wisdom, what self-knowledge, what humility" and deep-down hoping that others might think the same.

I don't know how to humble myself, for if I do it, I will take credit for it. How do I boast in my weaknesses, without regarding such boasting to be my strength, and so defeat the entire purpose?

I am hesitant to ask God to give me a humility found apart from my efforts, because I suspect that my pride is like a deadly cancer growing within me which can only be removed by painful surgery. I'd rather it'd be as simple as pressing a button and having it removed in a moment — no pain, no struggle, no loss.

But why should I consider myself better than Jesus Christ, the Son of God, who,
Although he was a son, he learned obedience from what he suffered and, once made perfect, he became the source of eternal salvation for all who obey him. . . (Hebrews 5:8-9)
Indeed, Peter instructs us earlier in his letter:
Therefore, since Christ suffered in his body, arm yourselves also with the same attitude, because he who has suffered in his body is done with sin. As a result, he does not live the rest of his earthly life for evil human desires, but rather for the will of God. (1 Peter 4:1-2)
Lest I confuse this attitude with dejection and self-pity, as if sighing to myself "Woe is me, for I am suffering", he goes on to say:
Rejoice that you participate in the sufferings of Christ, so that you may be overjoyed when his glory is revealed (4:13)
Dejection in the face of suffering would be the response of pride, which wishes that I did not have to undergo suffering, because it thinks that I should be better than to need it. Rejoicing is the response of humility, for it recognizes that my soul is in desperate need of healing, and that this suffering is its medicine and path to union with God.

I cannot dispense the necessary medicine to myself, for I am incapable of knowing the correct prescription for my needs, nor can I operate on myself. Instead, I will simply have to be silent and wait for Him to do as he will.

Monday, January 29, 2007

For a Woman

Remember, Daughter of Eve
Do not forget, O Woman –
Many are the years that have passed upon the earth
Flowers faded, forests grown, mountains crumbled
And memories become like mist.
The stories told are often tales
Of darkness or even soulless gray,
But it was not always so.
And now the Light has dawned,
Life is come, the gift is giv’n.
The Morningstar rises,
Eden glimpsed again.

Who is this that rages now?
He with empty, burning gaze,
That dragon, mankind’s bitter foe.
He desires your ruin, the ruin of your soul.
O Daughter of Eve, keep your guard!
O Woman, with such wonder were you made!
Crowning beauty of God’s creation!
Though you fell into death’s dark grasp,
The weight of sin upon your soul –

Look! Your Savior comes!
Conqu’ring death itself, he storms the darkened keep
And wakes his Sleeping Beauty with a tender kiss.
And now you, O Princess,
You whose name is Precious One, Beloved,
Daughter of the King,
Remember!

Remember who you are.
Heed not the dragon’s lies.
Do not listen to his clever tales.
He will try to enchant you,
To put you under his spell of darkness,
To cause your soul to sleep
And slip away into death,
To forget the One who created you,
The One who claims you as his own,
To fill your eyes with deep shadows
That you might forget the light,
Or, still rememb’ring, to despair of seeing it again.
He does not want you to know, nor to understand
That you were created for life, for love
That God has endued you with beauty
Beauty that radiates from your soul –
You are a reflection of the glory of God.

Written 7/13/04 Rev. 10/27/04