News for hackers. Stuff that matters.
Re:Advice on learning Python efficiently by hardwaresofton on Thursday December 15, 2016 @08:26AM (#13184391)
Pretty good advice, along with some good pointers about what NOT to do when learning a languages (ex. reading some instructional book cover-to-cover, forgetting most of the stuff along the way).

I often suggest the read-a-chapter-write-a-program-based-on-it route, just to get the practice that is really important, and to solidify some intuition as to what the machine (whether interpreter or bare metal) is doing, and to make writing future programs easier.

Side note: While I definitely applaud the idea of trying to create a language that is geared towards beginners and good for learning on, I don't know if I can get behind recommending such a language that is still under development being suggested to beginners.

Then again, I'd consider recommending lisps to beginners (if not python), so maybe I'm not the most credible source

Re:Advice on learning Python efficiently by trymas on Thursday December 15, 2016 @08:50AM (#13184514)
> Side note: While I definitely applaud the idea of trying to create a language that is geared towards beginners and good for learning on, I don't know if I can get behind recommending such a language that is still under development being suggested to beginners.

I second this. Especially when python itself is very beginner friendly.

IMHO the best advice on learning a skill is just do some projects with it. I am not exactly sure, which should come first, the 1. or the 2. point made in the article.

Though I would dare to say the 2. point is more important.

By doing python projects first you familiarize with it and then if you are still on - you should read zen of python, pep8, etc..

Re:Advice on learning Python efficiently by eric_bullington on Thursday December 15, 2016 @10:04AM (#13185020)
I strongly agree. Dealing with a language in development is hard enough when you're an experienced programmer, I can't imagine trying to learn programming with an unstable language.
Re:Advice on learning Python efficiently by dwaynecrooks on Thursday December 15, 2016 @11:49AM (#13185933)
I tend to agree as well. The Pyret option is probably better done with a mentor by your side. If no mentor is available like they probably have in the Bootstrap (http://www.bootstrapworld.org/) program then Python is more than likely the better option. So I'd expect 99% of the people to stick with Python anyway which is fine.
Re:Advice on learning Python efficiently by jacobr1 on Thursday December 15, 2016 @09:59AM (#13184982)
Agreed - you need to experiential context to grok the concepts about best practices. Otherwise, it is just cargo-cultism. Most the great programmers I know learn by working on increasingly more complex projects and then deep-diving into the details whenever they come across something they don't know. They make this process move faster, not by doing tutorials and writing code from scratch (after the initial bootstrapping of learning a new language/framework), but by reading code from others, especially successful project. And again diving into to understand the WHY behind the implementation and this reinforce the choice and knowledge of the HOW.
Re:Advice on learning Python efficiently by praveer13 on Thursday December 15, 2016 @11:42AM (#13185868)
>By doing python projects first you familiarize with it and then if you are still on - you should read zen of python, pep8, etc..

Would you mind recommending some projects for a python beginner?

Re:Advice on learning Python efficiently by drcongo on Thursday December 15, 2016 @11:57AM (#13186010)
I find scratching one's own itches is always the best way to learn a new language. Solve a problem that you have.
Re:Advice on learning Python efficiently by HelloNurse on Friday December 16, 2016 @04:00AM (#13192002)
Problems are not all the same: choose one that stresses and challenges the language, to gain confidence in its strengths and practical expertise.

For example, I once tried to learn Haskell and I started from little exercises (https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems)... I got familiar with syntax and basic concepts, but I was dissatisfied both with the easy, abstract questions and with the simplistic, inefficient answers using basic standard library features that are more or less the same in any language. What was "real" Haskell code like? I expected dealing with serious libraries, memory management etc. would be uglier, more difficult and more cumbersome than exceptionally terse toy examples.

So I attempted something not merely useful and small, but with a well defined practical objective, depending on external standards, requiring production quality libraries and with performance challenges: converting the metadata dump from MAME (a nearly 200MB XML file) into an easy to use SQLite database.

The task was a good test of programming language productivity because, having already used ElementTree and APSW I was sure I could write it in Python quite easily. (And I did; a complete Python implementation, able to roundtrip data back to the XML format for testing purposes, took me less time than an aborted Haskell attempt that could parse a dumb document tree using a ridiculous amount of memory.)

This project allowed me to discover many things about Haskell that are not found in enthusiast-written tutorials: the mess of incompatible and undocumented libraries, the impracticality of basic language design decisions (text handling, lack of namespaces leading to name conflicts, etc.) and my profound disgust for the commonplace syntactic tricks.

Of course, a similar challenge for Python is likely to have a better outcome: learning the difference between good and really good libraries, finding a use for many language features, remembering useful idioms nd design patterns, etc.

Re:Advice on learning Python efficiently by bluedino on Thursday December 15, 2016 @11:56AM (#13186000)
You have the standard things like a calculator, card game (start with blackjack), anagram maker/solver...

With the web you can move to things like an address book, todo list, message board (regular or reddit/hn clone)...

Re:Advice on learning Python efficiently by bushin on Thursday December 15, 2016 @11:57AM (#13186013)
A web search engine.
Re:Advice on learning Python efficiently by tim333 on Thursday December 15, 2016 @05:14PM (#13189020)
In which case you may want to follow Udacity Com Sci 101 which includes building a search engine in python. (Free, video based https://www.udacity.com/course/intro-to-computer-science--cs...)
Re:Advice on learning Python efficiently by DigitalJack on Thursday December 15, 2016 @01:55PM (#13187095)
I get so frustrated with picking up a new language because they all seem to either be "from scratch, here is how to add two numbers" or cookbooks that assume too much knowledge.

the learnxinyminutes stuff is sometimes good. It'd be nice if there was a resource that taught languages from the perspective of already knowing another (any) language in that same family.

Show me definitions, modules, packages, namespacing, whatever, and get out of my way.

Re:Advice on learning Python efficiently by hardwaresofton on Friday December 16, 2016 @01:07AM (#13191411)
I agree with your gripes here -- absolutely agree there are a lot of languages that get it wrong.

I think there are some books that really get it right though, that show you how to do stuff, but also try to get out of your way. Some examples (in order of adherence to this point, to the best of my ability):

- Practical Common Lisp

- Learn You a Haskell For Great Good

- Clojure For The Brave and True

Re:Advice on learning Python efficiently by mirekrusin on Thursday December 15, 2016 @08:59AM (#13184562)
I read c# spec when it was in beta, going fast through it, skimming less informative parts, taking quick notes as bullet points in form of single statement or question. It was one of the best experiences, it put me in flow mode and I learned a lot in very short time. I used c# later professionally and never had problems. Great thing about language specs is that is very precise, without mistakes. The art is to read+skim+note it quite fast.
Re:Advice on learning Python efficiently by majewsky on Thursday December 15, 2016 @09:24AM (#13184697)
> Great thing about language specs is that is very precise, without mistakes.

I'd also add "concise" to the list of required traits for a good language spec. If you don't believe me that's important, go check out the C++ specification. IIRC it contains some 50 pages of rules on how to choose implementations of an overloaded function.

Re:Advice on learning Python efficiently by joatmon-snoo on Thursday December 15, 2016 @10:39AM (#13185277)
And if you're looking at modern C++, you also get to learn about lvalues, glvalues, xvalues, rvalues, and prvalues!
Re:Advice on learning Python efficiently by webmaven on Thursday December 15, 2016 @11:02AM (#13185480)
prvalues are the ones that return a promise about a system's future state which are commonly expected to prove false, right?
Re:Advice on learning Python efficiently by hardwaresofton on Friday December 16, 2016 @01:08AM (#13191416)
Was this not a direct (possibly knee-jerk) reaction to the ease with which you could shoot yourself in the foot, and undefined behavior C allows?
Re:Advice on learning Python efficiently by voltagex_ on Thursday December 15, 2016 @08:53AM (#13184531)
>I often suggest the read-a-chapter-write-a-program-based-on-it route

After doing some of https://javascript30.com/ I want the "30 day challenges" style tutorials in every language - I love it. I'm not sure how well it works for long term learning but it's really helped with my motivation.

Re:Advice on learning Python efficiently by drivers99 on Thursday December 15, 2016 @03:38PM (#13188149)
> I often suggest the read-a-chapter-write-a-program-based-on-it route

Learning Perl (the llama book) was great for that. At first, I would think that I understood just from reading the chapter, but doing the exercises at the end of each chapter made me actually learn it.

Re:Advice on learning Python efficiently by hardwaresofton on Friday December 16, 2016 @01:12AM (#13191431)
Absolutely agree! In a previous life, I was working at a company where perl was just about the most recent scripting language they were using (for better or for worse), and that book was an absolute godsend. Reading through Chapter 8 around was all I needed to be productive, and I've recommended the book ever since (especially while I was at that job)
Re:Advice on learning Python efficiently by sn9 on Friday December 16, 2016 @08:06PM (#13198403)
Allen Downey's Think Python is that book for Python, though focused more on teaching good programming habits than scripting.
Re:Advice on learning Python efficiently by hyperpallium on Thursday December 15, 2016 @06:43PM (#13189808)
Smalltalk was developed that way...

Also, MIT switched from scheme to python.

\tangent I agree with your approach of mixing theory and practice. So what's the best way to learn fluid simulation? It's discouraging spending so long on maths without the gratification of Something Actually Working.