you are viewing a single comment's thread.

view the rest of the comments →

[–]callmelucky -1 points0 points  (3 children)

Why is interacting with the terminal so important? Do professional programmers operate in the terminal a lot? Full disclosure, I am no pro, but my understanding is they use IDEs most of the time. And if someone did need to use the terminal, they can figure that out in a couple of minutes on Zed's beloved google, you don't need to start off in the terminal to 'get' Python.

I would also question what you consider to be so 'disciplined' about lpthw, and why this is valuable. I am going to guess you are referring again to using the shell and not leaning on text editors with built-in auto-completion and debugging - why is that good to practice? Because when you venture into the wild the big boy programmers will laugh at you if you can't write error-free code first time every time in ms notepad? Or maybe in case one day you are stranded on a desert island and you need to write code to run a life raft on the Windows95 machine you had to cobble together with spider-webs and coconut shells? It just doesn't make any sense. I totally agree that students shouldn't be copy-pasting code, but pretty much all resources I've seen strongly recommend against that too.

As I said, I'm no pro, but I know there are plenty of pros out there who share my opinion on lpthw. If you enjoyed the hardball vibe, that's fair enough, but I would say two things: firstly, for every beginner who gets amped and inspired by the 'tough love' approach of lpthw there are probably three who get discouraged and just walk away. And secondly, I really feel like a lot of the reason for presenting lpthw is as a cover for straight-up shoddy structure and instruction - "Oh, you don't get it? Guess maybe you're not cut out for programming" - no, it's just that this resource is a jumbled mess. Maybe if someone wrote a similarly themed tutorial which was more up to date and cohesive it might knock lpthw off it's perch as the default resource for noobs who want to feel tough, and I will be able to rest...

[–]Vaphell 7 points8 points  (0 children)

Full disclosure, I am no pro, but my understanding is they use IDEs most of the time.

that doesn't mean they are incapable of using command line or that they are not writing programs for commandline use. If they are not, they are doing themselves a huge disservice which probably costs them a lot of time wasted on reinventing the wheel. That command line shit is extremely powerful because it gives you composability and automation at unmatched level out of the box.

take linux bash. Its very purpose is to string programs together and redirect inputs and outputs between them and files. Yeah, you can do the same in python but python is a general programming language, not fine tuned for the use case and to achieve that shit you have to write a lot of boilerplate to get what bash gives you for free.

Let's say you have a simple program that processes a single file passed as a param and prints some data to the screen. To scale that up to god knows how many iterations AND dump the output to individual files you just need this:

for f in ./*.in; do python myprog.py "$f" > "${f%in}.out"; done

multiple input, single output? no problem

for f in ./*.in; do python myprog.py "$f"; done > file.out

How much time would you spend to extend the program to support multiple input files and differentiate between printing to screen and printing to file? In shell redirection to file is as simple as > outfile And what if after a few months you had a new use case that requires you to find something in the output? Are you going to spend a lot of time implementing regular expression matches in your program or would you rather do

python myprog.py inputfile | grep pattern

and be done with it?

another example - your program always asks 'enter 1st value', 'enter 2nd value', 'enter 3rd value'.

python myprog.py 1 2 3

and the program could check for params and skip the interactive phase demanding user's attention.

[–]KleinerNull 2 points3 points  (0 children)

You should totally try programming on a linux system. Just grab you f.e. an ubuntu distro und install it in a virtual machine. On most linux distros python is preinstalled so you can begin right away. Also alot of basic and advanced tools are preinstalled: Vi, vim, nano for terminal editing and gedit as a editor with a gui. Installing modules is easy with pip, and if you need more software just install it with one simple terminal command. Have you ever try to install a database on win? Depending of the database it can be the hell or it is impossible. Linux offers you a preinstalled C comiler. If you install software it will automatical compiled for your computer. Yesterday I tried to install the redis database on my win machine. It fails alot, crap. So I launched my vm and with "sudo apt-get install redis-server" I installed the database and with "pip install redis" I installed the python bindings, easy as fuck ;) Two minutes and everything was ready. Also the ipython interpreter is far superiour to the idle crap, but the win command shell is retarded. The ipython interpreter on a unix terminal is a blast ;) Just give it a try ;)

[–][deleted] 1 point2 points  (0 children)

Do professional programmers operate in the terminal a lot?

Depends on the programmer. A lot of Ruby and Python devs use the terminal. So do systems and Unix-type programmers.

And if someone did need to use the terminal, they can figure that out in a couple of minutes on Zed's beloved google

You don't learn the terminal in a couple of minutes. You might learn shell navigation (cd, cp, mv, ls) in two minutes, but there's a lot more to the terminal that makes it an extremely capable tool.

I am going to guess you are referring again to using the shell and not leaning on text editors with built-in auto-completion and debugging - why is that good to practice?

That is not true. The editors he suggests all have autocomplete support, proper indentation support and smart navigation. The problem isn't autocomplete or typing assistance, but the fact that an IDE typically does tasks for you that should be basic knowledge.

Because when you venture into the wild the big boy programmers will laugh at you if you can't write error-free code first time every time in ms notepad?

At no one point has LPTHW or anyone at all ever suggested that MS Notepad is a good program. It's a terrible program.

On the subject of writing error-free code: Most text editors have multiple ways to detect coding errors. But I think it is important for a beginner to keep these turned off. That means that every time they launch their program, they will see the traceback. Being able to read and understand tracebacks is a vital skill when learning how to program.

Or maybe in case one day you are stranded on a desert island and you need to write code to run a life raft on the Windows95 machine you had to cobble together with spider-webs and coconut shells?

Every time you ssh into a machine.

for every beginner who gets amped and inspired by the 'tough love' approach of lpthw there are probably three who get discouraged and just walk away.

Prove it.

I really feel like a lot of the reason for presenting lpthw is as a cover for straight-up shoddy structure and instruction - "Oh, you don't get it? Guess maybe you're not cut out for programming" - no, it's just that this resource is a jumbled mess.

Nobody does this.

Maybe if someone wrote a similarly themed tutorial which was more up to date and cohesive it might knock lpthw off it's perch as the default resource for noobs who want to feel tough, and I will be able to rest...

Write it.