Website logo

Matt's Website

Mostly programming and birds.

JS Destructuring / Ada declarations

24-01-29

I was recently reading some js / react code which destructured props like this:


const {
  lots,
  andLots,
  ofVarious,
  propsGet,
  destructured,
  rightHere,
} = props;

// rest of the component goes here

Ada gets flack for being verbose and I’ve specifically seen people stating the up-front declarations are bad. But is this really all that different to:


declare
   someVar : integer;
begin
  -- rest of code here
end;

Tags: programming, til