简体   繁体   中英

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?

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, ie 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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM