Archive for Month: December 2015

Working on Material

Just a heads up:

  • I’m in the editing process for a pattern book right now.
  • I’m working on new material
  • It’s almost Christmas

So, posting will be sporadic until after the new year.

Pointer Arithmetic Matters

What’s the first thing you think when I say the word: “Pointer”. Generally, you either think of a particular register (unlikely) or a hexadecimal number representing a location in memory (likely). Personally, I’m in the latter category, which is why this problem arose.

I was in the middle of programming, and I decided to allocate an array of a given structure. If we pretend that my structure was called “panda”, the code would look something like this:

//I had some number of structures to allocate, but I wasn't sure in advance how many
int j = get_quantity();
struct panda * NP = (struct panda *) calloc (j, sizeof(struct panda));

All very straightforward so far. I figured out how many structures I would need and allocated a contiguous (and zero-filled) memory space for them. This basically created an array of struct panda’s, with every field of every struct panda set to 0.

Here’s where it got a bit tricky. I was going to populate all of this space using a loop that looked something like this:

//Repeat once for every struct I allocated
for(i=0; i< j; i++)
{
    fill_panda(
        NP + (i * sizeof(struct panda)),
        ...
        );
}

This code morsel threw a SegFault every time.

Even though there’s not much there, it took me hours to figure out how I screwed this up.

Here’s a hint: it’s right there in fill_panda.

Give up?

You see, I’m acting as though NP is a (64-bit) hexadecimal number corresponding to a Byte in memory. If that were 100% true, there would be no problem. However, NP isn’t just some hexadecimal value – it’s a POINTER.

Not just any pointer, but a pointer to a struct panda.

It turns out that C pointers know their size. If you say NP+1, it is functionally similar to NP[1].

I basically dynamically allocated an array, right? And we can use array notation on an array, right? Good.

So, when I meant to say:

NP[i];

I actually said:

NP[ i * sizeof(struct panda) ]

Whoops. Because struct panda is not the size of a single character, I was guaranteed to go out of the bounds of my allocated space.

To Drive the point home, so no one can forget:
NP + 1 == NP[1].
NP == NP[0].
NP + i == NP[i].

Don’t overthink it, like I did.

Patterns – Prototypes and Optimization

The hardest interview I ever had: someone told me to go up to a whiteboard and solve a programming problem, in code, optimally, on the first try.

It’s a basic fact of our field that we iterate toward the final product. Not unlike a sculptor bringing the David out of a piece of marble, we go from a rough piece of code toward a refined piece of code in a series of stages.

Rough Outline

We usually start with a piece of pseudocode that generally describes what we want a function to do. This can be written in basically any format (text, outline, pseudocode, diagram, etc.), but it has to detail the basic elements we expect to find in our function.

Specifically, our outline serves these two purposes:

  • Expose functionality for better breakdown
  • Reveal the interface elements that we might want or need

If we skip this step entirely, we tend to spend a lot of time reworking our basic code as we discover features we wanted to include.

Exposed Interface with Dynamic Allocation

Next, we write the first draft of our code. At this stage, we are basically limited to the information provided by the rough outline.

Because we don’t necessarily know what size our final data will be, we dynamically allocate space using malloc() or calloc(). This allows us to quickly modify the size and range of our data as we determine what elements we will include in the final product. This serves the secondary purpose of preserving our outline, as we have not yet optimized away extraneous variables required for simple reading.

Furthermore, because we don’t yet know how many of our parameters will be standardized (through precompiler definitions or static variables), we want to take as many of them as we can into account. At this stage, our interfaces can be incredibly daunting, because they allow us to tweak EVERY parameter through the function call. We also want to pass pointers into these functions, but we’re not sure whether to make them const, so there’s a risk of silly errors.

Note: At this stage, we might start defining structures to carry these parameters, just to reduce the size of the interfaces.

Refined Interface with Dynamic Allocation

As we move on, we begin to determine the size of our parameters and the scope of our data. While we’re not yet ready to jump to static allocation, we are becoming aware of what that statically allocated data might look like.

