Coder Social home page Coder Social logo

Comments (4)

smnandre avatar smnandre commented on June 26, 2024

I'm not sure to follow.. the result would be the same right ?

from symfony.

seb-jean avatar seb-jean commented on June 26, 2024

Yes, the result would be the same. But is it better to use shortcode than directly emoji in the code? Is this a good practice? Or is it useless and we leave the emoji in the code?

from symfony.

smnandre avatar smnandre commented on June 26, 2024

In my mind I really don't see why we would need some back and forth with a library to... get the exact same data in the end 😅

But instead using the Emoji component here would require multiple composer packages and a .... certain amount of emoji names translated in every possible variant ...


Regarding "good practices" i have no idea, but.. I let you guess this comparaison before clicking on the results ;)

<?php

echo mb_strlen('🐘') . PHP_EOL;
echo strlen('🐘') . PHP_EOL;
echo PHP_EOL;

echo mb_strlen(':elephant:') . PHP_EOL;
echo strlen(':elephant:') . PHP_EOL;
echo PHP_EOL;

Results: https://3v4l.org/dk4RV#v8.3.8

(note: i post this comparaison just for fun... IRL this difference makes in fact no impact here. and i don't mean "very few" i really mean "no")

from symfony.

smnandre avatar smnandre commented on June 26, 2024

I checked by curiosity: these emojis are here since the component introduction

protected function getDefaultEmoji(): string

from symfony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.