Questions tagged [semantics]
The semantics tag has no summary.
76 questions
7
votes
1
answer
220
views
What is the term used to describe the number of times a pointer can be dereferenced?
For example, which term completes the sentence "p has 5 ____" in order to describe a situation like int *****p?
106
votes
11
answers
27k
views
Is putting general-use functions in a "helpers" file an anti-pattern or code smell?
Is it an anti-pattern or code smell to put "general use" functions (examples below) into a catch-all file named "helpers" or "utils"?
It's a pattern I've seen quite a lot ...
0
votes
1
answer
232
views
How can I tell if a library's execution model is the same as or different from the execution model of its base language?
https://en.wikipedia.org/wiki/Execution_model says
A programming language consists of a grammar/syntax plus an execution
model. The execution model specifies the behavior of elements of the
language. ...
-3
votes
4
answers
157
views
What's should I call a Location (Longitude and Latitude) associated with a DateTimeOffset? [closed]
In the Xamarin.Essentials library there is a Location class that comes with a DateTimeOffset TimeStamp.
I know I'm being pedantic and I should just move on - I know it's to indicate a location of the ...
1
vote
1
answer
175
views
Where's the interpolation in "string interpolation"?
In most contexts, the concept of "interpolation" seems to be related to estimating unknown states from known ones, like video frames or data points.
From the Wikipedia entry on interpolation:...
3
votes
1
answer
121
views
A size-type vs index-type conundrum
Suppose I'm writing C or C++ code which deals with... ok, let's make it citizens in a state. In this state, citizens have numeric id's (not strings - numbers); and for reasons of performance, or ...
3
votes
4
answers
1k
views
What log level use for deprecated features?
There is a feature that is now deprecated and going to be removed. Adding a logging statement, observed by some alerting mechanism, can help finding out whether the feature is still being actively ...
1
vote
1
answer
88
views
Lexicon for syntax patterns? [closed]
I am having trouble finding a lexicon which provides terminology for the explicit patterns that are employed when parsing syntax. I am trying to write about the niggling differences between the 10+ ...
4
votes
1
answer
5k
views
Semantics of simulating a 64bit integer with two 32bit integers (hi, lo)
I am working in a system which only supports 32bit integers, in order to have a 64bit (unsigned) integer I decided to simply use two 32bit integers with one being the upper 32 bits (hi), and the other ...
4
votes
2
answers
2k
views
How to categorize configuration changes in semantic commit messages
I am trying to switch to semantic commit messages for project. While the idea is good, sometimes I find it is difficult to properly categorize changes like a configuration value change.
If I commit a ...
3
votes
2
answers
181
views
Why create CSS classes named to match one specific style? (non-semantic class names)
There are a number of CSS frameworks that have a one-to-one correspondence between many of the classes and a single style. For example, in basscss ".inline-block" is defined as "display: inline-block;...
2
votes
3
answers
709
views
Is a literal out of range a syntax error or a semantic error?
I am reading more about the differences between syntax and semantics, but I am still wondering about this one.
Let's assume that we have a language that only allows integers to be in the range of 0-...
2
votes
1
answer
312
views
What is the difference between a migration pattern and a refactoring?
I have recently come across the terms migration pattern and refactoring on the topic of migrating monoliths to microservices. Is there any real difference between the two terms, or can they be used ...
2
votes
3
answers
716
views
filesystem::path vs. optional<filesystem::path> as argument to function
Sometime ago in a code-review (C++) I suggested to change the input argument from Path type to Optional<Path>, where the function has specific logic for unset path. It looks for me intuitively ...
8
votes
5
answers
3k
views
Where do I store user-defined business rules?
Let's say I have an application that works around departments and employees. Each department has a set of rules that defines which employee is assigned to each department. For instance the system will ...