Questions tagged [semantics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-3
votes
0answers
20 views

Searching for similar character traits form different texts (Searching for similar gods in different mythologies) NLP Text classification

I am looking for some help with finding methods to implement finding similar gods in different mythologies. For example, I need to find someone like Zeus in Ancient Roman mythology. I start with ...
89
votes
9answers
11k 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 ...
6
votes
5answers
4k views

Which programming languages don't use operator precedence besides Lisp-like languages? [closed]

And what do you think about operator precedence? Would be harder programming in a language where the operations are executed in sequential order? Ex.: 2 + 3 * 4 == 20 2 + (3 * 4) == 14 OK, the Lisp ...
0
votes
1answer
110 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
4answers
116 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
1answer
102 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:...
55
votes
6answers
54k views

What is a helper? Is it a design pattern? Is it an algorithm?

Maybe a little tongue-in-cheek, but as I can't find this answer anywhere through Google, so to ensure Software Engineering has the answer: What is a helper? I have seen the name being used ...
200
votes
12answers
291k views

What's the difference between an API and an SDK?

I was looking through various APIs and SDKs, when I realized that I couldn't really tell the difference between something called an API and something called an SDK. Both of them are, conceptually, a ...
3
votes
1answer
1k 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 ...
3
votes
1answer
102 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
4answers
253 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
1answer
63 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+ ...
1
vote
1answer
283 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
2answers
108 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
3answers
378 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-...
1
vote
1answer
96 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
3answers
146 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 ...
5
votes
6answers
1k views

Where to position logging statements

I have the following classes : class Task { public void DoSomething() { var s = new Service(); s.First(); s.Second(); s.Third(); } } class Service { ...
1
vote
2answers
245 views

Declaring a function without named parameters that accepts at least 1 argument

Say I have a function whose first parameter is used differently depending on how many arguments are passed. In this case, it is easier to just process the arguments object as a whole within the ...
8
votes
5answers
2k 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 ...
91
votes
13answers
121k views

What's the difference between syntax and semantics?

I've always thought that referring to the syntax of a language was the same as referring to the semantics of a language. But I've been informed that apparently that's not the case. What's the ...
7
votes
2answers
666 views

Domain Model Representation - Formal ontology vs code

Disclaimer: I have limited experience building domain models, this is purely asked out of interest to those who do I have recently stumbled upon the concept of representing data models with ...
36
votes
6answers
11k views

Why do we call it “production”?

A coworker was wondering this today: "Why is it that in our industry 'production' means 'final, deliverable product'? You know, like if a movie is 'in production', it means they're currently filming ...
53
votes
9answers
5k views

Is immutability very worthwhile when there is no concurrency?

It seems that thread-safety is always/often mentioned as the main benefit of using immutable types and especially collections. I have a situation where I would like to make sure that a method will ...
1
vote
3answers
164 views

In an ESB type system, what field name should be used as a “correlation ID”?

We're using ASP.NET Web API and Azure Service Bus and adding logging to our disparate services and systems. We need to track a correlation ID to the headers of each set of bus messages as well as logs ...
-1
votes
1answer
111 views

Semantic action in parser combinators

I have a parser that can be defined as int = a:/[0-9]+/ {parseInt(a)}. It is supposed to match an int and convert it into a number. There can also be a parser like sum = a:int b:int {a+b} As ...
17
votes
4answers
5k views

Is there a difference between iterable and enumerable?

Many languages seem to have structures that are very similar called iterable or enumerable. These are structures that can be iterated or enumerated over, which seem to me extremely similar things. ...
1
vote
1answer
1k views

Should objects be singular since arrays are plural?

Might be a silly question, but what is more logical: object.actions.bark() or object.action.bark()? Simply about plurality. I know arrays are usually pluralized. But if I were to be consistent; ...
55
votes
8answers
4k views

Why would one bother marking up properly and semantically?

Note that I (try) to mark up as semantically as possible because I like they way it looks and feels, but not because I'm aware of any other stunning advantages. The point of my question is to be able ...
4
votes
2answers
98 views

Is there any good/fundamental reason that Python classvars, and JavaScript prototype inheritance, don't mutate the parent on assignment?

In Python, if you have a classvar, it's accessible from an instance, but if you set the variable on the instance it doesn't actually change the classvar, rather it assigns a new name which shadows the ...
2
votes
2answers
730 views

Are there good reasons for avoiding the use of semantic HTML markup?

Background I have recently taken up a new job as a developer at a company where I have inherited an in-house CMS built approximately 5 years ago. The CMS constructs pages in XML which are then output ...
13
votes
3answers
559 views

Does one method overload an other, or are both methods “overloaded”

If I create this method public void foo() And then I create an overloaded version like this public void foo( string bar ) Do we say that the second functions overloads the first, or are both ...
2
votes
1answer
55 views

Help settle an argument: article element usage question

A team member and I are having a disagreement on the usage of the <article> tag. By the definition in MDN, to me, it sounds like it should be used when presenting the user with content of some ...
0
votes
1answer
50 views

How Do DB Version Control Systems Lack in Script Semantics When Modeled on Source/Target Difference Comparisons

There are several database version control solutions out there to assist with controlling not only the versioning of a database, but also deploying and synchronizing databases. These systems are ...
9
votes
5answers
1k views

Is it correct to say that a variable is an instance of a data type?

(that can change its value over the course of the program) Or is 'instance of something' strictly related to classes and objects? If so, how would you define the concept of 'variable' when it comes ...
4
votes
2answers
806 views

Why doesn't C have first class arrays? [duplicate]

I've got a question about the semantics of C and was wondering why the powers that be decided to make arrays different from every other type in the language. I understand that arrays and pointers are ...
5
votes
1answer
403 views

When designing a directory structure should filenames include folder names?

Suppose I have two directories: house-1 and house-2. Each house directory needs to have files describing its windows and doors. I am trying to understand how to name the files and directories. My ...
7
votes
1answer
66k views

What is the difference between a server and a mainframe? [closed]

To me, it seems as though "mainframe" is a somewhat dated term; is it simply an older synonym of "server," or does it server a purpose more similar to a cluster/supercomputer?
5
votes
2answers
9k views

REST API - omitted properties in POST request: How should they be handled?

Given the following scenario: Teacher entity { "id": "1234", "name": "Mr. Didactic", "Subject": "History", "Classroom": "1A" } REST API endpoint: /teacher/id/1234 Let's say I submit a ...
3
votes
2answers
613 views

Why are semantics and type systems are so important?

I heard that semantics and type systems are very important for all programmers! But I why are they so important? I don't understand. Maybe they are imortant only for theoreticians and compiler ...
6
votes
2answers
2k views

Why does Scala name monadic composition as “for comprehension”?

Not sure if it's an appropriate question, but here it goes. I know Haskell's do notation pretty well. And I realized that Scala's "for comprehension" really is just mostly the same as do notation in ...
20
votes
3answers
3k views

Which are the alternatives to using a stack to represent function call semantics?

We all know and love that function calls are usually implemented using the stack; there are frames, return addresses, parameters, the whole lot. However, the stack is an implementation detail: ...
1
vote
4answers
195 views

When is an object passed to a function?

Trying to clearly state the semantics of a function call. In calling a function, are the arguments passed to the function the ones the calling code initially gives or the ones the function receives?...
3
votes
1answer
573 views

Semantic web and web UI impedance matching

While developing a web-application (= application with web UI) using semantic web resources / technology like RDF, OWL, SPARQL, there is constantly a feeling that at the same time semantic offers much ...
0
votes
2answers
456 views

Is it appropriate to use the unordered list (ul) element for composite content

I recently had a thought of utilizing the unordered list element to represent a list of composite content (such as a product list with details or an image list with captions). For example: <ul&...
3
votes
2answers
2k views

Semantics of heading levels in multiple sections in HTML5

I'm never quite sure what is the best, most semantic way to handle heading levels in HTML5 markup, when you have multiple sections. On one hand it makes sense to have an H1 heading as a title of a ...
73
votes
10answers
7k views

Never use Strings in Java? [closed]

I stumbled upon a blog entry discouraging the use of Strings in Java for making your code lack semantics, suggesting that you should use thin wrapper classes instead. This is the before and after ...
1
vote
3answers
113 views

Should I mark what blocks mean in data-* attributes?

I was writing a webpage today with a comment after the start of every major section. Instead of using a comment, which comes with the bulgy <!-- --> syntax, could I instead put this in a data-* ...
7
votes
2answers
657 views

How can I make sense of the word “Functor” from a semantic standpoint? [closed]

When facing new programming jargon words, I first try to reason about them from an semantic and etymological standpoint when possible (that is, when they aren't obscure acronyms). For instance, you ...
0
votes
2answers
213 views

How could an expert system get some meaning from a sentence? [closed]

How could an expert system tell following scenarios apart? How could we include some meaning of a sentence, if at all? A machine needs 1 day to produce x units, and, we know that two machines like ...