I remember thinking when I first read through pg's essays a few years back and again now that you can do this in declarative languages as well using functions.
For example, my programs often looks something like this:
main(){
var data = getData();
pushData(data);
}
function getData(){
var data = fetchDataFromSource();
var errors = validateData(data);
if(errors != null)
//handle errors
return processData(data);
}
function fetchDataFromSource(){
...
}
function validateData(var data){
...
}
...
Could anyone explain why functional languages are better for this? It seems to me this is the same as "building the language up to your program".