We are also ready to restrict the interface, as we have determined which parameters we intend to manipulate and which we will set to default.

There are two approaches to entering this stage:

  • Rewrite your functions to restrict the interface to the core function
  • Write wrapper functions to restrict the interface that the user deals with

Generally speaking, it’s safer and easier to go with the latter.

Refined Interface with Static Allocation

Now we’ve reached the point where we basically know what our data will look like. We’ve made the tough calls, determined the final flow of the code, and settled on the size and types of data we’ll employ at each level.

Now we begin replacing dynamic allocation with static allocation. If you’ve structured your interfaces properly, this is about as simple as replacing all -> with . and removing all allocation and free operations.

Note: Don’t forget to clear the values in your static variables, especially if you were relying on calloc() to do that.

Minimal Interface with Static Allocation

Now we perform the true optimization stage.

Because we’ve finally settled exactly how our code will work, we can begin to restrict the inputs to our functions with const and similar keywords. This restricts our interfaces to the smallest and most restricted they can be, resulting in code that is reliable and easy for the end user to work with.

We also start to clean up our headers, removing any of the “old” function interfaces which are wrapped by the cleaner interfaces. This helps restrict the interfaces and prevents the end user from doing dangerous things.

We also start working with our variables. Depending on the level of optimization required, we start to do things like move things to global scope or reorganize code to reuse static variables (which I generally do not recommend if it makes the code harder to read).

This stage should produce a final set of code that you’re happy to run and maintain, but there is another possible layer of optimization you can employ…

Optional Library Optimization

This is the sort of thing programmers had to do in the early days, to maximize utility of tiny systems.

Here we start reusing variables on the register level, optimizing out log code (and other valuable information), and generally render the code impossible to maintain.

Compiling with optimization does much of this naturally.

Generally speaking, this is only recommended for code you are virtually 100% certain you will never have to touch again.

Lesson: Change and uncertainty is law in the earlier stages of program development. Leave your early code very open for changes, and optimize as the project reaches final definition.

1 Corinthians 3 – Teaching and Preaching in the Flesh

Grace and Peace to you from God our Father and the Lord Jesus Christ.

Today we’ll be covering the third chapter of Paul’s first letter to the Church at Corinth. In this chapter, Paul instructs the Church regarding teaching and those who teach.

Reading: I Corinthians 3

And I, brethren, could not speak unto you as unto spiritual, but as unto carnal, even as unto babes in Christ.

I have fed you with milk, and not with meat: for hitherto ye were not able to bear it, neither yet now are ye able.

We know that one of the marks of a baby’s development is the day it is weaned off of milk and onto true foods. However, before the child is ready to partake of the food of our tables, it is unwise to give him that food.

This is the analogy that Paul makes concerning his teachings to the Corinthians. They are not yet ready to receive the most valuable and beneficial of spiritual teachings, so Paul teaches them in words they can receive.

This is equally true of most Christians I have encountered in my time. They are as babies, unable to engage in proper study of the Scripture because they have not developed beyond the milk.

For ye are yet carnal: for whereas there is among you envying, and strife, and divisions, are ye not carnal, and walk as men?

This is one of the marks of this carnality – that we bicker and fight as the non-believers.

For while one saith, I am of Paul; and another, I am of Apollos; are ye not carnal?

Who then is Paul, and who is Apollos, but ministers by whom ye believed, even as the Lord gave to every man?

It is not the work of the minister, missionary, or any other Christian that brings about repentance. We have no power or right to brag, because our work is merely a poor instrument by which the Lord operates in this world.

I have planted, Apollos watered; but God gave the increase.

So then neither is he that planteth any thing, neither he that watereth; but God that giveth the increase.

Now he that planteth and he that watereth are one: and every man shall receive his own reward according to his own labour.

The Lord sends out His Spirit before us, to ready the people to receive teaching and minister amongst one another. We go out and do what the Lord commands, but he is both foreman and greatest laborer – he knows how the seed is sown, and how it grows, and when it must be harvested.

