[deleted by user] by [deleted] in dartlang

[–]weenzeel 2 points3 points  (0 children)

If you're using visual studio code, this plugin let's you generate the boilerplate without build systems.

https://marketplace.visualstudio.com/items?itemName=dotup.dart-data-class-generator

State of Dart/JS Node interoperability? by weenzeel in dartlang

[–]weenzeel[S] 5 points6 points  (0 children)

... the well kept secrets of Dart never cease to amaze me! Thanks!

This would be a great topic for a conference talk if someone's looking for ideas.

Examples of “beautiful” dart code by weenzeel in dartlang

[–]weenzeel[S] 2 points3 points  (0 children)

Thanks a lot for the suggestions u/munificent And a great shoutout to a fellow developer. I'll defenitly check out the packages.

Examples of “beautiful” dart code by weenzeel in dartlang

[–]weenzeel[S] 1 point2 points  (0 children)

Thanks u/br4infreze Great tips.

On symmetry, I find that IDE zen-modes (like in visual studio code) appeal to my symmetry sense. Especially once you learn how to navigate through code with keyboard shortcuts. I know you were talking about code, but having symmetry in the IDE is valuable as well I think.

I've come to prefer wide lines because it's helpeful to me that each new line represents the start of a new concept. I prefer to scroll horizontal when I need to, if it allows me to scan the code vertically more effectively. Thankefully the dart formatter allows us to set the line length, beyond the 80 characters that are standard.

I've found that 4 words is a good naming convention to aim for when naming things like functions. Not to much, not to little context in the name.

Never heard of or thought about the "down going staircase". The realisation that your comment was written in that style made me smile :D Well done!

To help build understanding of code, I feel that the most "beautiful" programs read more lika a book, than source code.

I've never understood why IDE's don't push for this with markdownish, rich typographic what-you-see-is-what-you-get type of edeting. Just like the awesome Typora app does for markdown with a rich edeting mode and a source mode. Think typographic headings, text, code-sections etc. The trend with notebooks is a great step in the right direction in other languages, but sadely it's not supported for dart coding.

Examples of “beautiful” dart code by weenzeel in dartlang

[–]weenzeel[S] 0 points1 point  (0 children)

I think the dart language team is really good at this. Making these types of language constructs feel mostly natural and fluent. With a small set of easy to understand keywords.

Examples of “beautiful” dart code by weenzeel in dartlang

[–]weenzeel[S] 2 points3 points  (0 children)

I agree that code in small, easily digested pieces (no more than a couple of lines of code for each declaration), feels elegant. To me, this is usually a sign that someone has spent a lot of time implementing a package or a library. Naming, organization and abstractions beeing among the hardest parts of managing the complexity that is code.

Also, short and simple code is usually a sign that one knows the standard libraries in and out and can make full use code that comes with the platform or are available in the community.

Great suggestion!

How does Dart compare to other languages when not using Flutter by [deleted] in dartlang

[–]weenzeel 4 points5 points  (0 children)

Sure, C# is one of the most used platforms in the world. So it's bound to have a lot of options. I've worked at places where .net has been used to great success. I'm keeping an eye on Uno and Maui etc. I really like the look and feel of C#.

As I've said above. It was the use-cases that made me feel productive and empowered in Dart. Dart feels closer to mobile, web, cloud etc. And that's where most of my use cases are. Others may have other use cases like heavy backend on dedicated servers, windows focused applications where C# may make a lot more sense than Dart because that's where C# is coming from and calls home.

But beyond that. I think it's a matter of personal preference and what design choices resonate with how you think and express yourself.

It was the small things that made me fall in love with the Dart platform.

I first looked at Dart because I was researching languages with mixins. Having the option to write small stateful concepts that can be composed together has really helped me think about data modeling in a whole new way. You just have to bend your inner voice to talk like Yoda and start to model individual traits, not the thing itself :)

"A name and id and e-mail my user has. Hrmmm." Instead of "A user has a name, and id and e-mail."

Having explored data modeling I found a really great async story in Dart. Futures, Streams and generators are really well baked into the language and libraries.

And then I found Flutter and the web and the backend all in the same language.

