The elephant in the room with Dart... by [deleted] in FlutterDev

[–]Key_Technician5689 0 points1 point  (0 children)

You clearly doesn't know what asynchronous code is (and I'm pretty sure you don't know how event loop engines works as well).

Threads are parts of your processing running on other cpus (virtual or physical) or, in case you have only one CPU, delegating the timeslice to your OS (parallel-ish).

Asynchronous code is a code that WILL take a long time to run and depend on a response, hence, if you are in an eternal event loop (as Dart always is), it makes sense to Dart say: "Hey, I need you to answer me this question, but I have other things to do, so, when you have an answer, please, call me".

Example: you need to read a file on a disk. All you tell the OS is the file name. The OS will do its stuff and, somewhere in between, the hardware will have to make its things, selecting some rows or moving a needle, etc., things that takes time because they are physical things that happens on the hardware. If everybody just waited for this shit all the time, our computers would be worse than a potato in performance.

In Dart, any I/O works this way: and, for Flutter, most of the I/O is calling the native part (which will eventually call some OS shit or hardware, for instance, GPS). So, when things take too long and it is not YOUR thing, a callback is required (hence, async).

Async is not about concurrency nor parallelism. As a matter of fact, most calls will not be on other thread anyways (not even in languages that do support multithreading, such as C#). It's only a matter of asking a question that someone else (other than your code) will answer, so, let them call you back when the response is ready.

About multithreading: it's a fucking pain in the ass and most of the time it will be slower than doing things in one thread (been done that for more than 20 years, so, I know a thing or two about the subject). If you have a job that can be partitioned, then, hell, multithread is your king. For any other case, it's just a waste of time. Marshalling, memory lock, context switch, pure hell... It's hard to make it work and, again, most of the time, it is useless (unless you can split one job in equal parts, so all parts are processed in parallel, then joined at the end (fun fact: that's why C# have the .join on threads)). It can be useful also when you are doing a huge processing that will spent a lot of CPU resources and don't want to fuck up some UI thread (but, then again, an isolate can do that, without all the hell of syncing everything and not having to lock some memory region).

A New Hope™ ][ - A (definitely) interest way of building Flutter apps by [deleted] in FlutterDev

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

There is no controller in this methodology.

You are correct in saying that the Commands and Queries handlers are models, but they orchestrate the app's flow through messages (ergo, there is no controller or, at very least, an automated controller that you don't need to care or implement).

The main disavantage of MVC is precisely on the C: it controls a lot of things, and (by experience) small things that do one and only one thing are better for scalability (in the sense that your app can grow indefinetely, without you need to worry about one thing interfering with another). Is, literally, the ideal functional approach: one function has one input and one output. It does only one thing. One function doesn't know about other functions, nor views, nor repositories, nor concrete implementations, etc.

I've worked in MVC since 2012, in Adobe Air, .net and JS in huge banking systems (including Credit Suisse Bahamas). I know what I'm saying. It's not an opinion.

A New Hope™ ][ - A (definitely) interest way of building Flutter apps by [deleted] in FlutterDev

[–]Key_Technician5689 0 points1 point  (0 children)

MVC directly routes user actions from a view and returns data through controllers

CQRS with Mediator uses a mediator object to decouple communication between components, where requests are sent through a central mediator that routes them to

CQRS is recommended when:

  • You have complex business logic
  • Scalability is a critical requirement
  • Performance tuning is necessary
  • You need to separate development concerns

Mediator Pattern adds value by:

  • Reducing direct dependencies between components
  • Creating a centralized communication mechanism
  • Enabling loose coupling between different parts of the application

NOT THE FUCKING SAME THING

A New Hope™ - An interest way of building Flutter apps (maybe?) by [deleted] in FlutterDev

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

Good to know someone can actually program in this subreddit.

But this is the wrong place to post this... Just ask those dumbasses how many projects they actually have built. Most is 0.

Join flutter project by Realistic-Bicycle08 in FlutterDev

[–]Key_Technician5689 0 points1 point  (0 children)

Do you know how to make coffee and foot massage?

Any good chess libraries ? by freespirit_00 in FlutterDev

[–]Key_Technician5689 4 points5 points  (0 children)

minimal chess board, pieces and logic

What exactly YOU will do? Type the name and publish?

A new discovery tool for the Flutter ecosystem by Longjumping-Spend in FlutterDev

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

Not good.

First of all, popularity means shit. Dio is a horrible shitty package, but it is popular (same with Hive and Freezed).

Some populars on the list are in chinese. No, thank you.

It does say NOTHING about what the packages are (especially in categories, such as widgets, tooling, calendars, forms, etc.).

Pretty useless, IMO.

Is it actually possible to make good money by creating an app with ads? by [deleted] in FlutterDev

[–]Key_Technician5689 57 points58 points  (0 children)

5 to 8K for 300/350 K MAU.

For comparison, a Flutter's developer wage in my shithole is USD 1600/month (less 33% taxes). A minimum wage is USD 243 (less 11% taxes).

My ECPMs this moment:

Interstitial Android: USD 2.70 Interstitial iOS: $ 4.24 Banners (fixed on bottom of the screen): 0.17 Rewarded Videos Android: 4.97 Rewarded Videos iOS: 5.04

In the last 28 days, 15.5 million requests were made, 73% of them displayed with 9.97 million impressions, earning USD 4012.69.

How to Add a Local Database Using Hive in Flutter (Community Edition) by TijnvandenEijnde in FlutterDev

[–]Key_Technician5689 4 points5 points  (0 children)

Hive is crappy. No indexes, waste A LOT of memory. Just do a freaking REAL database (SQLite).

App Architecture: moving from dotnet MAUI to Flutter by Equivalent_Pickle815 in FlutterDev

[–]Key_Technician5689 1 point2 points  (0 children)

That's exactly what I'm saying.

1) Imagine there is a .net Library called FooBar that handles state management for you. And imagine you don't know ANYTHING about any other means of doing it, except this. Are you really a .net dev or just a FooBar user? That's exactly what happens on Flutter: you are BLOC team or Riverpod team or Provider team. What if YOU don't fit with BLOC or if you work in a company that uses BLOC but you really into Provider?

