If you can't rely on the symbol or its absence meaning anything, it's just more punctuation.
908 karma · joined November 8, 2016
If you can't rely on the symbol or its absence meaning anything, it's just more punctuation.
Perl grew to prominence when being a creole of C, shell, sed, awk, and lisp was an advantage. Anyone who might reasonably use it would be familiar with at least a few of these tools.
Now, we live in a very different world. JavaScript is the new BASIC. Everyone has JsBASIC installed on their (virtual) machines. So that's what people learn on their own. Python and Java are closer to JS so, the transition is easier (at least superficially--I could argue that JS and Perl a lot in common, designwise).
It's funny to me to see the same people who complain about sigils in perl whole heartedly adopt the Rx convention of naming streams with a tailing $.
It's literally just a sigil. Yeah, you put it at the end, but it serves the same exact purpose.
But I have found the experience incredibly useful. Using Raku is like working with advanced alien technology. My experience with it changed the way I write other code.
I recommend playing with Raku for mind expansion.
Context and list flattening are probably the most foreign parts of Perl to someone who doesn't know it. Everyone fixates on the sigils, but the weirdness in the way sigils operate stems from context.
When you call a function, the arguments are flattened into a single list. So `foo(1,2)` is the same as `my @args = (1,2,3); foo(@args, 3)`. Every expression can be evaluated in one or more contexts. So taking the value of an array in scalar context gives you the length, which is handy but also means that, since 0 is falsy, you can just do logical tests on arrays to check if they are empty. Because the behaviors are relatively intuitive, it's possible to quite a bit of work in Perl before you even understand what context is or how it operates. `if (@foo) { do_stuff(@foo) }` does what you'd think it does, even if you don't know about context.
But it also means that the distinction between `my $match = $foo=~/(foo)/g;` and `my ($match) = $foo=~/(foo)/g;` is not at all obvious if you don't understand context. (The first example gives you the count of matches, the second example gives you the first match because the parens put you in a list context which means you are effectively assigning into a slice.)
Back in the day there was that horrible trend of using "inside out" objects that would let you reliably subclass something without knowing it's underlying module system.
Ovid's Cor project has some really great work on specifying a default OO sytem for Perl 5 (or maybe 7). https://github.com/Ovid/Cor/wiki
For me, the main advantages of sigils are that I can immediately see if I am looking at a variable or a function name and that the sigil effectively separates the name spaces between functions and variables. This has the side effect of making it easy to distinguish functions that have been passed in as variables from functions declared or imported into the particular scope.
Even with a nice IDE I miss the distinction that the sigils provide.
XML::LibXML is a nice wrapper around libXML.
XML::Twig is great if you need to process huge files.
XML::Rabbit will seamlessly map your XML into objects.
There are things to criticise Perl for, like idiosyncratic argument handling in subroutines or the use of weird punctuation variables, but to call out XML parsing as particularly hard is questionable.
Take a look at this example from https://grantm.github.io/perl-libxml-by-example/basics.html
use XML::LibXML;
my $filename = 'playlist.xml';
my $dom = XML::LibXML->load_xml(location => $filename);
foreach my $title ($dom->findnodes('/playlist/movie/title'))
{
say $title->to_literal();
}
How is that particularly difficult?1. This is your strongest point. I've missed the whiteboard a bit. But you just need to find other ways to sketch out your ideas. Even a google doc, which is pretty primitive as these kinds of things go, it pretty easy to use instead.
2. Personal relationships require investment and deliberate choice. Schedule some open mic time. Keep a zoom room open where teammates can interact but with the expectation that they needn't be 100% engaged. This is a substitute for talking over the cube walls or the random break room interactions. Also spend time in non-work conversations via slack or talk a bit about non-work stuff before or after normal meetings. You'd do this in the office as you walked to or from a meeting room. It isn't as easy to just accidentally build these social relationships. Working remote you need to build the habits that support them.
3. Keep your work space and your personal space separate. Set some time boundaries. Encourage your team to put a cap on their daily work. Remind them. You have to learn set and stick to healthy boundaries. Too much time on the job leads to productivity drop in the long run. Keep your team productive and happy by helping them be aware of the issue. As a manager, watch out for perverse incentives driving overwork.
There are zillion little moments of ad hoc communication that happen face to face. Now that their absence has helped you discover that they are valuable, ask yourself when they occurred and how they worked to your advantage. Once you have some idea what you're missing, then you can start to engineer a replacement. As a leader, it's important that you model these behaviors for your team.
Also, jq is amazing and is basically sed for json data.
My credit union was very easy to work with on this, but it has still been a pain in the butt.
I think we need disposable, single purpose bank account numbers like some services provide for CC transactions. I sure wish I had a fake proxy account ID between my real account and WA state.
I know it's just I typo, but now I have an image stuck in my head of a large rabbit, dressed up like Mussolini, lecturing about computer science.
Beej's guide was so amazingly helpful and welcoming when I found it over a decade ago.
Poorly written guides that try to be friendly or conversational are often worse than dry and terse guides of similar caliber, which really makes me appreciate the good and truly great ones.
And Beej's Guide is a truly great one.
You have made a huge positive impact.
Thank you.
Do you build slightly larger tools that integrate the small tools? Even these larger tools my need to be composed into another level of abstraction to build the final system.
This is essentially the same architecture that you would build with a layered set of abstractions and interfaces.
It's really just a matter of how the different bits communicate that is different.
It's not uncommon to hear the phrase used as a pejorative, with the implicit assumption that oral culture is inferior to literate culture and that tribalism == primitivism == bad and undesirable.
But I've come to believe that there are always going to be things that cannot or should not be represented in written documentation. Documentation is an artifact that must be maintained. Individual professionals and organizations spend a huge amount of energy producing, managing, and maintaining written documentation.
But how much time have we spent on oral transmission of ideas? Almost none. And that's because we dismiss it as an approach. It's seen as less than or primitive, or at best something to discourage.
But if you accept that there must always be some oral information, then ignoring the issues of how we communicate, update, and persist that orally transmitted information seems foolish. There are cultures that have more recently made the the transition from being primarily oral to literal that have not forgotten the skills needed to manage this class of knowledge.
I wonder what practices we can learn from them that we can use to improve our ability to share and communicate more effectively.
If the terms whitelist/blacklist are hurtful to some people because of all the racial baggage we've applied to the words white and black, why not switch to allow/deny instead?
Using allow/deny is more explicit and doesn't rely on the benign cultural associations with the colors black and white. The choice of colors used here is arbitrary. For example, one could just as easily use green/red in reference to traffic signal colors. Ask yourself, would it bother you if we used blue and pink for allow and deny? What if we used blue or white as synonymous with deny?
Two good reasons exist to change our habits, basic manners and clarity.
I'm sure I'll use the terms blacklist and whitelist from time to time out of accumulated habit. But there's no reason for me to cling to those terms. Being gently reminded to use objectively clearer terminology shouldn't engender hostility on my part. I try not to be an unpleasant person, part of that is when someone tells me my behavior has a negative impact on them, I try to listen to what they say and modify my behavior--while actually effecting change can be hard, the underlying concept is pretty simple.
If a paper becomes prominent and many people want to read it, is it reasonable for the authors to be inundated with hundreds of requests for a copy?
What is the point of journals if we rely on word of mouth interactions to share information?
The song asks "Where have all the X gone?" for a chain of values of X, each being consumed by some thing which then becomes the subsequent X. The first question is "Where have all the flowers gone" and the answer is "Young girls picked them, every one."
The song is a commentary about how we send generation after generation of our children off to war and death--figuratively consuming our children.
Kinda like the ammonites of yore devouring their own offspring.
EDIT: I think there's an Uncle Webring in there too, somewhere.
Here's less than a minute's worth of questions I would want answered for a professional version of the log fetching example:
* Is that list of a thousand servers static? * How is it updated? * What format is it in? * What do you do when the resource isn't available? * What other systems are impacted when the resource can't be contacted? * Is it acceptable to use a cached server list until it the resource can be updated? * How do you handle servers that don't respond when polled? If we retry connections, what scheme do we use? Linear or exponential back off? * After a service interruption, how do we resume data collection? Do we keep rolling forward or do we request older data? How quickly do we retrieve backed up data? Is service resumption plan different for the case when a single system is down vs when the log fetching system has an outage?
When I was young, my progressive, well-meaning parents taught me that I should be color-blind and not see race or gender, thinking that a generation of such people would naturally make a world with more equality of opportunity.
The problem is that that didn't work. All it did was create a generation of people who were illiterate in regards to the impacts of race and gender discrimination. It created a blind spot where those who wanted to discriminate could hide.
Data shows that race and gender have wide reaching impacts on one's ability to access services including education and healthcare, interactions with the justice system, and employment. The sad truth is that categories of race and gender have an outsized impact on your prospects and people have always been defined by them in this country.
In some sense, the earlier campaigns were successful--most people agree that overt segregation and discrimination are a bad thing. That's huge progress. But since we have mostly ceased practicing overt forms of discrimination, how is it that these disparities persist? There are two options either there are unconscious and unintentional biases that have a significant impact or the lingering side effects of discrimination keep historically marginalized groups at a significant disadvantage. (I think both cases are true, but that doesn't impact my argument.)
If we want to understand why we have these disparate outcomes, we have to pay attention to race and gender and how we behave in relation these categories. Only by doing so can we hope to resolve the underlying issues that drive social imbalance.
If you want to learn more about this from someone far, far more expert on the topic than myself, I recommend listening to some interviews with or articles by Ibram X. Kendi. His work is insightful and accessible.
In my day, we'd tie an onion to our belt.