This is not to say that we do nothing, but our work is lesser than that of the Lord (and meaningless without His direction).

For we are labourers together with God: ye are God’s husbandry, ye are God’s building.

As Paul repeats, we are merely tools and structures that serve a purpose, but the Lord directs that purpose.

10 According to the grace of God which is given unto me, as a wise masterbuilder, I have laid the foundation, and another buildeth thereon. But let every man take heed how he buildeth thereupon.

11 For other foundation can no man lay than that is laid, which is Jesus Christ.

Paul was given the skills, words, and direction required to lay a solid foundation for the Church in Corinth. Every man who comes after by the direction of the Lord builds upon that foundation.

12 Now if any man build upon this foundation gold, silver, precious stones, wood, hay, stubble;

13 Every man’s work shall be made manifest: for the day shall declare it, because it shall be revealed by fire; and the fire shall try every man’s work of what sort it is.

This reminds us of the “parable of the talents”, in which several servants are given a measure of wealth to invest and grow for their master. The only servant who is despised is that who did not attempt to grow that initial investment, but merely hid it away.

So it is that we are to work, using those skills given us by God, to benefit the Kingdom. After this, when the Lord Jesus Christ returns on the Last Day, we will be given in measure to what we have worked.

14 If any man’s work abide which he hath built thereupon, he shall receive a reward.

15 If any man’s work shall be burned, he shall suffer loss: but he himself shall be saved; yet so as by fire.

Salvation is guaranteed us, by the Lord Jesus Christ and his sacrifice upon the cross. However, if we do ill work we shall receive ill punishment, and if we do good, good.

16 Know ye not that ye are the temple of God, and that the Spirit of God dwelleth in you?

Now the Apostle redirects his attention from the work of a man’s hands to the body that a man possesses. This body is house of the Spirit, so those blessed with the Holy Spirit are houses of the Spirit of the Lord Himself.

17 If any man defile the temple of God, him shall God destroy; for the temple of God is holy, which temple ye are.

Those who take ill care of their bodies (mutilators, gluttons, homosexuals, and others after this kind) are punished by nature, which is under the sustaining force of the Lord. As he directs, we suffer all manner of ailments and misfortunes (Gay Related Immuno-Deficiency, also known as AIDS, springs immediately to mind), often as punishment for our transgressions.

This is doubly true for those of us who are filled with the Holy Spirit, for we are to be in the world, but not of it.

18 Let no man deceive himself. If any man among you seemeth to be wise in this world, let him become a fool, that he may be wise.

We notice that many of those praised for their intellects are foolish when it comes to the Scriptures. Richard Dawkins, Christopher Hitchens, and dozens of other “geniuses” have written a number of books demonstrating this fact.

19 For the wisdom of this world is foolishness with God. For it is written, He taketh the wise in their own craftiness.

20 And again, The Lord knoweth the thoughts of the wise, that they are vain.

How can one attempt to outwit the Lord Most High? He is the source of all things we observe, both the physical and the laws that govern our reality.

Those who consider themselves wise are often blinded by their own hubris, and cannot perceive their own weaknesses.

21 Therefore let no man glory in men. For all things are your’s;

22 Whether Paul, or Apollos, or Cephas, or the world, or life, or death, or things present, or things to come; all are your’s;

23 And ye are Christ’s; and Christ is God’s.

We have been granted an inheritance greater than all others in this world. In this world, we are given the Holy Spirit and wisdom from the Lord. In the world to come, we are given life eternal, in perfect flesh which experiences neither pain nor sorrow.

Praise be to the Lord who gives us all this.

Let us Pray

God Almighty, who is Lord over all of creation, we thank you that You are the Most Holy God. We thank you that you are the Only God, so that none of the pale imitations and vile creations of man can be said to rule over all.

Let these words fill our minds. Let us meditate upon them day and night, so that by the power of the Holy Spirit we may receive all wisdom and knowledge from You.

We ask these things in the name of the Christ, Jesus, the Messiah who has come into the world for our salvation,

Amen.

 

May the Lord instruct you and teach you all things.

Amen.

