Questions tagged [semantics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
97 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
169 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
62 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+ ...
2
votes
1answer
146 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 ...
1
vote
1answer
103 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
94 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
288 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
67 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
128 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 ...
6
votes
5answers
1k 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 ...
7
votes
2answers
549 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 ...
1
vote
2answers
212 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 ...
0
votes
1answer
839 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; ...
-1
votes
1answer
104 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 ...
4
votes
2answers
95 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
565 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 ...
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
49 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 ...
1
vote
3answers
130 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 ...
9
votes
5answers
994 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
722 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
376 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 ...
4
votes
2answers
6k 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
520 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 ...
1
vote
4answers
169 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
560 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
437 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 ...
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
626 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 ...
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 ...
45
votes
3answers
45k 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 ...
0
votes
2answers
210 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 ...
1
vote
3answers
142 views

Do we tell the object to do something or do we do something (on/with/to/etc.) the object?

Take the (unprecedented and groundbreaking) example of the calculator: public class Calculator { public double Add(double augend, double addend) { return augend + addend; } } ...
1
vote
2answers
2k views

How is 'bolt-on' the same or different from add-on, extension, or module? [closed]

I hear the term 'bolt-on' used in many contexts, specifically in my organization where PeopleSoft is used extensively. I don't know exactly how it differs from an 'extension' of an existing product, ...
1
vote
3answers
3k views

Why do expressions print variable value using System.out.print?

Why does java print the value of the variable that is assigned it in the code below? I want understand what is happening here. My thought is that the expression inside println() method is evaluated ...
0
votes
2answers
92 views

Placing arguments on their own lines [closed]

This question applies to both parameters and arguments, since I've seen this style used in both. I usually write parameters like this someFunction(arg0, arg1, arg2) but I've recently noticed that ...
4
votes
1answer
200 views

What HTTP verb is appropriate for an api route that restarts an application the server?

I got asked to do a code review of a very simple one-route web service that when hit would simply restart an application on the system. The developer had coded this up as a POST which strikes me as ...
2
votes
1answer
424 views

Does changing the name of a namespace count as a MAJOR change in semantic versioning?

I'm writing a C++ library, and according to this site here: http://semver.org/, I should increment the MAJOR version when I make incompatible API changes. Is changing the name of a namespace ...
17
votes
4answers
4k 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. ...
3
votes
3answers
614 views

Cogent arguments for 'semantic css' over 'object oriented css'

[Context - I'm a Java developer, having a discussion with a designer who works in the html/css space] I was having a discussion with a co-worker today about the merits of 'semantic css'. His ...
0
votes
1answer
2k views

How to format this line according to PEP 8? [closed]

I'm trying to adhere to PEP 8, with a 78 character limit on the length of my lines. I have the following statement: startTime = time.strptime(request.GET.get('st', (dt.datetime.now() - dt.timedelta(...
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: ...
4
votes
2answers
230 views

Difference between sending a message and emitting it

Halfway through the RabbitMQ tutorial, I noticed that the tutorial stops referring to producers "sending" messages and starts using the verb "emit" instead — and pretty consistently, too; after the ...
3
votes
3answers
970 views

UML modelling semantics

In today's lecture about Modelling techniques with respect to MDD using UML the lecturer stated that it's absolutely necessary to give a (possibly) textual description about the semantics of each ...
2
votes
1answer
408 views

Objective C - nested messages … confusion about

Wonder if anyone could shed some light on this messaging construct: The documentation says that messages appear btwn brackets [] and that the msg target/object is on the left, whilst the msg itself (...
2
votes
1answer
188 views

Should semantic breaking changes be tied to syntactic breaking changes?

Explanation First let me briefly define how I'm using terms (I might be bending their typical use a little): When I talk about semantic breaking changes, I'm referring to a change in the meaning/...
6
votes
1answer
64k 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?
8
votes
3answers
760 views

What is the right HTTP method for upvoting?

From a RESTful point of view, what is the most appropriate HTTP method for the action of upvoting a forum post (like on StackExchange)? I would say POST for voting and DELETE for canceling vote, but ...