#default : failure to fulfill an obligation
- French: défault
- German: der Verzug; Standard
- Italian: default
- Portuguese: padrão
- Spanish: por defecto
------------
Try our new word guessing game @ https://24hippos.com
#default : failure to fulfill an obligation
- French: défault
- German: der Verzug; Standard
- Italian: default
- Portuguese: padrão
- Spanish: por defecto
------------
Try our new word guessing game @ https://24hippos.com
Following up on my previous post https://mastodon.social/@yegorov/116594842832339445 (where I showed how to set default values in Ruby methods), it turns out you can write not just a single expression on the right side, but an entire block of code inside a begin-end construct.
#Ruby #Method #Default #Arguments #KeywordArguments #BeginEnd
If you work with Ruby, you should know that arguments in methods can be set to a default value, for example:
```
def perform(arg: "d")
# .
end
```
But did you know that you can use instance variables as default values, like this:
```
class MyCls
def initialize(arg); @arg = arg; end
def perform(arg = @arg); end
end
```
Or other arguments of this method:
```
module MyMod
def self.perform(a = nil, arg: a); end
end
```
#Ruby #Method #Default #Arguments #KeywordArguments #InstanceVariable
If you work with Ruby, you should know that arguments in methods can be set to a default value, for example:
```
def perform(arg: "d")
# .
end
```
But did you know that you can use instance variables as default values, like this:
```
class MyCls
def initialize(arg); @ARG = arg; end
def perform(arg = @ARG); end
end
```
Or other arguments of this method:
```
module MyMod
def self.perform(a = nil, arg: a); end
end
```
#Ruby #Method #Default #Arguments #KeywordArguments #InstanceVariable
🔴 LIVE NOW ON VORTEX
📻 Vortex Indie 🎸 (Indie pop, indie rock, classic rock)
──────────────
🎵 Default - Wasting My Time
▶️ Écouter / Listen : VorteX [Radio]
https://lesonduvortex.net
💬 Join us on Discord:
https://discord.gg/d82hJZBeDE
America’s Broken Politics Are Dragging It Down a Fiscal Black Hole.
Delaying action on the nearly $ 40 trillion U.S. #debt risks making solutions unworkable, raising the chance of #default or #inflation as #deficits keep growing.
https://www.bloomberg.com/opinion/articles/2026-04-29/america-s-broken-politics-are-dragging-it-down-a-fiscal-black-hole?cmpid=eveus&utm_campaign=eveus&utm_medium=email&utm_source=newsletter&utm_term=260429&utm_content=3991 #deficit
Zugriffsmodifikatoren gehören zu den Grundlagen, die in Java sehr früh wichtig werden. Am Anfang wirken sie oft wie reine Syntax: `public`, `private`, `protected` oder einfach gar nichts. In der Praxis entscheiden sie aber darüber, welche Teile deines Codes von außen benutzt werde...
https://magicmarcy.de/zugriffsmodifikatoren-in-java-verstehen-und-sauber-anwenden
#Zugriffsmodifikatoren #Java #public #private #protected #package-private #default-Zugriff #Sichtbarkeiten #Coding #Programming

Zugriffsmodifikatoren gehören zu den Grundlagen, die in Java sehr früh wichtig werden. Am Anfang wirken sie oft wie reine Syntax: `public`, `private`, `protected` oder einfach gar nichts. In der Praxis entscheiden sie aber darüber, welche Teile deines Codes von außen benutzt werden dürfen und welche nicht. Genau das macht sie so wichtig. Du legst damit fest, wo Verantwortung beginnt und wo sie endet. Wenn du das sauber machst, wird dein Code leichter verständlich, besser wartbar und deutlich robuster.