Earlier quoted context omitted.
I hate makefiles. That said, I wholeheartedly agree with the comment. It's sad that something so central to a project and so useful and important to so many people seems like it hasn't advanced ... ever. Developers generally do the minimum with Makefiles and get out. They are similar to 1040 forms in popularity. I've always had a dream of a redesigned "make" system... with import statements, object oriented rules, cl…
> It's awesome that something so popular is so well engineered that it doesn't need changes. There, fixed it for you. In particular, I'm glad that the OO cancer hasn't spread to something as basic as a build system.
Ask HN: What overlooked class of tools should a self-taught programmer look into
391–400 of 416 posts
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#392Earlier quoted context omitted.
> The big downside of Make, alas, is Windows compatibility. GNU Make works fine on Windows. The sources come with a vcproj to build it natively, or you get it from ezwinports. At my dayjob, we have a pretty complicated build with GNU Make for cross-compiling our application to Arm and PowerPC, and it works on Windows, even with special Guile scripts to reduce the number of shell calls which are extremely slow on Wind…
Most popular folder on Windows is "My documents", it has a space at least in some Windows versions. Make doesn't support such paths: http://savannah.gnu.org/bugs/?712 VBScript works better on Windows, IMO. Also works out of the box on all Windows versions since at least 2000 (on Win9x it was shipped with IE).
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#393Earlier quoted context omitted.
These days it might be better to just learn python. It's cleaner and scales better to complex code. And it's ons most system modern systems available out of the box where shells are available too. Shells are still good for simple oneliners, and knoting multiple processes together, but text-processing involves so many different commands, each with their own quirks, that a consistent simple language is IMHO superiour.
Honestly this applies to Ruby & Javascript/Typescript as well and not just Python. I really don't see the value of learning shell scripting anymore when the newer languages are just was easy to learn, terse, and you can adapt better to changing conditions when needed with libraries.
Inevitably someone will read these arguments and think “those are just bad programmers”, but your point was that you “don't see the value of learning shell scripting”. The value is in not spewing absurd code like that. Shell commands are fast and efficient. There isn’t an emphasis on libraries because instead you use tools. Is `grep` not enough? Try `the silver searcher`[1] or `ripgrep`[2].
Are shell scripts the best instrument for every job? No, but no tool is.
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#394I highly recommend learning PROLOG & understanding how to write your own simple planner system. The hairiest real problems are hairy because they're best suited to a declarative style (and programs written declaratively can be made much more efficient through more clever solvers -- given naive code, a clever solver has a much bigger efficiency boost over a dumb solver than an optimizing compiler does over a non-optim…
I've never used Prolog in the 15 years since I learned it in college. It's an interesting take on programming, for sure, and I appreciated the mind-expanding exercise, but hasn't helped me in my career at all. Totally agree on awk. I use it almost every day for quick little one-liners. Big time saver. Also agree on state machines, because from there it is a short hop to understanding formal grammars and the foundatio…
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#395Earlier quoted context omitted.
Forgive me, if I'm being dense, but doesn't either of these cases depend on how the composed objects are being used? In your functional example A is an input to B (or vice versa?), how do you propose testing one of the modules without first instantiating the other one?
I'll give you two examples. One functional and the other OOP. Both programs aim to simulate driving given an input of 10 energy units to find the final output energy. #oop engine = Engine(10) car = Car(engine) car.drive() #result 8 class Car: def __init__(self, engine): self.engine = engine def ignite(self): self.engine.energy =- 1 def run(self): self.engine.energy =- 1 def drive(self): self.ignite() self.run() retur…
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#396Earlier quoted context omitted.
I'll give you two examples. One functional and the other OOP. Both programs aim to simulate driving given an input of 10 energy units to find the final output energy. #oop engine = Engine(10) car = Car(engine) car.drive() #result 8 class Car: def __init__(self, engine): self.engine = engine def ignite(self): self.engine.energy =- 1 def run(self): self.engine.energy =- 1 def drive(self): self.ignite() self.run() retur…
Thank you so much for a concrete example. I need to think about this some more. Clearly the code make sense, but in a wider context, can you have a banana without a jungle? I'm dabbling with some functional programming but I definitely have more experience with oop, so what you're saying is difficult for me to grasp, but the benefits are hard to ignore.
Smalltalk is possibly the only OOP language that lets objects be compose-able and modular. Check out Pharo if you're interested. If you learn smalltalk well enough, you could apply its principles to traditional OOP languages and gain the modularity benefits.
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#397Earlier quoted context omitted.
Your argument appears to be, in TL;DR form: OOP and dependencies are bad and wrong, you must use Functional Programming or you will be wrong. Isn't that a little extreme?
No. You are putting words in my mouth and accusing me of being extreme. I am NOT promoting one paradigm over the other. TLDR? I hope you read my stuff. I find it rude if someone just comments with a one liner and summarizes everything I said into a catchphrase that is a perversion of the truth. I feel like a presidential candidate. Anyway, this is what I am saying: If you use functional programming your code will be…
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#398Earlier quoted context omitted.
Most popular folder on Windows is "My documents", it has a space at least in some Windows versions. Make doesn't support such paths: http://savannah.gnu.org/bugs/?712 VBScript works better on Windows, IMO. Also works out of the box on all Windows versions since at least 2000 (on Win9x it was shipped with IE).
You wouldn't install Visual Studio 6 to XP easily; since it wasn't support spaces in "Program Files" directory :)
I’ve just installed Visual C++ 6.0 Professional on a WinXP VmWare machine. Took less than a minute, BTW — modern SSDs are awesome. The default installation path under program files also contain spaces, it’s "C:\Program Files\Microsoft Visual Studio\VC98"
BTW, they have a bug even on the very first welcome screen: http://const.me/tmp/vc6.png
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#399The premise that self-taught programmers necessarily have core holes in their knowledge and skills that would have been filled if they had a CS degree is entirely false. Start with the example you gave of messaging middleware. There are many BS CS curricula that do not address this at all. Also he mentioned that he had already learned about named pipes on his own. For many applications, named pipes could be a perfect…
We all, generally, specialize. I have never worked with 'big data', implemented any part of a commercial web site, or worked on HPC(just to give a few examples). What may be useful to one may be useless to another.
Definitely think about Software Engineering. Maintainability, debuggability, extensibility. Don't get lost in stupid details. Don't nitpick the coding style or try to optimize code that isn't currently meeting the requirements(if there are requirements, and if there aren't you should try to define them).
Re: Ask HN: What overlooked class of tools should a self-taught programmer look into
#400Earlier quoted context omitted.
Honestly this applies to Ruby & Javascript/Typescript as well and not just Python. I really don't see the value of learning shell scripting anymore when the newer languages are just was easy to learn, terse, and you can adapt better to changing conditions when needed with libraries.
I often find multi-line Python scripts with `import os` and others that could be a fraction in size (and just as clear) in bash. Even more ridiculous are the times I find a node script (published to npm, even) that is little more than a wrapper on a shell script. Inevitably someone will read these arguments and think “those are just bad programmers”, but your point was that you “don't see the value of learning shell…
My point is that the cost for learning and using shell scripts is just too high compared to just using a modern language that's just as terse and a lot more powerful and flexible. Context switching from one language to another isn't free either.
imo the only time shell scripting was practical was when the only major programming languages were C, C++, and Java. imo even Perl5 is more practical than shell scripting.
Also I doubt that the python program you mentioned was that much bigger than a shell script