Falling off the Horse

The only right thing to do is to get back on. So, I’ll build up a buffer again and get back to work.

 

Next post Monday.

Patterns: Shielding Inputs with const

One of the key worries I have heard from those ill-informed OOP programmers is that C cannot protect inputs you pass into functions. They use private fields and retrieval functions to ensure that the stored value is protected from unwanted modification.

However, this concern is addressed by C’s const keyword.

Taking a const value

There are times when we want to guarantee to all end users that our function will not modify particular values. Perhaps we are reading a stored key value in order to provide an access, but we want to ensure that nothing we do modifies that key.

If our function prototype and related documentation employ pass-by-reference (a common practice for large values) but do not employ the const keyword, the end user has no guarantee that the stored value will be the same after we’re done.

The difference between…


int func ( char * key)

…and…


int func( const char * const key )

…is that the first interface has full control of the key, while the second promises not to change either the pointer or the values at that pointer.

Creating a const value

Often enough, we want to create a value that never changes throughout operation. Perhaps it’s a static variable used to allocate arrays, or a static message we want to print out a number of times. In these cases, we use the const keyword to protect an initialized value from future changes. For example, we can create a constant integer value like this:


const int index = 256;

We can create a constant error message in the same way, but we usually make sure that we preserve both the pointer and the value stored therein:


const char * const error_message = "ERROR: Something done goofed\n";

Note: We have to assign the variable when we declare it, because it’s a constant value that we can never change again.

Keyword const rules

The const keyword prevents anyone from modifying a value. However, when dealing with pointers we actually have two values to preserve: the value of the pointer, and the value at that pointer.

The keyword const can be seen to preserve whatever comes right after it. That means that the statement…


const char *

…protects the pointer itself, while the statement…


char * const

…protects the value at that pointer. To preserve both, we use…


const char * const

Dangerous, but useful: Casting with const

We can actually protect our values by casting them to a const value. For example, if we know we don’t want a function to change something it can technically change (no const in the prototype), we can say something like this:


int func( char * key ) {}

char * value = "penny";

int i = func( (const char * const) value );

However, we can also cast away the const (which is where it gets dangerous). That means that the program can act as though the value is naturally unprotected. That looks something like this:

int func( const char * const key ) 
{
    (char *) key = (char *) calloc( 50, sizeof(char) );
}

Generally speaking, these actions are both considered unsafe. They can be extremely useful (for example, to free a const value inside of an allocated structure), but exercise extreme caution.

Lesson: The const keyword creates a contract in your code ensuring that the compiler protects the integrity of certain values.

Patterns: The If-Else Error Chain

In languages like Java, we have a standardized error-handling paradigm in the try-catch expression. Effectively, this hands all error-handling off to the computer, which monitors all code in the try loop for any and every kind of possible error. While we are able to restrict the range of errors in many cases, the fact is that this bloats the program in both memory footprint and time required to operate.

In C, we have no such paradigm, so we have to use alternative methods to handle errors.

Common Practices

There are any number of ways to deal with errors outside of a rigidly defined paradigm.

Some (like those who operate predominantly in C++) may define supervisor functions that simulate the try-catch expression. This is less than common, because in defining the supervisor function you usually begin to appreciate the range of all possibilities. When you start trying to handle every possible error with one megafunction, you start to appreciate the simplicity of catching errors manually.

The most common practice is to test the output of functions and related operations. Whenever you call an allocation function like malloc() or calloc(), you test the output to ensure that space was properly allocated. When you pass-by-reference into a function, you test the inputs to ensure that they make sense in the context of your program. Methods like these allow us to manually handle both the flow and the error-handling of our code.

However, in most cases we have a “multiple-breakout” pattern of tests. These patterns look something like this:

char * blueberry = (char * ) malloc(50*sizeof(char))
if(blueberry == NULL)
    return -1;
int pancake;
do_thing(blueberry, "there is stuff", pancake);
if(pancake < 0 || pancake > 534)
    return -2;
do_other_thing(pancake, time() );
if(pancake < 65536)
    return -3;
