Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

341–350 of 525 posts

Re: The Makefile I use with JavaScript projects

#341

Earlier quoted context omitted.

Demanding the support of spaces in filenames significantly complicates code as simple space delimination no longer works and other delimination schemes are much more error prone -- forgetting balancing quotes, any one? While you are allowing spaces, you probabaly are allowing all possible code points or maybe even a null byte? Thinking about it gives me headaches. I hate hearing people using 21st century or modern as…

> And there are solutions. One solution, from those who don't code, seems to demand ("developers", paid or not) that every tool that deal with files should handle this additional complexity, regardless of their context and what they think. Users expect computers to work in a non-surprising ways. It isn't natural to use dashes or underscore in file names. Training users to be afraid of spaces is just teaching them one…

Windows land also had https://en.m.wikipedia.org/wiki/8.3_filename which was never confusing.

Re: The Makefile I use with JavaScript projects

#342

Earlier quoted context omitted.

>some smart people fucked it up This does seem to happen in our industry over and over, another example is the way we turn every small, well designed language into Java.

You clearly were not there at the start. Java was a perfectly nice, well designed language. Then some other people fucked it up...

That's true, but I guess only after Java people started to notice this effect.

I still remember how Java was hailed as a perfect replacement for C++ as the language of choice when writing applications - it truly was.

Today though I was faced with a class name that was 46 characters long. There's a reason why "Fizz Buzz Enterprise Edition" is written in Java.

Re: The Makefile I use with JavaScript projects

#343

I used make heavily in the 80s and 90s, but haven't much since then. Recently I started a project that had source files getting processed into PDF files, for use by humans. Since this is the 21st century, those files have spaces in their names. At a certain point, I realized that I should be managing this processing somehow, so I thought of using a simple Makefile. A little searching reveals that the consensus on usi…

Perhaps you just chose the wrong tool for the job. Just because you are able to do similar things with make, doesn't mean it is has to be suited to your chosen use case. It's a tool that was created with a specific purpose in mind, with specific constraints, and it works fine for thousands (I assume) of people every day. You can't blame it for not being a general-purpose programming language. Make isn't beyond building other tools that you can write yourself - and use in the very same makefiles - to assist in handling cases like this, however.

Re: The Makefile I use with JavaScript projects

#344

I used make heavily in the 80s and 90s, but haven't much since then. Recently I started a project that had source files getting processed into PDF files, for use by humans. Since this is the 21st century, those files have spaces in their names. At a certain point, I realized that I should be managing this processing somehow, so I thought of using a simple Makefile. A little searching reveals that the consensus on usi…

Demanding the support of spaces in filenames significantly complicates code as simple space delimination no longer works and other delimination schemes are much more error prone -- forgetting balancing quotes, any one? While you are allowing spaces, you probabaly are allowing all possible code points or maybe even a null byte? Thinking about it gives me headaches. I hate hearing people using 21st century or modern as…

Nothing an intake script and a little gsub() can't handle

Re: The Makefile I use with JavaScript projects

#345

I'm not a web dev, but this article has uncovered yet another thing in the js ecosystem that just seems crazy to me. This makefile snippet: lib/index.js: src/index.js mkdir -p $(dir $@) babel $ The source and the output are both called index.js? Why, God, WHY???

Because babel compiles javascript to javascript, so you'd expect the input to be a javascript file and the output to be a javascript file.

Of course that sentence contains it's own level of craziness, but the problem does not lie in the build step.

Re: The Makefile I use with JavaScript projects

#346

Earlier quoted context omitted.

> it has trained a crop of computer users that are afraid of command lines and with an attitude of anything beneath the GUI interface is owned by and of someone else's problem. There is nothing beneath the Windows UI interface. The GUI is the primary subsystem of Windows, the command line is a separate subsystem. Windows has traditionally been built up around the Win32 API, which is GUI first. It is of course possibl…

> There is nothing beneath the Windows UI interface. To clarify, beneath the GUI interface is the actual code that implements that interface. > Something working so well that it becomes an appliance isn't a bad thing. Not at all. I don't attempt to call or think my phone as an computer. Window's users, on the other hand, still call their PC computers. I guess that is ok if computers are appliances. It is just that th…

Those PC-as-appliance people are better served in the mobile space and it would be best if they left us and our computers alone

Re: The Makefile I use with JavaScript projects

#347

I started my career with C++ development and never used a direct makefile in any of my projects. When I write C/C++, I use CMake. My current job has me programming in Go where people seem to love makefiles, but I consistently find bugs in the implementation (usually has too many phony targets, etc.), Why don't people use makefile generators outside of the C/C++ community?

I don't use CMake for embedded systems because the syntax and options are even more obtuse for what I need to do with it. When I get down to it, every make-based build system I've ever used boils down to using the macro language to generate all the targets, and then building your output board image by dependencies. But it's the details of how to do this that vary widely depending on your application for the board. CM…

It sounds like you are looking for something like Yocto/OE, which you can bake pretty much any build script into, cross compile and deploy.

What exactly are you looking for with regards to deployment, and what tool do use, instead of CMake, to give you that ability?

Re: The Makefile I use with JavaScript projects

#348

Earlier quoted context omitted.

Your tools support filenames with tabs? With any unicode char? A real world possibility.

works in bash: > touch "with tab"

Exactly as easy as without tabs. Now do that the whole day, sometimes with tabs, sometimes without.

Re: The Makefile I use with JavaScript projects

#349

Earlier quoted context omitted.

What does the merit of spaces in file names matter? You still will need to deal with files with spaces in the real world. If your tooling doesn't support it, it's a non-starter for many.

Your tools support filenames with tabs? With any unicode char? A real world possibility.

Every project I develop is unit tested with strings containing invalid unicode text, containing null bytes, and other random stuff.

If a user can’t paste any byte sequence, and expect it to work, then the tool is broken. I handle these cases.

Re: The Makefile I use with JavaScript projects

#350

Earlier quoted context omitted.

What is the build tool used in the javascript world this week? Broccoli? Grunt? Gulp? Talp? Just dealing with breaking changes in any one of those is a full time job!

Pro-tip: you don’t have to switch tools the minute that something new comes out.

You do, since different communities use different build tools. And they even switch tools, for the new kid on the block.
Post reply on HN