Gavin Jones · @gavtron
12 followers · 43 posts · Server mstdn.social

are surprisingly flexible and powerful. I’ve re-written my navigation path to use an enum with associated values. It means:
* Multiple destinations for the same object (eg: a game view, edit game view, and game summary: all presenting a Game object).
* Simple state restoration via Codable conformance and scene storage.

#enums #swift

Last updated 1 year ago

Pavel Zaněk · @zanekpavel
7 followers · 26 posts · Server mastodonczech.cz

Harness the power of in Laravel with PHP 8.1's native enumerations. v8.69 supports this, enhancing code cleanliness and efficiency. For a Post model with a 'status' attribute, define an Enum class, PostStatus, instead of using strings like 'draft', 'in_review', 'published'... Laravel's $casts property in the model converts these status values to Enums. Laravel also provides an Enum rule for form request validation. Embrace Enums for excellence and performance in Laravel projects.

#enums #laravel

Last updated 1 year ago

@hazz223 related warm recommendation… the video about the downsides of in and how to deal with it

youtube-nocookie.com/embed/jjM

#typescript #enums

Last updated 1 year ago

Sean Murthy · @smurthys
148 followers · 1710 posts · Server hachyderm.io

C programmers, please help me figure out something:

Since C23, a C enum may be declared to have a specific underlying type, as in the following example. My question is, how can I find the underlying type of such an enum? (C++11's std::underlying_type trait gets me this information.) 🙏

```C
enum Size : char { small, medium, large );
```

Code example in C++ and C: sigcpp.godbolt.org/z/eo7Tdqaeb

C enum: en.cppreference.com/w/c/langua

#question #c #programming #cpp #cplusplus #enumerations #enums

Last updated 1 year ago

EllisGL · @ellisgl
152 followers · 858 posts · Server phpc.social

You can't extend , but you can have them implement an interface:

```PHP
<?php
interface TypeEnumInterface {}

enum AType: string implements TypeEnumInterface
{
case A = 'A';
case B = 'B';
}

enum BType: string implements TypeEnumInterface
{
case A = '1';
case B = '2';
}

function tester(TypeEnumInterface $x) {
if ($x instanceof AType) {
echo 'Was AType: ' . $x->value;
}

if ($x instanceof BType) {
echo 'Was BType: ' . $x->value;
}
}

tester(BType::A);
```

#php #enums

Last updated 1 year ago

Frank Delporte · @frankdelporte
607 followers · 548 posts · Server foojay.social

I created a demonstrating the code examples from an earlier post: "Hidden Beauties of ".

Video: youtube.com/watch?v=U09ZQ3kjuq

Blog post: webtechie.be/post/2023-03-22-h

Behind the scenes: still some work to do on my green screen as I'm not really happy with the final keying result. And you may hear some snoring in the background. That's our dog Wifi who was sleeping, really behind the scenes, as you can see in the picture ;-)

#video #blog #java #enums

Last updated 1 year ago

scottkeckwarren · @scottkeckwarren
20 followers · 200 posts · Server phpc.social

#enums #php

Last updated 1 year ago

Frank Delporte · @frankdelporte
597 followers · 498 posts · Server foojay.social

Published a new : "Let’s take a look at the power and beauty of what can provide…" in which I explain how I use enums in various projects, even as some kind of "database" with the various @RaspberryPi boards.

webtechie.be/post/2023-03-22-h

#blog #java #enums

Last updated 1 year ago

ergo · @husbandpanda
65 followers · 372 posts · Server mstdn.party

day. ! Took a day off yesterday to let brain process, now to continue the learning

#rust #enums

Last updated 2 years ago

ergo · @husbandpanda
61 followers · 325 posts · Server mstdn.party

- and are the basis of what I'm trying to do I think, so....good direction! Unlike , this part actually makes sense for me.

#rust #structs #enums #ownership

Last updated 2 years ago

Shikiryu · @shikiryu
47 followers · 118 posts · Server oisaur.com

: Best practice of using PHP Enums! links.shikiryu.com/shaare/3S7d

#shaarli #php8 #enums

Last updated 2 years ago

Jack Lenchantin · @jackalope
13 followers · 13 posts · Server meow.social

Creating a pronoun enumerator with matching word functions for my app.

You'd think there was a php library for it somewhere to save me a bit of time, but I haven't been able to find anything so far. :/

In other news: ***annoyed rabbit noises***

#yourentireITdepartmentarefurries #furry #programming #nerd #laravel #enums #php

Last updated 2 years ago

Kushal Das :python: :tor: · @kushal
1487 followers · 2591 posts · Server toots.dgplug.org

Morning task: writing the in and then use them from inside of Python code.

#python #enums #rustlang

Last updated 2 years ago

Jan Veen ❌ · @F1rst_Unicorn
16 followers · 928 posts · Server mastodon.3fx.ch

Oh, wir haben es hier wohl mit einer impliziten Annahme über das Format eines Strings zu tun. Kann man nix machen. Muss man fixen.

#enums #toldyouso

Last updated 4 years ago