News for hackers. Stuff that matters.
Re:Glamorize Your Problem Domain by ucarion on Monday March 27, 2023 @11:58AM (#35328323)
There are useful mental analogies between pedestrian line-of-business CRUD apps and a compilers. I don't disagree with that thesis at all. But I have seen it taken too far. Many engineers abstract and generalize business requirements until they find them interesting, and then implement against those requirements.

Programming languages are typically designed to be relatively simple and easy to compile. Line-of-business software tends to be as complicated and arbitrary as the organization requires. Trying too hard to make your mundane app into a compiler can push the software in a direction that makes it difficult to change in the messy ways you'll need to later on.

Note, for instance, that the author worked on a system that generates SDKs in multiple languages. This is pretty obviously a sort of compiler. Are your requirements really so fancy? Or are you making a CRUD app hooked up to a couple external integration APIs?

It's useful to see the analogies between one's domain and compilers, but see if you can't keep that analogy in your head and out of the code whenever possible.

Re:Glamorize Your Problem Domain by twitchard on Monday March 27, 2023 @01:02PM (#35329185)
Any stories to tell about compiler analogies being taken too far in web apps?
Re:Glamorize Your Problem Domain by mattgreenrocks on Monday March 27, 2023 @01:12PM (#35329341)
I dislike picking on people like this, but I feel like anything that might involve CS theory inevitably elicits this type of comment. I'm not sure what drives it, but I don't see how it helps, as it essentially amounts to, "don't write boneheaded code."

I don't think many people would argue with that. I'm just not sure what it is contributing to this discussion.

The number of people who know compilers well enough to know how to jam them somewhere inappropriate is probably...startingly low, too.

Re:Glamorize Your Problem Domain by ModernMech on Monday March 27, 2023 @02:45PM (#35330623)
> The number of people who know compilers well enough to know how to jam them somewhere inappropriate is probably...startingly low, too.

Agreed, I had a number of students complain to me in my programming languages class that I was focusing too much on compilers, and who would ever really need to write a compiler except compiler writers? They would rather I had taught them Go or Python. But I had to tell them, guys, compilers are awesome. There are so many uses! You can use them everywhere!

No one seems to want to :(

Re:Glamorize Your Problem Domain by ElectricalUnion on Monday March 27, 2023 @03:02PM (#35330860)
> The number of people who know compilers well enough to know how to jam them somewhere inappropriate is probably...startingly low, too.

Nah, (almost) everyone that don't have a clue what they're doing does this for every app, be it required or not; it's however called "Babel" or "Webpack" because "compiler" is "scary".

Re:Glamorize Your Problem Domain by marcosdumay on Monday March 27, 2023 @04:04PM (#35331678)
The discussion is really not about people using compilers on their build systems.
Re:Glamorize Your Problem Domain by ElectricalUnion on Wednesday March 29, 2023 @03:44PM (#35362306)
webpack is a very customizable compiler; my take is that once you're deep enough into --config (supposedly only required for non-trivial projects, in pratice, almost every JS project I saw requires extensive webpack mangling to work) you're building your own custom compiler with custom quirks for your project.