What are "fancy words" (fancy words) in programming languages?

Asked

Viewed 114 times

6

First of all, I don’t know if it’s a concept restricted to languages like Typescript or Javascript, so I assume it’s general purpose.

I came across the following codes that I will use as an example base:

// F.W. ephemeral
const getAccessTokenOfUser = (id: string) => {
  // ....

  return token;
};

I thought that F.W. referred to a person’s name, but I discovered that F.W. means Fancy Word (fancy word in en).

In getAccessTokenOfUser, the concept of ephemeral (ephemeral) is of something that does not last long, or that lasts 1 day. What agrees as the code that I analyzed, because the key of the token, which is a JWT, lasts 1 day.

In another code snippet, simplified to exemplify, I have the following:

/**
 * @param {string} storageType F.W. Idempotent, according what is defined on STORAGE in .env
 * file and never change during life time.
 *
 * @returns {boolean} F.W. Predicate, according what is defined in storageType.
 */

export const storageTypeStatusIsProductionReady = (
  storageType: string
): boolean => {
  const storage = {
    a: {
      // ...
      isProductionReady: false
    },
    b: {
      // ...
      isProductionReady: true
    }
  };
  // ...

  return storage[storageType].isProductionReady;
};

He makes reference to Idempotent and Predicate in this Jsdoc and from what I understand, these words "key", so to speak, represent some standardized meaning of some action, value or resource.

Analyzing the function storageTypeStatusIsProductionReady, she returns a Boolean true or false, then, from what I understand, Predicate refers to a group of possible values to be returned. Something like predictable or predetermined to return (I think functional programming defines like that) according to what it is Idempotent like the storageType.

It seems to me that these Fancy Words are words that serve semantic value, not for machines, but for people who will analyze, document and/or use a particular piece of code. I may be mistaken, but from what I understood of the above mentioned examples, they have greater significance to document codes.

I would like to know more about the subject of Fancy Words, which other words have the highest semantic value and which are most used. If Fancy Words are key words to define programming concepts, if it is a synonym for some concept I already know...

... or if it was only a standard adopted only by the creators of the above codes.

  • 1

    As far as I know, predicate is usually a function that is passed to... determine a "predicate"! For example, some say that the callback going on to Array.prototype.filter JS is a predicate (note that returns a Boolean). As for the others, I’ve never even seen them. :P But let me observe - maybe it would be better to use the [language-independent] tag, since it seems to me to be something that goes beyond the scope of JS, TS or any language...

  • @Luizfelipe edited. I’ve never even seen it. I’m starting to think (according to @Piovezan’s reply) that it’s just someone wanting to write "beautiful".

  • Another thing... I was curious to know where the code snippets were taken from. Was it from an open Github repository? : D

  • No, it was from a post in a group of international Nodejs in Linkedin (again), where the author talked about commenting on the code with semantic words of common use. I guess it was just for other people to think "Wow!!! What a well-documented code..."

  • I think I’ll even rule out the question... :(

  • @Luizfelipe has an Issue that mentions predicate....

  • Yes... As I said in my first comment, of the terms you quoted in your question, the only one I have ever had contact with (and still have) is predicate. Commonly used with "programming jargon" - I see more commonly in functional programming contexts, incidentally.

  • 1

    @Cmtecardeal I am suspicious to speak :) but I do not think I should exclude the question, has a relationship with programming concepts and also counts as a grammatical curiosity that it is not impossible for someone else in the area to be interested in looking for.

Show 4 more comments

2 answers

6


The term itself has no direct relation to programming or to a particular language, as it is a term of general use in the English language to describe certain types of words, but I believe it is being applied in a programming context for two reasons, to name certain unusual words that may make an impression on those who are unfamiliar with the term and also mainly to point out that these words represent certain desirable technical/computational qualities in the code in question.

The word "Fancy" in English, among other meanings, is an adjective that means the opposite of what is "Plain" (ordinary, regular, without grace). It translates qualities as special, attractive, elaborate, exquisite, among others. " Extravagant" you quoted describes well. For example: "A cosplayer in a Fancy dress/costume" passes the idea of a dress or costume "incremented".

The expression "Fancy word" is also commonly used in English, referring to any words that are elaborate, exquisite, "showy" (that "like to appear"), "intellectuals". To give the idea I would translate as "difficult words" or maybe even "stuck to the beast". It is nothing more than wanting to say that a word is difficult or extravagant (like "papyrus"). It therefore includes any technical jargon that sounds portentous, especially for those who do not know what it means, or for equivalent to a broader concept that is trying to summarize in a single word, which in the case of our area would include for example "ephemeral", "idempotentive", "orthogonal" ("cross-Cutting"), ""atomic", "concurrent", "persistent" (in the sense of data persisting), "multiparadigmatic", etc., in particular those describing qualities or characteristics (therefore often adjectives), which one might call "standardized" or semantic" as the question goes, but it also serves any word, technical or otherwise, which is unusual or may sound a little pedantic.

