What is an appropriate language for expressing initial stages of algorithm refinement? [closed]

First, this is not a homework assignment, but you can treat it as such ;). I found the following question in the published paper The Camel Has Two Humps. I was not a CS major going to college (I majored in MIS/Management), but I have a job where I find myself coding quite often.

For a non-trivial programming problem, which one of the following is
an appropriate language for expressing the initial stages of algorithm
refinement?

(a) A high-level programming language.

(b) English.

(c) Byte code.

(d) The native machine code for the processor on which the program
will run.

(e) Structured English (pseudocode).

What I do know is that you usually want to start your design implementation by writing down pseuducode and then moving/writing in the desired technology (because we all do that, right?) But I never thought about it in terms of refinement. I mean, if you were the original designer, then you might have access to the original pseudocode. But realisticly, when I have to maintain/refactor/refine somebody elses code, I just keep trucking with the language it currently resides in. Anybody have a definitive answer to this?

As a side note, I did a quick scan of the paper as I havn’t read every single detail. It presents various score statistics, can’t find where the answers are with the paper.

1

There is no definitive answer, except that very few people would choose C or D. My preference is A, but others may prefer B or E.

Modern high-level languages are expressive enough that I don’t bother with pseudo-code. Instead of writing pseudo-code that says “get data; do something complicated; output something”, I can just write code

def main
    def myData = getSomeDataSomehow()
    def result = myData.doSomethingComplicated()
    result.outputSomewhere()
end

More likely, I’ll start with a test:

def testThatNoDataProducesNoOutput
    createNullData()
    runCode()
    checkForEmptyOutput()
end

Then I successively add tests and elaborate the code until I can’t think of any more tests.

1

First of all, I hardly believe that anyone have a definitive answer.

Personally me always get annoyed by any kind of pseudocode even in good books, even in excellent ones, be it Knuth’s “Bible” or Corman’s “Gospel”.

I’m ready to apprehend and to learn any real language, there’s no problem to read the algorithm implementation written on any high level language. Moreover, I found such code snippets more useful in any sense.

As for refinement, well, my first thought was to note that actually yes, there are some options, which can be conjugated with that term. For, dealing with memory, manual allocating and deallocating, can divert us from the very essence of algorithm. For the similar reasons, dynamically typed languages are more preferable compared to static ones. Roughly, Java is better for so-called algorithm refinement than С++, and Ruby or Python are better then Java.

To say this, I repeat, was my first intention. But than I’ve remembered that I actually have no problems with reading code snippets in Haskell (which I know a little bit), ML (which I don’t know at all) or C++, which I’ve never used.

So, I believe it is only matter of practice. Anyone who is reading a lot of algorithm explanations have to learn to spot quickly different peculiarities of different languages. As for me, it is way better when those languages are “real”.

ps
you forgot to mention flowcharts )))

2

The answer they’re looking for is English. More accurately, the language used should be the one that is understood by the lowest common denominator (usually the end-users of the system and/or the person paying the bills).

The inference that the end users and other non-technical “stakeholders” are involved here makes the answer obvious; “the initial stages of algorithm refinement” is synonymous with “the gathering of requirements for the algorithm”. Those requirements are not gathered in bytecode, machine code, C# or even pseudocode; they are gathered in English, and the users will evaluate the correctness of the algorithm in terms of what they said it should do, in English.

Once requirements are gathered in plain English, they are typically structured in a “Given… When… Then…” format. “Given that the user has left the User ID field blank, When the user clicks the ‘Login’ button, Then the program displays an error message and highlights the User ID field”. These are still very understandable by end users and are not pseudocode. These can be taken, one at a time, and used to produce a pseudocode algorithm that can be reviewed before being developed in the native language. Depending on the environment, pseudocode may not be necessary (or even encouraged; TDD would typically have you start coding a test based on each Given/When/Then requirement, and then coding to pass each test in turn while keeping all previously-passing tests “green”), but pseudocode is a good way to structure the layout of a complex algorithm and have it reviewed by yourself or any other team member, regardless of the level of expertise that you or any of them may have with the programming language to be used.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật