Tag: syntax

61 votes
7 answers
702 views
Set language for syntax highlighting in Visual Studio Code

Before the confusion begins, this question is about Code, the new lightweight Visual Studio Editor. You can ge

avatar
Serina
0 1 0 9
asked 07 September, 2021
66 votes
16 answers
2.8K views
What is the difference between '/' and '//' when used for division?

Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >&

avatar
Thurman
0 1 0 9
asked 07 September, 2021
59 votes
9 answers
992 views
Is there a foreach in MATLAB? If so, how does it behave if the underlying data changes?

Is there a foreach structure in MATLAB? If so, what happens if the underlying data changes (i.e. if objects a

avatar
Dario
0 1 0 9
asked 07 September, 2021
56 votes
7 answers
2.9K views
When do we need curly braces around shell variables?

In shell scripts, when do we use {} when expanding variables? For example, I have seen the following: var=10

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
58 votes
20 answers
1.7K views
How do I iterate over a range of numbers defined by variables in Bash?

How do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this

avatar
Benton
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
1.5K views
How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes

avatar
Luis
0 1 0 9
asked 07 September, 2021
49 votes
4 answers
2.2K views
Differences between Jython and Python

I know Jython converts Python code into Java byte code, but are there any syntax changes between the two? and

avatar
Tuan
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
903 views
What does the three dots notation do in Javascript?

What does the ... do in this React (using JSX) code and what is it called? <Modal {...this.props} title=&a

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
55 votes
23 answers
867 views
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
52 votes
28 answers
2.1K views
Insert into ... values ( SELECT ... FROM ... )

I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for

avatar
Basil
0 1 0 9
asked 07 September, 2021
67 votes
2 answers
743 views
Syntax error in printf command in c programming

Just for context, I am a complete beginner at programming and learning C is my first experience at coding. I d

avatar
Basil
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.3K views
var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding featu

avatar
Arline
0 1 0 9
asked 07 September, 2021
57 votes
29 answers
1.2K views
What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

avatar
Ali
0 1 0 9
asked 07 September, 2021
59 votes
7 answers
2.3K views
What is the difference between single-quoted and double-quoted strings in PHP?

I'm a little confused why I see some code in PHP with string placed in single quotes and sometimes in dou

avatar
Jeff
0 1 0 9
asked 07 September, 2021
58 votes
29 answers
598 views
How do I get PHP errors to display?

I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have r

avatar
Hildegard
0 1 0 9
asked 07 September, 2021