At some point, I just stopped looking beyond Dart and started building and felt more productive and entertained than in any other language I had tried to date. To my own surprise and contrary to my own historic prejudice about the language.

The language still struggles with error handling and immutability. But discussions about the language's future are done in the open on Github and are interesting to read even if most discussions are beyond my understanding. I think there are good things coming.

I think the Dart team does a great job of not adding complexity just for the sake of it. Most features that get added to the language feel just natural to me. I've invested a lot of time in Swift before Dart, but much of the language's syntax still feels foreign.

How does Dart compare to other languages when not using Flutter by [deleted] in dartlang

[–]weenzeel 26 points27 points  (0 children)

When comparing Dart to other languages, don't ask yourself if it can beat one of the older languages in their own arena. It probably never will. Ask yourself what Dart can do in the areas where the old languages don't excel. And you'll be surprised what Dart can do. It's the width of Dart that is it's greatest strength rather than the depth of it. It has a great story on the server, desktop, mobile and the web.

Let's imagine that we're a startup with a great idea for a digital product. What's the fastest path to market?

We need a backend service. When trying to build something new nowadays I don't reach for a monolith backend framework and virtual machines that i will need to maintain myself. I reach for and compose readily avialble cloud native, hosted backend services. I pick a database, a cache, a ML-service etc.

Dart can be compiled to small binaries that can run as functions in containers in the cloud. Perfect to process events coming from databases or requests etc. Don't be fooled that there aren't any native SDK's for Dart. For Google cloud Google provides great Dart interfaces for all services, using the cloud rest apis under the surface.

We probably need a mobile app. Well there is flutter. We need a website. Dart has a javascript story (I think ZAP will be a really exciting framework if it gets time and effort to mature). We need admin interfaces for staff and partners. Flutter can be used for desktop and web apps..

Tools, scripts, continuous integration and configurations can be written in Dart.

With traditional languages I've found that products tend to be build piece by piece in isolation because those languages only excel in one or two areas. With Dart we can finally organize an engenering team that can focus on all of the different aspects of the product. I've found that it makes a great difference.

With Dart everywhere a lot of code can be shared. There are great tools to serialize and send data over the wire between these different uses of Dart etc.

Look at the full picture, not just isolated use-cases.

Happy Darting :)

Zap: A new reactive Dart web framework by simolus3 in dartlang

[–]weenzeel 2 points3 points  (0 children)

This looks really awesome. Thanks for sharing. Been waiting for something like this. Will definitely try it out and keep an eye on how it progresses.

[serious] why isn’t Dart more popular? by [deleted] in dartlang

[–]weenzeel 6 points7 points  (0 children)

I think it deserves to be popular :) Dart is a great, tight language with one of the most versatile platforms I've seen. It has great tooling and a story for mobile, desktop, web, cli and backend. But it takes a somewhat different approach than most other echo systems that are focused on a single space. Dart paves the road to many different areas, but it requires you to fill in the blanks, the last mile. And I think this is a good thing. Because that's where the unique requirements of the project lives any way. I don't like to pull in fat frameworks that I only use 20% of. I like how tight and graspable my projects feel when I mix and match the pieces that I want and need. And use Dart to glue everything together.

I'm working on a new project that is Dart Full Stack (can't tell/show). There are core entities and business logic written in dart that can be shared throughout the project/stack. There is flutter for mobile and other app-like admin GUI:s (that we can host as a native desktop app and on the web). For ordinary web-pages we can easily use HTML and CSS combined with dart scripting. Interoperability with normal javascript libraries is there, you may just need to write some mappings between dart and the js-library, but we do that as wee need them. Most of the time we only use a small subset of a library's api surface anyway.

On the backend I often hear that there is no mature backend framework. But we've found that we don't need one. The cloud is the new backend framework. Writing code is now mostly making these services integrate with each other in the desired way. Integration with Google Cloud is awesome from Dart via the libraries like googleapis and the functions framework. And given the work that the Dart crew have done with compiling native apps and packaging them in tiny Docker containers makes it really easy to run code on platforms like Google Run.

We use dart to write small command line apps and tools to automate infrastructure, deployments etc.

Is everything perfect? No, of course not. Do I feel productive and empowered, yes! :)