For example, in a context outside of computing, "resplendent" is a difficult word to simply say "beautiful". " Kiss" instead of "kiss". "Bibliophile" to "like books".

"Ephemeral" is an unusual way of saying "brief", "short-lived", in computation may have a more specific meaning of volatile, non-persistent, durable information. Examples are the aforementioned short-term access tokens, data that is in RAM memory and has not been saved to permanent storage devices, and the qualification of certain variables in Java as volatile or transient.

"Idempotent" is used in computation to qualify an operation that always produces the same result regardless of the number of times it is called, since its entries are the same every time (feature to be observed when implementing the expected behavior of certain HTTP protocol methods, such as GET, and others not, with POST). An important differentiation when using these methods in web development, therefore.

I did not cite the "predicate", but if you go looking you will see that it is a term used in mathematics and computing.

Look at these titles I translated from two articles not linked to computing, which imply that Fancy words sound intellectual or unusual. They strongly suggest that the term can be translated as "difficult words":

In the community English Language Learners no one has yet asked what that expression means, but it is being mentioned in several examples that imply this idea that I have described.

In the old School of Prof. Raimundo (to surrender my age) who used many Fancy words was His Rolando Lero to flatter the teacher and also the teacher himself at the time of praising His Ptolemy after one of his intellectual enlightenments to the other students. :) "You are astringent today! Unshakeable! Overwhelming!..." , etc..

I believe that the term is being used in the documentation cited to say that the intention of that documented code is to possess or provide a certain quality or known technical property, such as the case of those cited (to be ephemeral, to be idempotent). It is wanting to designate specific qualities in a concise way (that is, in a nutshell). It’s certainly a very feasible way to convey a precise idea when documenting software.

In time, I found that video: "Seven Difficult Programming Words", including those cited in the question :)

Taking the cue of the AP’s answer, I believe the terms overengineering and overengineered ("made with too much engineering" or "with too much engineering" - complicated to find exact translation) also enter as "difficult words"used in our area (and also in others) that have a special meaning, giving the idea that solutions and products should be made with the right measure of functionalities, design and effort, and in particular avoiding excesses.

  • 1

    I understood your point and would like to give a +1, but I think as it has nothing to do with programming, I will analyze whether it is worth keeping the question or not. I’m starting to think it was just a standardization of a specific group of programmers to document a code.

  • 1

    I think that immutability would be an example of Fancy Word

  • @Cmtecardeal For sure. In Computing there are many. Human and Biological too. : ) I find it difficult for an area of human knowledge not to have to describe its specifics concisely.

  • 1

    I posted the reply with the link that Voce informed us to have a more technical response. Nice to know that these words really have meaning in programming.

2

Solved

Thanking @Piovezan for their contribution and excellent response, he shared some material to complement it.

In this excellent material informed by @Piovezan, is explained some Fancy Words common in programming and would like to elaborate a more complete response and share with those interested in the subject.

I found until this moment that Fancy Words were decisions of teams to standardize a documentation or even think it was similar to Overengineering, something like Overengineeringdocuments, but my vision changed.

This is the list:

  • Idempotent (Idempotent)

  • Ephemeral (ephemeral)

  • Anonymous (Anonymous)

  • Predicate (Predicate)

  • Memoization (Memoisation)

  • Abstraction (Abstraction)

  • Serialization (Serialization)

Let’s go to the explanations...

Idempotent

It refers to an operation that given the same parameter, will result in the same results. This immediately referred me to functional programming, more specifically to pure functions.

Example of everyday life:

  • Pushing the elevator button several times won’t make the elevator go up any faster.

Code example:

  1. No Idempotent - The array changes with the same operations

const arr = [];

arr.push('oi');
arr.push('oi');
arr.push('oi');

console.log(arr); // (3) ["oi", "oi", "oi"]

  1. Idempotent - The set does not change with the same operations

const set = new Set();

set.add('oi');
set.add('oi');
set.add('oi');

console.log(set); // Set(1) {"oi"}

Ephemeral

Something that lasts 1 day... or a short time. Basically it tells us about something (state) that is not persisted, such as a value saved in cache memory. A computer ram memory would be an ephemeral component example. In a way, it has a relationship with mutability, because it is not about state conservation, but I believe that this can be a good discussion on immutability or mutability.

Examples:

  1. Ephemeral code:

const automovel = {
  rodas: 2,
  motorizado: true
};

// ....

// em algume momento futuro, depois de alguma condição...

automovel.motorizado = false;

console.log(automovel); // {rodas: 2, motorizado: false}

  1. Non-eephemeral code:

const automovel = {
  rodas: 2,
  motorizado: true
};

Object.freeze(automovel); // não permite mudança

// ....

// em algume momento futuro, depois de alguma condição...

automovel.motorizado = false;

console.log(automovel); // {rodas: 2, motorizado: true}

Anonymous

Something that has not been assigned any identification or intentionally does not possess it, is anonymous. I think there is not much to explain...

Examples:

  1. Anonymous code: Using the map Javascript is common to pass an anonymous function as argument.

const arr = ['olá', 'stackoverflow', 'português'];