...
return 0;

This pattern runs the risk of terminating before memory is properly freed and parameters are properly reset. The only ways to avoid this terrible condition are to manually plug the cleanup into every error response (terrible) or to use goto (not terrible, but not strictly kosher).

If-Else Chain

There is one method for handling errors that is consistent with another pattern we cover (error-orientation): we build a great if-else chain of tests.

This pattern is confusing to many for two reasons:

  • If fundamentally reorients the code away from the “happy-case” paradigm (in which all error-handling is a branch off the main path) to a “failure case” paradigm (in which the happy-case is the result of every test in the chain failing)
  • All our happy-path code finds itself inside of an if() statement – nothing can be permitted to break the chain

It’s a bit hard to describe this pattern without an example, so bear with me:


int copy(const char * const input, int size, char * output)
{
    int code = 0;
    if( input == NULL )
    {
        code = -1;
    }
    else if ( output = (char *) malloc (size * sizeof(char) ) , output == NULL )
    {
        code = -2;
    }
    else if ( strncpy(output, input, size), 0 )
    {
        //impossible due to comma-spliced 0
    }
    else if (strncmp(output, input))
    {
        code = -3;
    }
    else if ( printf("%s\n", output) < 0 )
    {
        //printf returns the number of printed characters
        //Will only be less than 0 if write error occurs
        code = -4;
    }
    else
    {
        //could do something on successful case, but can't think of what that would be
    }
    //Normally we would pass output back, but let's just free him here for fun
    //This is where we do all our cleanup
    if(output != NULL)
        free(output);
    return code;
}

As we can see, each step in the error-handling function is treated as a possible error case, each with its own possible outcome. The only way to complete the function successfully is to have every error test fail.

Oh, and because this code is fundamentally modular, it is very easy to add and remove code by adding another else-if statement or removing one.

Lesson: Switching to an if-else chain can improve error awareness and accelerate your programs in operation, without requiring much additional time to design and code.

I Corinthians – The Spirit of God Grants Understanding

Grace and Peace to you from God our Father and the Lord Jesus Christ.

Today we’ll be looking at the second verse of Paul’s first letter to the church of Corinth. In this chapter, Paul speaks of the mysteries of the Lord, the reasons why these mysteries are nonsense to the world, and the Gift that is the Holy Spirit.

Reading: I Cornithians 2

And I, brethren, when I came to you, came not with excellency of speech or of wisdom, declaring unto you the testimony of God.

Paul was not an expressive or emotive preacher, using the power of emotional thrust to sway his people to follow his direction. Instead, Paul came speaking the plain truth of God to the people of Corinth.

2 For I determined not to know any thing among you, save Jesus Christ, and him crucified.

He did not necessarily forge tight brotherly bonds with them outside of their unity in Christ.

3 And I was with you in weakness, and in fear, and in much trembling.

However, he did dwell with them and share in their tribulations.

4 And my speech and my preaching was not with enticing words of man’s wisdom, but in demonstration of the Spirit and of power:

5 That your faith should not stand in the wisdom of men, but in the power of God.

He did all these things to avoid being “the preacher who pursuaded me to become a Christian”, but “the man who introduced me to God”. While these may seem very similar, the difference is that the man in the first instance is the one who did the pursuading, while it is God in the second instance.

6 Howbeit we speak wisdom among them that are perfect: yet not the wisdom of this world, nor of the princes of this world, that come to nought:

7 But we speak the wisdom of God in a mystery, even the hidden wisdom, which God ordained before the world unto our glory:

8 Which none of the princes of this world knew: for had they known it, they would not have crucified the Lord of glory.

The wisdom of God may not make sense to those who dwell in the world (indeed, it almost certainly cannot make sense to them). While the teachings of the Bible may often parallel the wisdom literature found in the world (much of Proverbs is reflected in the literature of Taoism), the spiritual matters of God are nonsense to even the most wise in this world.

