Tarik
Tarik

Reputation: 81721

Meaning of Program into Your Language and Program in Your Language

I've been reading Code Complete 2. As I am not native english speaker some statements take some time for me to understand. I would like you to describe the difference between these two statements the author made in his book:

  1. You should program into Your Language (programming language).
  2. You shouldn't program in Your Language.

Why in is bad and into is recommended?

Upvotes: 12

Views: 957

Answers (3)

danishgoel
danishgoel

Reputation: 3645

As I understand it, it means to think outside of the bounds of your programming language.

So in means you are thinking in terms of the language, so your thinking is limited by the language itself, and the program you write may not be easily translated into some other language if needed.

But into means you think in algorithms, i.e. freely, then translate into your desired language. So you can easily code in any language you know the syntax of.

But as I have not read the book actually, this may be totally wrong per the context.

Upvotes: 11

Oded
Oded

Reputation: 499002

Program into your language means that you use the language to construct the "missing" pieces - leverage it to do more than it currently does. Things like creating missing data structure, algorithms and ways of accomplishing tasks that are not native to the language.

Program in your language means just that - not trying to leverage it.

I thought the examples given in the book were quite good.

Upvotes: 10

DPM
DPM

Reputation: 2030

The author provides an example of his own in that part of the book (which unfortunately I don't remember). You can try reading a bit further.

It means that even if the language doesn't support a particularly convenient feature, as you should always think of writing readable, easy to maintain, modular code, you should try to find a way to emulate that feature even if its not enforced by the language, then you would document that, so that other developers who may modify the code stick to the same rule. I can't provide an example right now, but I think is easy to see the rationale.

Upvotes: 3

Related Questions