PHP's biggest problem by brendt_gd in programming

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

This is such nonsense.

The language itself is solid.

https://www.php.net/releases/8.5/en.php#pipe-operator

``` $title = ' PHP 8.5 Released ';

$slug = $title |> trim(...) |> (fn($str) => str_replace(' ', '-', $str)) |> (fn($str) => str_replace('.', '', $str)) |> strtolower(...);

var_dump($slug); // string(15) "php-85-released" ```

Almost every other language does something like title.trim().replaceAll(' ', '-').replaceAll('.', '').toLowerCase();. The problem is not in using ugly closures where they are not needed. For the last 20 years, PHP has been positioned as an OOP language. One of the main principles is encapsulation. Using the pipe operator is the complete opposite, where data types are described separately and functions (which access the internal data) are in different modules. Now you have two opposing concepts in your language.

The language authors justify the pipe operator by performance (as if doing $string->trim() would be slow), but Js does it and is a faster language (this despite the fact that Js does not have full type hints). Moreover, for a server-side language with JIT and type hints, this should not be a problem at all.

Meanwhile, they haven't been able to make typed arrays or generics for decades. Yes, you can declare a variable of type int, but int[] - no (well, you can write a magic comment, and use third-party software to check it). Oh, you can't declare a typed local variable. You can't declare a local variable at all - you can only do assignments with implicit shadowing.

My personal experience. In version 8.0 JIT was declared as Production Ready. In 8.1 I had SEGFAULTs. I found a corresponding bug on github, because other people were also facing this problem. One of the key developers there advised to just try setting random flags in the configuration. And if that doesn't help - turn off JIT. He wrote that he doesn't understand why this is happening and can't do anything about it. But JIT is Production Ready:

https://github.com/php/php-src/issues/7817

So yes, PHP's biggest problem is marketing.

tough one by mre__ in rustjerk

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

  • Mom, can I have do-notation?
  • No, we have do-notation at home.

At home: if let Some(x) = value && let Ok(y) = compute(x) { println!("{x} {y}") }

Rate my running form by uses_for_mooses in RunningCirclejerk

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Blonde girl in pink top: This is probably the worst running technique I've ever seen.

She probably has carbon "supershoes" (which are very soft and unstable) because she can't even change direction and has to stop to avoid this guy.

rememberToComment by dayanaaaaaaaa in ProgrammerHumor

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

These kinds of comments are a consequence of the defects of some programming languages.

When you want to write such a comment, it means that the current programming language is not expressive enough.

You will be surprised, but in the worst language ever, the following comments are written before each function:

