Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [semantics]

The tag has no usage guidance.

0
votes
1answer
42 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
58 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
119 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 ...
0
votes
0answers
13 views

General structures / algorithms for parsing / interpreting a semantic query efficiently

If you have a semantic/meaning graph data structure built up, and you get a new word as part of a sentence, the question is, how it optimally determines the meaning of that new word. It seems that, ...
5
votes
5answers
514 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 ...
5
votes
2answers
326 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
201 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 ...
-1
votes
1answer
566 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
100 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
90 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
404 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
53 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
47 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
108 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 ...
8
votes
5answers
874 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
576 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
335 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
4k 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 ...
2
votes
2answers
394 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 ...
7
votes
2answers
1k 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
161 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
550 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
412 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&...
2
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
111 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-* ...
6
votes
2answers
568 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 ...
39
votes
3answers
37k 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
208 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
141 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, ...
2
votes
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
90 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
181 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 ...
1
vote
1answer
392 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 ...
15
votes
4answers
3k 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
606 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
1k 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(...
19
votes
3answers
2k 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
214 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
956 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
394 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 (...
1
vote
1answer
176 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
58k 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
654 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 ...
3
votes
5answers
608 views

Using 'new' in a projection?

I wish to project a collection from one type (Something) to another type (SomethingElse). Yes, this is a very open-eneded question, but which of the two options below do you prefer? Creating a new ...
3
votes
1answer
324 views

What is meant by a “First Class Protocol”

The Node.js about page describes HTTP as being a "first class protocol" within node.js. What does this mean? http://nodejs.org/about
8
votes
5answers
1k views

Why is semantic markup given more weight for search engines?

This question follows directly from the part of an answer of this question - Why would one bother marking up properly and semantically? . I would like to understand why SEO techniques gives more ...
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 ...
7
votes
6answers
1k views

Using empty subclasses to add to the semantics of a class hierarchy?

I was wondering whether using (almost) empty derived classes to give additional semantics to a class hierarchy was a good idea (or practice) ? Because a (not so short) example is always better than a ...