const arrUppercase = arr.map((el) => el.toUpperCase());

console.log(arrUppercase); // (3) ["OLÁ", "STACKOVERFLOW", "PORTUGUÊS"]

  1. Anonymized Code: Using map, but now we pass a function with a defined name.

const arr = ['olá', 'stackoverflow', 'português'];

function upperCaseWordsFunction(el) {
return el.toUpperCase();
}

const arrUppercase = arr.map(upperCaseWordsFunction);

console.log(arrUppercase); // (3) ["OLÁ", "STACKOVERFLOW", "PORTUGUÊS"]

Predicate

In programming, it usually refers to a function/method that returns only 1 boolean value. Can be used in functions to validate some function parameter, for example, and proceed X or Y way.

Examples:

// função "predicate"
const isBrazil = (country) => {
return country === 'brasil';
}

const sayHelloToSO = (to) => {
if (isBrazil(to)) console.log('Olá comunidade do StackOverflow!')
else console.log('Hello community StackOverflow!')
}

sayHelloToSO('spain');
sayHelloToSO('brasil');

Memoization

Memorize, save, store, store something somewhere. We can refer to a function that maintains a value in memory (caching). They are mainly used in high-cost processing functions.

Wikipedia:

In computing, memoization or memoisation is an Optimization technique used primarily to speed up computer Programs by storing the Results of Expensive Function calls and returning the cached result when the same inputs occur Again.

Translation:

In computing, memoizing or memoizing is an optimization technique used primarily to speed up computer programs, storing the results of expensive function calls and caching the result when the same entries occur again.

Example of day-to-day: React has a ḿetodo called useMemo that returns a value memoised.

Code example:

  1. Memoized Code: A recursive function used to return the Fibonacci sequence.

const memo = {};

function fibonacci(x) {
if (memo[x]) return memo[x];
if (x <= 1) return x;

return (memo[x] = fibonacci(x - 1) + fibonacci(x - 2));
}

console.time();
console.log(fibonacci(20));
console.timeEnd();

In the above case, we save the value to the object memo for when we find the same value again, it will not be necessary to compute it again. This avoids extra processing.

If it were recursion without memoization:

  1. Unsolved code:

function fibonacci(num) {
if (num <= 1) return num;

return fibonacci(num - 1) + fibonacci(num - 2);
}

console.time();
console.log(fibonacci(20));
console.timeEnd();

Complexity
  1. Recursion with memoization:
  • Time Complexity: O(2N)
  1. Recursion without memoization:
  • Time Complexity: O(2 N)

Abstraction

Meaning "drawn from", translating "retirado/extraído de (algum lugar)". In general, it comes to "hide" the details of end-user implementations.

Everyday Examples: An API is an abstraction.

Code example:

  1. An abstract class that does not reveal details of its implementation:
abstract class Fish {
  swin() { return 'Nadando rápido' }
}

class Nemo extends Fish {
  filme: 'Procurando Nemo'
}

class Aquaman extends Fish {
  filme: 'Liga da justiça'
}

Serialization

Something properly ordered, in a way that distinct parts can understand the same object. We can say that "serialize" would build a data structure all the different parts can manipulate and work with.

Classic example: JSON, a Javascript object can be serialized (converted to JSON format) and can be sent by an API to a Python program, for example. This Python code can deserialize this JSON to an object which Python can understand and manipulate.

Code example:

Javascript:

const person = {
  name: 'Darth Vader'
};

JSON.stringify(person);

Python:

import json

dataFromJs = "{name:'Darth Vader'}"

x = json.loads(dataFromJs)
  • 1

    Some corrections: 1) Although "to draw" means draw, "Drawn from" usually has the meaning of "drawn/extracted from (somewhere)", for example extract an example from a book, draw a card from the deck or draw a gun (from the hem).

  • 1
    1. Abstraction (abstracting something) means to represent the essential of a thing while omitting the irrelevant parts (details). For example, say "person" instead of "head, torso and limbs". Its immediate consequence is to allow to represent and work with concepts and information at a higher level (of abstraction or understanding of a problem) than others, besides allowing to exchange the details (way of doing) of the lower levels without affecting the expected behavior of the upper (example: change vehicle without having to relearn to drive). Also functions and objects.
  • 1
    1. The abstraction example is not good, Fish class all right but Shark class is better than Nemo class, which would be an instance of Clown Fish. 4) Serialize comes to put in series (sequence) in case for the purpose of transmitting or storing. It is about data and not about speaking something in the same language (this is communication protocol). 5) Memoization should be right but probably not exactly the same as memorization or it would be called memorization at once. Apparently it is the same as, or a specific case of, caching. Or vice versa, who knows.
  • 1

    The key concept of one of the two in my view is that often information has a high cost of time or resources to be obtained and then it is allowed to duplicate that information or at least part of it in order to provide the resulting data faster/cheaper than the cost of bring or compute the original information. The consequence is having to manage this duplicity. Caches in general have to do with this.

  • 1

    Important notes. I will edit the answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.