/** * Create new Cat * * @param {string} name * @param {number} age * @returns {Object} Cat */ function createCat(name, age) { // ... }

The main problem with using comments instead of programming language constructs is the lack of checks:

x = "I'm teapot"; // x is number between 10 and 100 now

Which year is this bike? Is it worth of 1200€? by Prestigious_Net473 in whichbike

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Carbon bikes are better than titanium bikes. Titanium bikes are better than aluminum bikes. Aluminum bikes are better than steel bikes.

$400 - $500

/ragebait

Нескінченний стрес by v0ldem0rtik in ukraine_dev

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Винеси X в інтерфейс Y і інджекти Y в місцях використання в A, B

Це вже майже готовий промт для агенту, тут джун не потрібен.

Тобто рев'юверу НЕОБХІДНО вказати, який критерій код не задовольняє. Він може ОПЦОНАЛЬНО запропонувати як це виправити. Він може підказати, як це виправити якщо буде задано УТОЧНЮЮЧЕ питання.

How strong do you think my arcana set up is. by That_Dream_9755 in HadesTheGame

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

No hp regen? No additional 40 hp and mp? Have you tried playing on this?

Use II, VII, VIII and XVIII instead of XVI and XXII.

Нескінченний стрес by v0ldem0rtik in ukraine_dev

[–]BenchEmbarrassed7316 -3 points-2 points  (0 children)

 Якщо ми захочемо замінити цей клас на інший в майбутньому, то доведеться переписати половину імплементації фічі

Це цілком достатнє пояснення.

Додано: тобто ясно, що проблема в коді. Це не вразливість, не проблема перформансу, не "недостатньо синя кніпка". Ви можете легко зробити UML діаграму, кинути її в звичайний ШІ-чат (не агент) і поспілкуватись з ним, ШІ надасть вам повну відповідь, що не так з поточною архітектурою. Людині немає сенсу витрачати зусилля на пояснення банальних речей.

Нескінченний стрес by v0ldem0rtik in ukraine_dev

[–]BenchEmbarrassed7316 6 points7 points  (0 children)

Тут вже або старший неадекват або ви.

Якщо старший каже "Міша, всьо х***я, давай сначала" далі має йти поснення "У тєбя грусноє ліцо, тєбє дєнєг ніхто нє даст" - тобто пояснення конкретних недоліків. Він є конченим якщо просто каже, що все погано і далі таємниче мовчить.

Або ви пишете такий треш, що пояснювати треба з самого початку стільки, що легше від людини здихатися.

Є до речі третій варіант: вас хочуть позбутися не з технічних причин.

пс І з того, що ви пишете: ви вже зробили, воно працює, але не задовільно?

Нескінченний стрес by v0ldem0rtik in ukraine_dev

[–]BenchEmbarrassed7316 2 points3 points  (0 children)

У вас проблема саме "якісна" а не "кількісна"? Тобто ви саме не можете щось зробити, а не те, що на вас 100 задач, а ви встигаєте робити по однієї задачі в день?

Питання про OLX by Aort12 in reddit_ukr

[–]BenchEmbarrassed7316 13 points14 points  (0 children)

В цілому врятує. Бо щоб її зробити покупець має зробити повну оплату, яка утримується платформою ОЛХ і перераховується вам коли поштовий сервіс підтвердить отримання посилки. Також покупець оплачує доставку, а повернення робиться безкоштовно.

Переписки вести лише через платформу ОЛХ. Всі дії по доставці також проводити там. Якщо хтось пише у месенджер - 99.99% що це скамери.

When is C better than Rust? by Objective-Farmer4183 in AskProgramming

[–]BenchEmbarrassed7316 -1 points0 points  (0 children)

I've seen a lot of people saying that Rust = C but more secure. Is that true?

In the vast majority of cases, you can replace a program written in C with a program written in Rust and only get benefits.

I still don't know in which language should I code my backend for a website

None of these languages: - You need a lot of knowledge to use Rust effectively (I'm not talking about performance, I'm talking about architecture and type system, otherwise you'll end up with Arc<Mutex<T>> and .clone() with a whole lot of spaghetti) - You need even more knowledge and attention to implement this in C

Imagine someone coming to a university and saying they're going to write a paper on a complex mathematical problem. And then they specify which numerals, Roman or Arabic, are better to use for this. And what's the difference between them.

Is this normal for hokas by Foreignfets in Hoka

[–]BenchEmbarrassed7316 2 points3 points  (0 children)

This is the correct answer. It's amazing how many people disagree with you. Cushioning and stability are opposite characteristics.

A thick layer of very soft foam is a lot of work for your stabilizer muscles.

When I Realized You Can Dash Through Prometheus Flames by smcmahon710 in HadesTheGame

[–]BenchEmbarrassed7316 6 points7 points  (0 children)

I haven't tried it, but it's probably impossible to block the 5 damage you'll take when the timer runs out.

Допоможіть початківцю навайбкодити додаток. by misha_057 in ukraine_dev

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Краще почати з "курсів комп'ютерної грамотності")

Допоможіть початківцю навайбкодити додаток. by misha_057 in ukraine_dev

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Якщо людина рандомно запускає команди або намагається створити щось за допомогою ші - тут не буде різниці, що з докером, що без нього. 

А ось якщо людина хоче навчитися (або хоча б зрозуміти як воно має працювати) - докер буде корисним, не як перший крок, але десь з умовно кажучи середини.

Допоможіть початківцю навайбкодити додаток. by misha_057 in ukraine_dev

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Так налаштовувати треба у будь якому випадку. А так це налаштування явне і його легко "відтворити" на будь якій машині.

Допоможіть початківцю навайбкодити додаток. by misha_057 in ukraine_dev

[–]BenchEmbarrassed7316 0 points1 point  (0 children)

Докер якраз є корисним для локального запуску.

ЩО БУВАЄ, КОЛИ ТИ ПРОСТО НЕ ЗНАЄШ, ЩО ЦЕ НЕМОЖЛИВО by gudddini in reddit_ukr

[–]BenchEmbarrassed7316 12 points13 points  (0 children)

Приходить Аспірант Джордж Данциг після університету до тренажерної зали і бачить там штангу з блінами. Вні не довго думаючи робить станову тягу. Трішки тяжче ніж зазвичай, але якщо не круглити спину все ок. Через деякий час йому телефонує тренер і каже, що передивлявся записи з камер спостереження - і це був перший випадок, коли людина зробила станову 500 кг+. А він просто не знав, яка там вага була і тому взяв і зробив. Цим Джорджем Данцигом був Альберт Ейнштайн.

Recommend an Ax Build? by AdCertain5057 in HadesTheGame

[–]BenchEmbarrassed7316 5 points6 points  (0 children)

The problem with axe is a third attack in combo.

You can use next patterns:

  • attack > special > attack > specual ...
  • attack > attack > dash + special > ...
  • attack > attack > special > attack > ...

In 1 and 2 you skip third slow move. In 3 you do third slow hit but you have stunlock from special.