Live data from Hacker News

Make for hipsters

mattandre.ws

141–150 of 200 posts

Re: Make for hipsters

#141
post #100
post #58

Earlier quoted context omitted.

Unfortunately, many developers have a mortal fear of anything from before the year 2000. They've grown up with this tribal wisdom of unix and it's various tools being a beardy wilderness of byzantine hacks and toxic waste dumps. Meanwhile they'll merrily pile up a thousand node modules into a towering pillar of bad, just to run the equivalent of a shell one-liner, and call it a job well done.

> Unfortunately, many developers have a mortal fear of anything from before the year 2000. They've grown up with this tribal wisdom of unix and it's various tools being a beardy wilderness of byzantine hacks and toxic waste dumps. Some stuff is genuinely awful. - Sendmail was ubiquitous, but it was, according to anyone who'd had either fleeting or deep experience with it, a beardy wilderness of byzantine hacks and to…

I like SysV-style init systems. I also don't mind RPM .spec files. They've always let me get the job done.

Re: Make for hipsters

#142
post #132

I like to use makefiles for managing docker containers / images. For my needs it's a more practical and flexible solution than other docker orchestration / management tools I've tried. A few things I've learned that might be useful: * (cd /path/to/something && make goal) * You can use .DEFAULT_GOAL := goal_name to set the default target run by 'make' with no target name specified. * Adding .SILENT will suppress make…

> You can use .DEFAULT_GOAL := goal_name to set the default target run by 'make' with no target name specified.

I had always, perhaps erroneously, thought that the very first goal in the file was the default one.

Re: Make for hipsters

#143
post #10

Do so many people who go on this site not know how to make makefiles? Also why is it for hipsters? Or is the article for hipsters? Why does the author call his own published notes factually inaccurate? Why is it hacky to use a makefile? Is this all a big ruse?

I mostly do web development, and I went for quite a few years without having any more of a build tool than a shell script or two to minify files and the like. It's only been since I started using React that I went to a Gulp setup.

And really, my experience with Gulp had been the opposite of the snide "hipster" dismissals. I wish I could find clean examples via googling that weren't useless due to APIs completely changing, or due to using a library that's been deprecated in favor of another library that's been deprecated...because, man, who still uses a library after a year? :P

Somehow, though, I don't see make being a great replacement for my purposes. At the very least, it's not going to be any faster running Babel over a pile of files.

Re: Make for hipsters

#144
post #66

The single biggest piece of advice I can give for Make is to make sure your text editor uses real tabs in Makefiles. My personal preference for everything is spaces (mostly a habit learned from Python's PEP 8), but Make doesn't honour spaces for indentation - only tabs. Despite being an obvious usability hole, this has never been fixed. Exacerbating the issue is the poor error message given upon encountering a space-…

That's an error message from GNU Make. I'm not sure what version of GNU Make you're using, because GNU Make has emitted the following since 1998: Makefile:2: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. See 2c64fb221a265f9e7fc93374906b1e7540377561: 1998-09-04 Paul D. Smith * read.c (read_makefile): If we hit the "missing separator" error, check for the common case of 8 spaces instead of a TAB…

I have inquired if they would like a patch for this: https://savannah.gnu.org/bugs/index.php?48276

Thanks for mentioning, I had no idea this special case was here!

Re: Make for hipsters

#145

I prefer a help rule in the Makefile, like so: help: @grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' Assuming that the trimmed Makefile read: build: ## Build the binary clean: ## Clean the binary and intermediate files distclean: clean ## Clean dependencies, intermediate files and binary deps: ## Install dependencies all: deps b…

This is great. I think `help` commands are fantastic things to add to projects right from the start. It really helps the next person to get up to speed.

Re: Make for hipsters

#146
post #58

Earlier quoted context omitted.

Unfortunately, many developers have a mortal fear of anything from before the year 2000. They've grown up with this tribal wisdom of unix and it's various tools being a beardy wilderness of byzantine hacks and toxic waste dumps. Meanwhile they'll merrily pile up a thousand node modules into a towering pillar of bad, just to run the equivalent of a shell one-liner, and call it a job well done.

Please show me the makefile for your Javascript project that will run perfectly on Linux, Windows and Mac with little to no setup. I doubt it exists. Until then, I'll stick with my Node.js build tools, thank you very much . Honestly, if anyone has an example of a makefile that can bundle my scripts, insert bundle links into my HTML which is compiled from jade and nunjucks templates, minify the JS, CSS and HTML and op…

I can't even get `npm install` to run perfectly on my mac. It _always_ fails and needs to be re-run a few times to get everything installed.

Anyway, the point is, everyone likes the smell of their own farts. But, they still stink.

Re: Make for hipsters

#147
post #58

Earlier quoted context omitted.

Unfortunately, many developers have a mortal fear of anything from before the year 2000. They've grown up with this tribal wisdom of unix and it's various tools being a beardy wilderness of byzantine hacks and toxic waste dumps. Meanwhile they'll merrily pile up a thousand node modules into a towering pillar of bad, just to run the equivalent of a shell one-liner, and call it a job well done.

I think it also has to do with the stackoverflow effect. Tools that gain traction today are those that can be learned incrementally by doing a google search and copy pasting a solution, one problem at a time. Out are all those systems that have an underlying theory to them that has to be mastered first. As pointed out elsewhere, there is a perfectly good manual for make[1] that you can read. My theory is that it has…

this is an interesting thought. the Linux Documentation Project was full of full length books on every aspect of administering a Linux system. I printed out many of them, put them in a spiral binder and they lived on my bookshelf next to my O'Riely collection.

Now, I've only got one book on my desk and it's more of a coffee-table thing about html and css

Re: Make for hipsters

#148
post #100

Earlier quoted context omitted.

> Unfortunately, many developers have a mortal fear of anything from before the year 2000. They've grown up with this tribal wisdom of unix and it's various tools being a beardy wilderness of byzantine hacks and toxic waste dumps. Some stuff is genuinely awful. - Sendmail was ubiquitous, but it was, according to anyone who'd had either fleeting or deep experience with it, a beardy wilderness of byzantine hacks and to…

> If you don't like putting small modules together to achieve a task, I have some news for you about shell and Unix... No, really. The "UNIX way" is not just "Use tons of small things to do a simple task, complexity of managing them be damned". It is indeed "do one thing and do it well", but that "thing" is usually high level enough and ready to go -- not something you need a whole stack of dependencies, configuratio…

Totally agreed, that's why most npm modules are focused on specific tasks, and we use github and npm to track how active projects are before installing them.

It really seems like you don't do a lot of node - which is fine obviously, but you seem to have very strong opinions about it.

Re: Make for hipsters

#149

I prefer a help rule in the Makefile, like so: help: @grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' Assuming that the trimmed Makefile read: build: ## Build the binary clean: ## Clean the binary and intermediate files distclean: clean ## Clean dependencies, intermediate files and binary deps: ## Install dependencies all: deps b…

Lovely! I'm going to start using this in all my Makefiles.

Seriously, thanks. You solved a problem I had.

Re: Make for hipsters

#150

I prefer a help rule in the Makefile, like so: help: @grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' Assuming that the trimmed Makefile read: build: ## Build the binary clean: ## Clean the binary and intermediate files distclean: clean ## Clean dependencies, intermediate files and binary deps: ## Install dependencies all: deps b…

First off I wanted to say this is amazing and I'm going to roll it into my current and future Makefiles.

Second, if you're on OS X the `-P` flag is going to have problems [1]. Works fine if you just replace `grep -P` with something like `ack`!

[1] http://stackoverflow.com/q/16658333/169153

Post reply on HN