Глобальная область видимости в JavaScript

Как любой другой язык программирования, JavaScript позволяет создавать элементы доступные в любом месте приложения. И, как и с другими механизмами, JS тут имеет свои уникальные, но важные особенности, которые мы подробно сейчас рассмотрим. Глобальная область видимости может принимать различные формы в зависимости от того как загружаются код JS ... Какие ещё формы?

https://habr.com/ru/articles/994816/

#javascript #nodejs #var #let #const

Глобальная область видимости в JavaScript

Как любой другой язык программирования, JavaScript позволяет создавать элементы доступные в любом месте приложения. И, как и с другими механизмами, JS тут имеет свои уникальные, но важные особенности,...

Хабр

Всплытие переменных и функций в JavaScript

В JavaScript есть уникальная особенность, переменную или функцию можно использовать по коду выше, её объявление... Ииии что это за особенность?

https://habr.com/ru/articles/989458/

#javascript #nodejs #let #var #const #function #функции

Всплытие переменных и функций в JavaScript

В JavaScript есть уникальная особенность, переменную или функцию можно использовать по коду выше, её объявление: greeting() function greeting() {     console.log('Привет Васятка!') } И это...

Хабр

Tras explicar qúe son las constantes en Go y los tipos de datos que ofrece el lenguaje, llega el momento de unir ambos conceptos. En este artículo veremos cómo Go vincula constantes y tipos de datos.

https://www.lateclaescape.com/post/2026/golang-typed-const/

#LaTeclaESC #golang #const

Este articulo explica qué son las constantes en Go, cómo se declaran y en qué situaciones aportan claridad y seguridad al código.

#LaTeclaESC #Golang #const

https://www.lateclaescape.com/post/2026/golang-const/

Обзор утилиты TunerPro

TunerPRO это бесплатный бинарный редактор прошивок. Это аналог STM32Studio. Эта программа позволит вам редактировать константы в готовом bin файле. Минуя стадию повторной пере сборки всего проекта прошивки. Можно сказать, что TunerPRO хакерская tool-а. Эта утилита связывает в едино всю информацию про переменные. Это адрес ячейки памяти в bin-аре, размерность переменной, размер параметра, формат ее хранения в памяти, имя переменной, множитель, единицу измерения, максимальное и минимальное значение. В то время как map файл дает только инфу про имя адрес в памяти и размер.

https://habr.com/ru/articles/965828/

#TunerPro #STM32Studio #bin #xdf #Tuner_PRO #stm32 #const #volatile #volatile_const #flashпамять

Обзор утилиты TunerPro

" Когда сами константы становятся переменными. " Пролог В этом тексте я расскажу про одну полезную и широко распространенную утилиту для калибровки микроконтроллерных прошивок под названием TunerPRO ....

Хабр

И ещё немного про то, что const в dart надо ставить где попало

В статье рассказал про случай из реальной жизни, когда использование const и линтера на него помогли бы мне сэкономить полдня рабочего времени и сохранить нервы

https://habr.com/ru/articles/948074/

#Flutter #dart #dartdefine #const

И ещё немного про то, что const в dart надо ставить где попало

Дисклеймер: я все-таки надеюсь, что вы понимаете, для чего и где следует ставить const в dart. Одним вечером я настраивал сборку приложения с переменными для хранения ключей API. Использовал...

Хабр

関数スコープとブロックスコープ (PHPはなぜ var, let, const がない?アロー関数はブロックがない?)
https://qiita.com/Jim_Jin/items/8135b4e85b233ec34d13?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items

#qiita #PHP #変数 #スコープ #const #アロー関数

関数スコープとブロックスコープ (PHPはなぜ var, let, const がない?アロー関数はブロックがない?) - Qiita

はじめに文法上の系譜で分類すると、C系統の言語があります。C、C++、C#、Java、JavaScript、PHPは、Cの文法的スタイルを受け継いだ言語であり、C系統の言語と呼ばれます。多くの方…

Qiita
Make C string literals const?

Martin Uecker has started a new initiative to ensure a better const contract for C2y: change the type of string literals to a const-qualified base type, much as it is already the case in C++. Compi…

