tailieunhanh - Extreme Programming in Perl Robert Nagler phần 10

Tham khảo tài liệu 'extreme programming in perl robert nagler phần 10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | program tells you what to do. 12 When we apply this analogy to the example we see that _to_html_tags_imperatively tells us it formats tag names one at a time and it appends them to the end of a string. When its done with that it ll return the result. The functional _to_html_tags has a list of tag names and wants a string to return so it asks join a function that conatenates a list into a string. join asks for a separator and a list of tags to concatenate. map wants to format tag names so it asks for a formatter prefix _ and a list of tag names. All we re missing is some polite phrases like please and may I and we can expand this analogy to familial relationships. Imperative kids tell their parents I m taking the car. Declarative kids politely ask May I borrow the car please . By communicating their desires instead of demands declarative kids give their parents more leeway to implement their requests. Pure functions and declarative programs in general are more flexible than their imperative cousins. Instead of demanding a calling order that is implicitly glued together with state variables declarative programs define relationships syntactically. This reduces the problem of refactoring from an implicit global problem of maintaining state transitions to an explicit local one of preserving syntactic relationships. Functional programs are easier to refactor. Second Task The second task introduces asymmetric output. The test case input file is chapter title Chapter with Epigraph title epigraph para Representation emphasis is emphasis the essence of programming. para attribution Fred Brooks attribution epigraph simplesect para Some Text para simplesect chapter 12 On Lisp Paul Graham p. 33. Copyright 2004 Robert Nagler All rights reserved nagler@ 156 The output file we expect is html body h1 Chapter with Epigraph h1 p Representation b is b the essence of programming. p div align right Fred Brooks div p Some Text p body html The XML .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.