One of the gifts of the Holy Spirit (indeed, one of the stated purposes for sending the Spirit among us) is to give us understanding (john 14:26). Because of this Spirit, the apostles suffered all manner of torture in the name of the Lord. Many of our brethren who are already asleep were tortured and executed in the name of this Spirit. If those who did such wrongs had this same Spirit and wisdom, they would have dropped their swords and praised the Lord Most High.

However, we were warned that as they came for Christ, so they would come for us (John 15:20).

9 But as it is written, Eye hath not seen, nor ear heard, neither have entered into the heart of man, the things which God hath prepared for them that love him.

10 But God hath revealed them unto us by his Spirit: for the Spirit searcheth all things, yea, the deep things of God.

We can never overestimate the work of the Lord. He is wise above all things, and mighty in power. No man (prior to the coming of the Holy Spirit) had even the faintest glimmer of the majesty of the Lord and his Goodness toward his children.

For who could have foreseen that the Lord would come to save those who despised Him, through the suffering, death, and resurrection of His only begotten Son. Even Isaiah, who prophesied about these things, did not have a full understanding of the nature of the Messiah as both Mighty Lord and Humbled Sacrifice.

However, by the Spirit, all these things are made clear to us. Praise be to the Lord who has given us this wisdom previously unavailable even to kings and wise men.

11 For what man knoweth the things of a man, save the spirit of man which is in him? even so the things of God knoweth no man, but the Spirit of God.

This calls back to the work of Aristotle, who discerned several spirits in existence in our world. He noticed the spirit of life, which gives life to all things that live, the spirit of the animal, which provides instincts and basic nature, and the spirit of man, which provides insights and reason.

While these spirits are all present even in fallen man, the Spirit of God is not present in those to whom the Lord has not given it. This Spirit grants us insight into God, even if only an imperfect insight hampered by our sinful flesh. Without this Spirit, it is not possible for the Word of God to become clear and understandable.

12 Now we have received, not the spirit of the world, but the spirit which is of God; that we might know the things that are freely given to us of God.

13 Which things also we speak, not in the words which man’s wisdom teacheth, but which the Holy Ghost teacheth; comparing spiritual things with spiritual.

That which is not physical cannot be understood in physical terms. We can attempt to describe them as such – the Papists use the physical nomenclature of Aristotle to describe the mystery of the Eucharist – but these terms are wholly inadequate.

However, when we speak of spiritual things to those who have appreciation of spiritual things (through the work of the Lord), we are able to both express and rejoice in those works of the Lord which are manifest in our lives.

Further, while much of Scripture is good and right for teaching us worldly matters, the mysteries of God are only revealed in the “words which the Holy Ghost teacheth”. To those who cannot hear the Word of God, these truths are forever out of reach.

14 But the natural man receiveth not the things of the Spirit of God: for they are foolishness unto him: neither can he know them, because they are spiritually discerned.

15 But he that is spiritual judgeth all things, yet he himself is judged of no man.

16 For who hath known the mind of the Lord, that he may instruct him? but we have the mind of Christ.

The natural man lacks the Spirit of God, and so cannot understand the teachings therein. To the believer, doctrines of the Second Birth (through the baptism of the Holy Spirit) and the mystery of the Eucharist are both receivable and wonderful things. However, to those who are not among the brethren, these things are manifest foolishness. This same is true of many of the “hard sayings” of Jesus.

(For a much more excellent study on these hard sayings, read F.F. Bruce’s work)

However, we who have the Spirit have both the spirit of man and the Spirit of God. Thus, we are able to understand both the things of this world and the things not of this world.

Let us pray

Oh, mighty and sovereign Lord, we thank you that You are chief above all things, both Physical and Spiritual. We praise your name and give you thanks for all the works you have done.

We thank you most especially for the gift of the Holy Spirit, through which we are made to understand spiritual matters which are nonsense to the world. We thank you that this same Spirit gives us discernment to separate the foolishness of the world from the wisdom, and the spirituality of fools from the truth.

Guide us ever, Lord, and direct our paths so that we may give you praise at all times and in all places, in word and deed.

We pray all this by the urging of the Spirit, who gives us words and teaches us what to say. And we pray also in the name of the Lord Jesus Christ, the King of Kings and the Prince of Peace who has become the perfect sacrifice on our behalf.

Amen.

 

May the Spirit dwell in you richly, and give you understanding of all things.

Amen.

I Corinthians – One Church

Grace and peace to you from God our Father and the Lord Jesus Christ.

Today we will begin studying the first of Paul’s letters to the church of Corinth. This was a city known for its wickedness and depravity (like Vegas on steroids), and the church struggled mightily to resist the world. Paul wrote to them in a spirit of encouragement, love, and instruction, so that they could stand against the wiles of the devil.

Reading: I Corinthians 1

Paul, called to be an apostle of Jesus Christ through the will of God, and Sosthenes our brother,

2 Unto the church of God which is at Corinth, to them that are sanctified in Christ Jesus, called to be saints, with all that in every place call upon the name of Jesus Christ our Lord, both theirs and ours:

3 Grace be unto you, and peace, from God our Father, and from the Lord Jesus Christ.

Again, Paul begins every letter with a blessing to the brethren.

4 I thank my God always on your behalf, for the grace of God which is given you by Jesus Christ;

5 That in every thing ye are enriched by him, in all utterance, and in all knowledge;

6 Even as the testimony of Christ was confirmed in you:

7 So that ye come behind in no gift; waiting for the coming of our Lord Jesus Christ:

8 Who shall also confirm you unto the end, that ye may be blameless in the day of our Lord Jesus Christ.

This is the mark of the faithful. Paul encourages the brethren by reminding them of the Gifts of the Lord – for they are granted insights and wisdom, the testimony of Christ, and all spritual gifts.

Even in the darkest of places, where spiritual forces of wickedness reign supreme, the Light of Life shines bright. And He will raise us up on the last day.

9 God is faithful, by whom ye were called unto the fellowship of his Son Jesus Christ our Lord.

This reflects a dual message laid out clearly by John <confirm>. In his gospel, we find the lines “no one can come to me unless the father draws him” (as water is drawn from a well), and “no one comes to the father except through me”.

This means that the Father brings us to Christ, and Christ allows us to come to the Father. In all things and in all times, it is the work of the Lord.

10 Now I beseech you, brethren, by the name of our Lord Jesus Christ, that ye all speak the same thing, and that there be no divisions among you, but that ye be perfectly joined together in the same mind and in the same judgment.

11 For it hath been declared unto me of you, my brethren, by them which are of the house of Chloe, that there are contentions among you.

As with the church of Ephesus (of which I have previously written), the church in Corinth suffered from disunity and lack of harmony. Already denominations had sprung up, apparently on the basis of who baptized you.

However, there is one Lord, and one Spirit. Surely we must all turn to the scriptures and reflect that same Lord in our messages. If we do this, are not all denominations essentially brethren?
(This is not to excuse any manner of heresy, for those who come in a different Spirit preaching a different Christ are not of the brethren.)

12 Now this I say, that every one of you saith, I am of Paul; and I of Apollos; and I am of Cephas; and I of Christ.

“I am Baptist. I am Lutheran. I am Presbyterian. I am Protestant.” Let us all read the scriptures and reflect thim in our teachings – in this way, we are all brethren.

13 Is Christ divided? Was Paul crucified for you? or were ye baptized in the name of Paul?

14 I thank God that I baptized none of you, but Crispus and Gaius;

15 Lest any should say that I had baptized in mine own name.

16 And I baptized also the household of Stephanas: besides, I know not whether I baptized any other.

Paul is happy not to be part of this contention that splits the church. For it is no honor to be the man who turned his brothers against one another.

17 For Christ sent me not to baptize, but to preach the gospel: not with wisdom of words, lest the cross of Christ should be made of none effect.

I have studied persuasion tactics and rhetoric. I am aware of the difference between dialectic and rhetoric, and I leverage that difference every day.

However, clever words are not necessary to drive the Spirit. If anything, charlatans and liars have done more to distract the brethren with these techniques than any pastor has done to unify them.

