HaxeFoundation / code-cookbook

The Haxe Code Cookbook - A community driven resource website for learning Haxe in practise
https://code.haxe.org
112 stars 88 forks source link

Wanted articles #49

Open markknol opened 8 years ago

markknol commented 8 years ago

If you are in the mood for writing but don't know what, then you can use this list:

Btw, these titles are suggestions. This list will get updated over time.

nadako commented 8 years ago

How to type Json using typedefs

This one is quite "funny". We even have such example in the manual, but in fact, it's not really safe when it comes to arrays on static targets, e.g.:

var a:Array<Int> = haxe.Json.parse("[1,2,3]")

This compiles (because of Dynamic) but might either fail at runtime or introduce hidden copy-casting, because haxe.Json.parse parses arrays to Array<Dynamic> which isn't really the same as Array<Int> on targets like C# and C++ which try to implement arrays in an efficient way for basic types.

So nowadays I'm doubting that this is something we should promote. At least we should note that particular issue so people are aware of it.

I think @hughsando dealt with this somehow for the newer hxcpp, but this is still an issue in C# (without -D erase-generics).

dstrekelj commented 8 years ago

Alright, seems doable.

But I'm still waiting on someone to approve or review the Stack Overflow documentation changes I proposed! ;)

azrafe7 commented 7 years ago

A couple more things (that I think are highly needed):

azrafe7 commented 7 years ago

I have another request: more macro-related stuff. :+1:

As of writing I'm in the process of trying to learn them, and have found myself with tens of tabs open from various sources (manual (new and old)/blog posts/articles/libs). All of them helpful! But infos are scattered around, and I find myself jumping back and forth trying to collect the missing pieces.

The code cookbook has been particularly helpful so far, I just really wish it had more examples. Please! :stuck_out_tongue:

So... here's a little list of some of the difficulties/confusing-moments I've faced so far (hoping it can serve as hint for more enlightening snippets):

As I said, I've just recently started to make sense of the powerful macro system, and I think that learning from useful examples is the best way.

PS: Someone may object that my points are material for StackOverflow or the MailingList. I agree, but having them explained clearly in the official cookbook is a plus (SO and ML could still link to them).

markknol commented 7 years ago

Those are helpful ideas, thanks! If you want to contribute to one of those topics,feel free to add it.