"If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea."
That's a lovely idea although I can't help noticing that I know of no shipbuilding companies based on the teaching of yearning while I do know of some that seem based on organising a workforce. I suspect that this is one of those ideas that while beautiful is far from being literally true.
How about "if you want your citizens to fund a space program, don't gather the workforce to build a spaceship but teach them to yearn for the vastness and potential of the void."
programming is already such an opaque concept before you learn it, kids entering the class won't even really know what programming is.
if you start with a single-minded focus on syntax, as most do, the kid's mental model of programming becomes "programming is done by entering premade code words that someone made up. if i want to do something, i need to find the premade code word that does that thing".
as opposed to, "programming is about blobs of information and what i do with them - changing their shape, organizing them, picking certain things from them, taking stuff away from them. if i want to solve a complicated problem, i won't start typing, i'll start thinking about how i'd make a machine that makes the blob i want. the best way to make a machine like that is usually out of smaller machines that live inside it. i'd figure out what the smallest machines i need are, and i'd make those, and then use those to make the bigger machines, until i'm done."
if kids were started with a functional, problem-solving oriented approach like that, you'd create very capable programmers much faster. this applies to introductory CS classes in college. i went into my first CS class knowing absolutely nothing about programming beyond CSS/HTML - i was a math / mech eng major at the time. i think it was the third class where they had us write a program in C that did some non-trivial dynamic allocation. they never told us things like what the heap or the stack are, or the concept of a memory leak, what happens if you dereference a null pointer, etc, etc. i never got that program to stop segfaulting. i came very close to failing that class and was told, because of that, i probably shouldn't continue with CS. i taught myself computer science instead and now i know that i'm not stupid or unsuited to programming - my introductory CS education was shit.
The commenter right above you expressed the same issue, and I wrote a longer reply there. But it's not that I don't think syntax is important, but I don't think we should pretend that the value in learning to code is learning the syntax. What I'm reacting to is "coding" programs that seem to eradicate any semblance of forcing kids to confront hard problems in favor of presenting them with trivial exercises for the sole purpose s of claiming "they can code."
I'm afraid I disagree. I programmed in a variety of languages in grad school (physics): C, C++, Fortran 77, Tcl, Perl, Matlab, Maple, Mathematica, IDL, Emacs LISP, etc. Not to mention the stuff I started on in high school.
When I switched my analysis to Python, I became so much more productive. And other science researchers I have known have echoed this sentiment. Even writing a C module to speed up my Python was pretty straightforward, if tedious.
Python had the fewest surprises. And debugging other people's Python is exponentially less annoying than debugging other people's Fortran or C. It's still my go-to language to get stuff done without fuss.
Yep, this was my point. I'm curious what makes Python seem so obviously clear to other people, but not to me. Maybe it's the OO approach. I had done a lot of Java, Smalltalk, and Ruby before I ever tried to approach Python. Maybe it's because Python's OO support feels (to me) bolted on compared to those other languages which are obviously OO from the bottom up, and I'm unwittingly trying to apply mental models I developed in those other languages to how I think about Python.
But Python is OO from the bottom up. Unlike Java, everything in Python is an object.
Perhaps your experience with objects in other languages has given you a different mental model for what an object is. I find Python objects to be more straightforward than in other languages, especially because classes are objects, too.
If it really is OO, then the global `len()` function and like explicitly declaring "self" in method declarations makes it _feel_ bolted on (to me). Why is `len()` special? I immediately question what other basic operations aren't methods, but global functions.
And as for method declaration, if you aren't satisfied with implicit self, I much prefer Go's choice of having you declare the self reference for methods before the method name, instead of in the argument spec list (which then doesn't match the calling list). Python's way makes it feel like the compiler writer couldn't be bothered to hide the OO implementation on the declaration side, but embraced it on the calling side.
Meh, I know these have been hashed over a thousand times here. Just some of the things that rub me the wrong way when I've tried to deal with Python.
Python is a multi-paradigm language in the sense that it does not explicitly force the programmer to write all code in a particular way. So, for example, Python does not forbid the existence of standalone functions, or the execution of functions without looking them up through a class of which they happen to be a member.
But given that it is inescapably true that every function call in Python is translated to a call of a method of an object, it's hard to argue that it isn't "really" OO.
Guido once explained further in an email to the mailing list. I've forgotten some of it, but the gist is that he didn't want anyone to accidentally create or override a .len() method to do something other than tell the number of elements in the container.
And... almost everything is a method. Even ``len(obj)`` is just sugar for ``obj.__len__()``.
There are a few functions in the C API to let you call things, depending on the type of thing and set of arguments you feel like providing, and they rely on the Python API to handle the calling for you. I imagine if you really wanted to, and knew enough about the structure and expectations of the Python object you were working with, you could "manually" call without going through one of those C API functions, but I don't know that I'd recommend trying it...
Oh my god, a png of a twitter featuring a png. What is this world we have created.
Anyways.. it's pretty damn interesting. When I read it, I seriously read the last sentence as "great green dragon" without thinking, then went back and saw that I actually read the words in the wrong order.
Oddly enough, a green great dragon makes me think there would be some distinct species of dragon called the "great dragon", that are sometimes green, whereas "great green dragon" makes me think of just a very large, green, run-of-the-mill dragon.
However, all of this seems to me entirely related to training, getting very very used to things being expressed in a certain way. I have no idea how it could relate to some "innate" idea of grammar, especially since, as others have pointed out, this rule and many others only hold for English. Any bilingual individual can tell straight away that these things are all about memory -- nothing "innate" about a bunch of arbitrary rules.
From the article: A report this past week from investment firm Sanford C. Bernstein, titled “The Silent Road to Serfdom: Why Passive Investing Is Worse than Marxism,”
"serfdom", "Marxism"... Let me guess: Libertarian Party propagandist.
Isn't active investing a zero sum game? Imagine a market with only two people and an average ROI of 7%. If then somebody has a 10% ROI through active investing then it follows that other one who also invests actively only gets a 4% ROI%.
With passive investing you invest in a stock because you think the company's value will grow in the future. They are building a new factory or entering a new market, etc... The added value will be represented by a higher stock price which you can sell to obtain your investment returns.
>The social function of active management, in a capitalist society, is that it seeks to direct capital to its most productive end, facilitating sustainable job creation and a rise in the aggregate standard of living.
What if an actively managed fund gives me a 10% return but a 4% fee and a passively managed fund gives me a 8% return but only a 1% fee? Wouldn't the passively managed fund be the most productive from the investors point of view?
The prevailing attitude is "I want to do biology, not computer science". I find it pretty frustrating. This is probably one of the last fields of science to be seriously computerized.
For scientific work, I find it worth the effort to compile from source using Intel compilers + MKL (or a compiler + math library that can optimize well for your particular hardware platform).