Therefore, if you have to choose between the plain Scriptures and clever rhetoric, stick with the plain truth.

18 For the preaching of the Cross is to them that perish foolishness; but unto us which are saved it is the power of God.

This is the great mystery that divides the believer from the unbeliever. To us, the power of Christ is manifest and clear, but to them it is the rambling of dangerous fools.

Without the Spirit, there is no way to cross from one side to the other, just as one cannot cross from death into life without the Spirit.

19 For it is written, I will destroy the wisdom of the wise, and will bring to nothing the understanding of the prudent.

20 Where is the wise? where is the scribe? where is the disputer of this world? hath not God made foolish the wisdom of this world?

21 For after that in the wisdom of God the world by wisdom knew not God, it pleased God by the foolishness of preaching to save them that believe.

In his study of philosophy, Aristotle came extremely close to an understanding of God’s logical necessity. However, despite his great insight and wisdom, he was unable to perceive the nature of God that we now understand. This same is true of many philosophers who lacked the Spirit.

In this age, we see the full manifestation of this truth. The modern philosophers have turned to nihilism, relativism, and other “wisdom” that denies the validity of wisdom. By rejecting the truths of Scripture (on which much of Western philosophical tradition hinges), they have produced foolishness.

22 For the Jews require a sign, and the Greeks seek after widsom:

And today, instead of signs and wisdom, we seek a blending of the two in what we term “science.”

The people of this age demand that they receive a sign which is compliant with the modern wisdom – a manifest impossiblity, as the modern wisdom rejects out of hand any such sign.

23 But we preach Christ crucified, unto the Jews a stumblingblock, and unto the Greeks foolishness;

Why a stumblingblock and foolishness? Because it is not for men to come to God.

24 But unto them which are called, both Jews and Greeks, Christ the power of God, and the wisdom of God.

However, it is for God to bring men unto him. These are granted a Spirit which possesses true wisdom, and these see signs and wonders.

As an example, consider those biologists who adhere to the doctrines of Christ. These see the depth and mystery of biology, from the obscenely-intricate 3D code that is DNA to the mechanisms required to translate DNA into an organism.

25 Because the foolishness of God is wiser than men; and the weakness of God is stronger than men.

For God is supreme over all creation – what in creation can match Him?

26 For ye see your calling, brethren, how that not many wise men after the flesh, not many mighty, not many noble, are called:

27 But God hath chosen the foolish things of the world to confound the wise; and God hath chosen the weak things of the world to confound the things which are mighty,

28 And base things of the world, and things which are despised, hath God chosen, yea, and things which are not, to bring to nought the things that are:

29 That no flesh should glory in his presence.

One might reasonably fear that a strong man would not marvel and give glory to God should his strength be increased. The same is true of the naturally smart or wise. Moreover, we can consider that the techniques of persuasion which are so often employed by charlatans and con men, if applied to the mechanism of preaching, would be credited with persuasion rather than the Lord.

So it is that the Lord has made things which are ineffective (preaching, etc.) into the instruments with which he persuades and guides his children. These things which are “weak” and “foolish” are effective because (and only because) God has employed them.

30 But of him are ye in Christ Jesus, who of God is made unto us wisdom, and righteousness, and sancrification, and redemption:

31 That, according as it is written, He that glorieth, let him glory in the Lord.

Let us Pray

Loving and Sovereign Lord, who has dominion over all things, both visible and invisible, we thank You that You are God.

We beseech you, in the spirit of unity and love which you have bestowed unto us, that we may be righteous in the face of a fallen and depraved world. We know that we are sinful creatures of the

flesh, and we are often swayed by the thinking of this world, but You are the Lord.

Give to us the wisdom and signs that only You provide, so that we may preach ever more boldly. For we know that You have commanded us to speak the truth in a world of lies.

Grant us peace, strength, and holiness through your Spirit, in the name of your Son, the Lord Jesus Christ,

Amen.

May you increase daily in the Spirit, and grow in favor with both God and Men.
Amen.

Facebook Auto Publish Powered By : XYZScripts.com