4 ms·
Having been in the industry for literally decades, I can’t remember ever having reason to write a parser (except for basic CSV type data or web scraping) in rea
by lazide 4y ago
Having been in the industry for literally decades, I can’t remember ever having reason to write a parser (except for basic CSV type data or web scraping) in real life. shrug
I still know how to do it, but I’d have to really stop and ask myself why I thought it was a good idea first. Because it probably wouldn’t be.
- justinlloyd 4y agoHaving been in the industry literally decades I have worked on three compilers, two assemblers, a couple of DSLs (before we had some of the newer, fancier tools), a few linkers, a couple of tools that needed to figure out dependencies for assembling a build, a couple of databases and a number of video games that specifically required a recursive descent tree walking algorithm. I consider this class of algorithms to be essential alogrithms in the areas where I have worked, but I also know there are algorithms in use other areas of software development that I have absolutely no practical use for, even though, to reiterate, I have literally been in software for decades. Just because an algorithm is of no use to me, doesn't mean it is no use to you. And vice versa.
- Jensson 4y agoI think you get what you look after. If you don't feel you want to try to push the boundaries of computing and instead prefer working with people then there are way more opportunities there, you don't even have to be good as long as you can connect clients to databases people will pay you. However to me that isn't why I got into programming, that sort of job isn't anything like the jobs I've had, and it is a bit sad to see people in those jobs drowning out most other opinions about programming. Conversely if you love algorithms and are sufficiently good at them then you can spend your entire career with that and never ever talk to non-technical people. Some people here thinks those jobs basically don't exist, but they do exist and are really important and well paid. And once you start working there you can just continue forever since there are so few who have experience working with those. Like, maybe Google asks algorithm questions since they want more people to improve their algorithms? I know they had low hanging fruit everywhere, they just lacked people who were competent enough at algorithms to solve them, their hiring bar is way too low to solve their hard problems. But they can't really raise it either, there aren't enough people that could pass them then.
- nowherebeen 4y ago> Conversely if you love algorithms and are sufficiently good at them then you can spend your entire career with that and never ever talk to non-technical people. I think there are two types of programmers. Ones that are like you that like algorithms for algorithms sake. And the other that like to solve real world problems. I got into software development because I want to solve problems for people. And not all of us likes algo. We prefer to learn stuff that we do use day to day because that has direct impact. For example, I just spent two months understanding functional programming. I use it in my code almost everyday, but it would be worthless in an interview where you are judge by your algo understanding. It’s frustrating when you realize how this standard is forced on every technical role, on companies that don’t even need algo experts because they are too small.
- tptacek 4y agoI've never written a parser because I love parsing. I actually kind of hate it, and have always been baffled by the people who nerd out on it. But, like, when I'm working on a problem that needs a parser, I'm glad I can bang one out! Like I said elsewhere: that's happened a bunch of times in my career.
- setr 4y agoThere’s another aspect of this that the knowledge and comfort of being able to put together a parser properly means you’re more likely to identify places where it would be useful, and consider it worth the trouble to do so. That is, to one without a hammer, nothing looks like a nail.
- nowherebeen 4y ago> That is, to one without a hammer, nothing looks like a nail. They irony of this is that for one with a hammer, everything looks like a nail. The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming. Donald Knuth. Knowing when to apply something is just as important as know where
- tptacek 4y agoThat's super interesting. I had to within my first couple years of starting my career (I got tasked with writing a scripting language for a product). I'd guess I've parsed something-or-other --- firewall rules, some weird config file or other, C --- about every couple years. It seems super routine to me. But that's just me!
- gfxgirl 4y agoI skipped that by choosing lisp as my scripting language. took a day to implement. no complex parser required for config I used ini files, super simple to parser (and now json so always can use an existing solution)
- tptacek 4y agoI would do it differently today than I did in 1997.
- giaour 4y agoThere are plenty of users for whom having to write configuration in JSON is a significant barrier, either because they find the syntax obtuse or because they want things like comments, multiline strings, or expressions. Using a DSL can be a huge UX improvement in many cases.
- lazide 4y agoGenerally there has always been some pre-existing parser or a basic regex that took 30 seconds to write that I’ve done that with. Maybe I’m blessed?
- tptacek 4y agoCould be! I've never had to draw a Bresenham line, but I'm sure lots of people have. :) In-memory skiplists, I'm still skeptical of.
- okaram 4y agoI think it's one of those things, where if you have a hammer in your toolset you'll probably bang on a lot more things :) I've seldom implemented parsing, since we had Lisp, XML, and now YAML. However, I use language translation all the time.
- joshuamorton 4y agoThere's lots of cases where people use regexes to do some kind of validation, where simple parsers work better, if you know how to do them.
- seanmcdirmid 4y agoI’ve written a few tens of parsers during my career using recursive descent…along with lots of type checkers. There are lots of tricks here. Ever since I became a SWE rather than a researcher, I haven’t found a case to write another one, however. It’s much easier just to embed the DSL in kotlin.
- rukuu001 4y agoHuh, I did, many times. I think it’s more where we end up working, than universal applicability of these things. (And I didn’t know about any of the data structures or algos mentioned in the post - I’d never have been hired at a FAANG)
- wglb 4y agoWhen we wrote our compiler, it would have been kinda hard to do so without writing a parser.