News for hackers. Stuff that matters.
Re:The paradigms of programming by vram22 on Monday January 29, 2018 @06:45PM (#16261658)
>How about a language that lets you put your procedures in tables?

How about Python? It lets you put your procedures in tables - dispatch tables, that is:

def eat(): print "eating"; def walk(): print "walking"

t = {"eat": eat, "walk": walk}

# now call the reqd. function via string s read from somewhere: keyboard, file, etc. ...

t[s]() # error handling omitted

Kidding apart:

>Dividing it up into sub-functions/classes scatters the logic

What is the issue with scattering the logic? if you break up your problem/solution into different logical units, with good judgement as to the points of breakup (i.e. coupling, cohesion, etc.), then what is the issue? Not clear.

There are no comments on this comment yet.