Types dont make things more complicated. Most languages have types and I prefer dealing with them explicitely rather than letting an interpreter do random coercion like Javascript.
Types lead to cleaner programming,instead of shoving random stuffs into an untyped list,a dev has to think about data structures.
Furthermore,as a non native english speaker,I dont find python more readable than staticaly typed languages like C# or Java.Especially when a codebase grows larger. I wish python was statically typed.
You're more than welcome to not think about what types you put into a structure/list. You'll quickly learn how to use that list/structure without hand-holding. For 90% of the problems out there, you don't need anything other than the basic data structures, and they're pretty straightforward to use without having to think about types.
Note. Please don't confuse Javascript's weak-typing with Python's typing, as Python is strongly-typed.
Once you've learned to think about types -- as most introductory courses, even those taught in dynamically typed languages, will teach you -- you can do that just fine in a language that doesn't put a gun to your head and force you to.
(And you can do so in ways that most statically-typed languages have too limited a type system to let you do, too.)
mapM_ putStrLn ["hat", "dog", "cat"]
I'd say the above is pretty simple if explained after: putStrLn "hello world"
You don't really have to go into Monads for this to be understood/used. You can just leave it at "you use functions ending with an M if they do something like print out to the screen or get stuff from a web page".The second piece is interesting: Is something of the sort "<mapfn> <printfn> <list>" easier to explain to someone who's new to programming than "<foreach> <print>"? I've always thought the latter was easier to understand, but I'm curious which one someone who has no previous programming experience would grasp more immediately.
The reason being that "<mapfn> <somefn> <list>" is more declarative, whereas the foreach loop is ambiguous. Something we often take for granted is how hard it was at first to come up with what exactly we need to do or mutate inside that loop to build the right result.
If nothing else, there is interesting discussion to be had ;)
repeat print ["foo"; "bar"; "etc"]
print(word) means it's even easier for grandma to understand!
String[] word_list = {"hat", "dog", "cat"};
for(String a: word_list)
{
System.out.println(a);
}
extra brackets but pretty identical asList("hat", "dog", "cat").forEach(System.out::println)
I could show this to my 80 year old grandmother and have her understand what it does with minimal help on my part.
The same example in Java isn't extremely hard to understand, but it definitely is a decent jump in complexity from the almost plain English syntax of Python. EDIT: Forgot about Java's foreach operator, but even so with java you then have to explain what String[] means and the keyword "in" makes for an easier read than (String string: strings) and System.out.println vs print