Programming: Difference between concept and construct [closed] - terminology

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
When it comes to programming what is the difference between concept and construct for describing "patterns" used in multiple languages?
e.g. are "immutable data structures" or "pattern matching" concepts or constructs?

To start off, concepts are ways to explain something that we observe and that we try to explain. Construct is a little bit created in the opposite order. We "construct" a concept to be able to work with a situation and explain somethings that are not directly observed or deduced.
Immutable data structures is a concept since it qualifies something that is "tangible" or actually invisible with your eye but have a precise mechanic in the computer. "Pattern matching" is a concept of really specific procedures.
Now I guess that when you think about "construct" you also refer to programming "constructs" like operators (like +, -, *). In this case they are also concepts called "constructs" but shouldn't be considered to be the equivalent to "construct"/"concepts" concepts ;).
Hopefully, this helped you sort those words out.
Dan

Related

What is "overkill"? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Programmers often wonder if the use of a certain library or programming style is overkill. They also often claim that this is the case (and they are often believed).
What does "overkill" mean in the context of programming?
"overkill" is typically used to mean deploying overly flexible and/or over-engineered solutions to solve what is ostensibly a simple and highly localized problem. The canonical example is FizzBuzz Enterprise Edition.
The term "Overkill" literarilly (if there was ever a literal use of it) refers to the action of killing something or someone, with more resources than necessary. Something like shooting a deer 50 times to make sure it dies.
In programming it applies for the same principle: making use of more resources than necessary or to find an overly complex solution to a simple problem.
Some simple examples are
for i=1 to 100
x[i]=2^z[i];
y=x;
end
Where copying the entire array x in every iteration step achieves the desired result but you could also copy it elementwise y[i]=x[i] saving you some 900 operations and is thus an overkill.
Using the OpenCV library to threshold an image is definetley possible but uses many more resources than strictly necessary and is an exagerated example of an overkill.

Language: How to explain someone not to use the word "command"? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
It's been a while I posted a question. Maybe this one belongs to Programmers or Meta, not sure.
Right now, I'm at university in my first year civil engineer. We have some programming courses where we learn Java in order to acquire the basic concepts of programming and train algorithmic thinking. Almost all my fellow students are unfamiliar with programming. I'm experienced and people do ask questions from time to time to me about their programming problems. While explaining their problem or while asking for solutions, they really often use the word "command". I noticed that, in most cases, they are referring to what we call statements. My problem is that the word command really sounds bad and is in my opinion wrong as well, in this context. So, my question is: how do I explain them not to use commands, but rather something like instructions, statements, expressions, declarations, operations? How to explain that you do not program commands?
Sentences I hear frequently:
Which commands do I need?
What does this command do?
Or am I the only one that thinks command is wrong? If so, please explain.
You could ask them to be more specific for sake of professionalism.
A car is not a truck or not a van - and there are also bikes and bicycles and other things you could drive...
I would ask for being more specific EVERY time until they change their behaviour. You can lead them to the specific expression, but they should make the step to say it from their own. Otherwise they don't make an effort, because they count on you to help them.

Which coding abbreviations is widely used and generally understood? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Sometimes it is difficult to invent short and accurate name for a method or variable that is clear on the first glance. Abbreviations are not recommended today. But, for instance, if we use
src and dest in function params, it is contextually clear what they mean
i often means index: for(int i=0; i<size; i++).
Are there any other abbreviations like these used in more than one language?
There are a lot of abbreviations that are common and generally understood ("args", "i18n", "HTTP", …).
I'm not sure if I get your question right, less that there is a good answer to it. A good abbreviation is short (dooh) and easily understood by the readers. So the choice of an abbreviation depends on audience; what is obvious for a particle physicist might seem far fetched for a finance analytic or a games developer.
Maybe, the misleading word is abbreviation. The choice of a good abbreviation is the same problem of naming things in general (which is known as one of the two hard things in computer science). Readability is more important than conciseness.
Conclusion: if you know your audience (and your problem domain of course), you should be able to find understandable (and not too long) namings.
[Update]
Robert Martin wrote a whole 14-page chapter on "Meaningful Names" in his book on Clean Code, which for me is a Must-Read for every serious developer.

Are there any conventions for flowcharting that distinguish a switch from a if-else chain? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I had to do a overview for a customer meeting, and they requested flow charts. It had never occurred to me that there was no switch symbol in any of the flow charting I've seen. I know functionally they are similar, but documentation should represent the code you've written or are planning too. Maybe I'm just being picky, but it seems like a common enough construct that it would have "representation."
Pete
My impression is that diamonds are the correct symbol for switches (multidirectional branches) as well as binary decision points — i.e. the diamond is any conditional. One just gets the idea that diamonds are for either/or because that's their most common use.
The difference between a series of if's and a switch is irrelevant at the flow chart level. Both are a series of conditionals. If you want to document your code down to the if/switch level, just print out the code.

Story generation [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Upon reading a blog post about a minimalist story-generating python program, I was asking myself - and you - which are the most successful attempts at such programs. I remember seeing something using generating grammars, for instance. And which are the best attempts that, like this one, are extremely compact, either self-contained or able to read, say, the Web or an independent textual corpus (but not simply a file with a large number of story chunks)?
Search for Talespin for some famous ground breaking work. (Example: Micro-Talespin in Common Lisp by Warren Sack.)
I actually like Turner's "Minstrel: A Computer Model of Creativity and Storytelling" better :
ftp://ftp.cs.ucla.edu/tech-report/1992-reports/920057.pdf
Talespin is, in my opinion, blind in it's algorithm to everything but planning. So the author goals are given very little consideration (if at all). Minstrel is better that way.