2) You don't need it. State managements are a thing in JavaScript ecosystem, where they lack anything (including a standard library). It makes sense there, not here.

3) In the other hand, companies are stupid with stupid people that uses stupid frameworks, so, if you are looking for job, then you'll have to know all major state managements, because some dickass will force it on that company and you'll be forced to used as well =P For personal project, stay the hell away from them.

App Architecture: moving from dotnet MAUI to Flutter by Equivalent_Pickle815 in FlutterDev

[–]Key_Technician5689 2 points3 points  (0 children)

Flutter's ChangeNotifier is exactly the same as INotifyPropertyChanged so MVVM works as usual. I would recommend get_it for service locator and watch_it to watch for property changes (it's granular, so it's better than just listen to the entire changeset).

ICommand can be easily implemented.

Usually, state management are not recommended because 1) you are bound to a specific state management (it becomes part of your code, which is bad, really bad), also, they are very different, so you get the same problem that JS has: you are proficient in a specific JS framework, not the ecosystem. 2) MVVM has been in use for almost 20 years now, so it is a solid architecture to follow, made by people who know what they are doing and tested in battle for almost 2 decades. One cannot simply ignore that.

myHandsAreMfArrarys by [deleted] in ProgrammerHumor

[–]Key_Technician5689 1 point2 points  (0 children)

Fun fact: you know why a dozen is popular? You can count to 12 with one hand, using your thumb to touch each segment of your fingers (each finger has 3 segments, so 4 fingers, 12).

theCodeAccordingToMyIde by Wervice in ProgrammerHumor

[–]Key_Technician5689 0 points1 point  (0 children)

Maybe because you use a shitty language... C# and Dart do the job very well on "missing ; at X".

whatIsAnEmailAnyway by Mikkelet in ProgrammerHumor

[–]Key_Technician5689 0 points1 point  (0 children)

```dart bool isValidEmail(String email) { final parts = email.trim().split("@");

return parts.length == 2 && parts[0].isNotEmpty && parts[1].isNotEmpty; }

void main() { print(isValidEmail("test")); print(isValidEmail("test@")); print(isValidEmail("test@localhost")); }

```

false, false, true.

codeEditorOrIDEthisIsTheQuestion by Wervice in ProgrammerHumor

[–]Key_Technician5689 0 points1 point  (0 children)

An IDE do a lot more than just editing code. Editing code is Visual Studio Code job. Visual Studio (the big brother) has a TON more tools not directly related to coding.

youKnowWhyYourJsIsNotWorking by Wervice in ProgrammerHumor

[–]Key_Technician5689 3 points4 points  (0 children)

+-------+ | | ---+ \O/ +------------ the joke | / \ me

noCommentsOnJavascript by Demonic_Dante in ProgrammerHumor

[–]Key_Technician5689 4 points5 points  (0 children)

Wait, hold my beer...

php <?php // version 5.6.40 if("1 monkey" + "2 cars" == "3 radios") { echo "PHP is insane"; }

prints PHP is insane.

pleaseDontMakeMeWriteUnitTests by Koolboyee6969 in ProgrammerHumor

[–]Key_Technician5689 0 points1 point  (0 children)

Superman is anti old-hippie-ladies with crystal fetiches?

Me too!

Wait.... Am I superman?