0

As the question suggests, if a program should be written in a purely imperative style (even if the programming language is an amalgamated language like PHP or Python which support other paradigms like OOP), should the program incooperate built in language functions, like PHP's explode(); function? Or, does the program no longer become purely imperative?

To give some context here, I've been asked to create a purely imperative program. I have free reign over the language, I'll probably choose Python. Am I breaking the rules of the imperative paradigm by using built in language functions though?

Thanks

Liam Fell
  • 1,308
  • 3
  • 21
  • 39
  • Good question - where to you draw the line? You definitely cannot use imported modules, because that would be drifting too far from imperative programming. On the other hand, keywords are obviously OK. Built-in functions lie somewhere in between. I would say it's ok to use them, but why won't you ask whoever tasked you with this for clarification? – postoronnim Dec 09 '16 at 23:13
  • @postoronnim Unfortunately the client is unavailable until January now. I'm struggling to see a reason why using in built language functions would pose an issue though? – Liam Fell Dec 09 '16 at 23:24
  • Maybe your client wants this script to be entirely backward and forward compatible and last forever - in case some functions were/will be deprecated? Other than purely academic interest, the only reason I can think of. – postoronnim Dec 09 '16 at 23:30
  • @postoronnim forward comparability makes sense actually, I was probably subconsciously avoiding that conclusion because it will entail much more work. Thanks – Liam Fell Dec 09 '16 at 23:49
  • Trick question - whatever you do with a client who throws ridiculous arbitrary limitations at you is going to be wrong, largely because I doubt _they_ actually understand what they're asking for. A sensible person would assume that they're simply asking for "not object-oriented" (or functional or logical or any other 'advanced' paradigms. A reasonable person would use functions because that's been the standard way of writing code for the last 40+ years but reasonable people don't put arbitrary requirements like this on code without a proper justification to help you understand what they want. – Sean McSomething Dec 10 '16 at 00:33

0 Answers0