Jens Gustedt's Blog
🌘 C 字串常數是否應設為 const?
➤ 評估 C2y 標準中字串常數 const 限制的影響
https://gustedt.wordpress.com/2025/04/06/make-c-string-literals-const/
Jens Gustedt 的部落格文章探討了在 C2y 標準中,是否應將字串常數的類型改為 const-qualified 的基本類型,如同 C++ 所做的一樣。雖然編譯器早已支援此功能,甚至有些預設啟用,但這仍屬於標準規範的變更,可能對現有程式碼造成影響。作者呼籲社羣提供回饋,特別是那些已經使用相關選項(如 gcc 的 -Wwrite-strings)或測試過此變更影響的專案,以便評估此變更的影響程度。作者強調需要的是實際數據而非主觀意見,並要求提供專案的相關資訊。
+ 「這個改變聽起來很有道理,能更早發現潛在的錯誤,但不知道會不會影響到一些舊的程式碼。」
+ 「我很好奇有多少專案實際上會受到影響,而且需要花費多少精力來適應這個變更。」
#C 程式語言 #C2y #const 限制
Make C string literals const?

Martin Uecker has started a new initiative to ensure a better const contract for C2y: change the type of string literals to a const-qualified base type, much as it is already the case in C++. Compi…

Jens Gustedt's Blog

@katlyn generic as can be  it's still in theory & planning but i'd like to make something somewhere between a mix of Jai and Kotlin, essentially a quite low level language with a syntax more typical of a high level language.

There are a couple neat features that I plan on having, one is automatic callsite syntax variants for functions, where a function definition func(a, b) can be called in any supported syntax style; procedural (func(a, b)), OOP (a.func(b)), infix if it has exactly 2 arguments (a func b), etc.

Functions are first-class members (now that i've touched a language with it, I can't stand any language without it) and can appear in any place any other variable may appear

Here's a bit of sample for my ideas so far

//Syntax not final

numberOfBoops: Int = 1234 //Mutable variable declared and re-declared with = operator
numberOfBoops = 999999 //Cannot redeclare type
millionBoops = numberOfBoops + 1 //Type specification optional; when not specified, type will be inferred as narrowest type returned by expression (here, Int)

billionBoops: Int := 1000000000 //Immutable declarations use := operator
billionBoops = 1 //Compile error, cannot reassign immutable declaration

PI: Double #const := 3.14159265359 //'const' declarations may be optimized by compiler to inline at use-sites instead of appearing in heap memory
TAU #const := PI * 2.0 //Type is optional for all declarations; will be inferred as the narrowest type of the expression (here being a Double)

myCoolNumber: Int //uninitialized variable, must be initialized before appearing in any read position

main := () { /*statements*/ } //skeleton of function declaration syntax. No return type
getCoolNumber := () -> Int { return 420 } //function with return type

myCoolNumber = getCoolNumber() //initialize previously uninitialized variable, now it can be used

plus := (a: Int, b: Int) -> Int { a + b } //function with parameters and return type; 'return' may be omitted if last expression of function scope is of return type
myCoolerNumber := myCoolNumber plus 69 //infix call to 'plus'. Immutable declarations can be made from mutable expressions

myCoolestNumber: Int #const := myCoolerNumber + 1337 //Compile error, const declarations can only be constructed with literals and other const expressions

fold := <T, E>(elements: Iterable<E>, initial: T, op: (T, E) -> T) -> T { //function declaration with generic types T and E
accumulator = initial //Function parameters are always immutable, redeclare 'initial' with mutable variable
itr := elements.iterator() //function 'iterator := <E>(Iterable<E>) -> Iterator<E>' defined in Iterable class
while(itr.hasNext()) {
item := itr.next() //Immutable variables can be defined once per iteration of any scope ({}) so 'item' may be immutable here
accumulator = accumulator op item //Infix notation of 'op' function
}
return accumulator
}

sum := (values: Iterable<Int>)[fold, plus] -> Int { //optional brackets is a closure: if present, only variables in wider scope listed inside brackets may be referenced (here being the 'fold' and 'plus' function)
return values.fold(0, (acc, next){acc plus next}) //anonymous function provided as 'op' first-class function parameter to 'fold' function. Parameter types and return type inferred by 'fold' declaration
}