[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

this is why programming languages need to be braindead simple

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 2

File: fuck you idiots.png (11KB, 967x141px) Image search: [Google]
fuck you idiots.png
11KB, 967x141px
this is why programming languages need to be braindead simple with as few features as possible.
people are too fucking stupid to write simple code.
It's a goddamn cmdline parser and you manage to add a required callback and motherfucking weirdass generic shit into it.
I literally have years of professional c# dev experience and I can barely figure out how to fucking call this shit.
How hard is it to just return the goddamn object? But NO

> only idiots criticise golang's lack of generics = fact
>>
Install ghc
>>
>>59509745

I did, haskell has no good IDE, no debugger, no libraries, no community and is probably slower than java.
>>
>>59509729
>this is why not everyone should be allowed to program
ftfy
>>
There's nothing wrong with the parser, you're just retarded.
>>
I agree with you OP. I like the general principles of programming in a side effect free way, but after maintaining too many projects over the years I've come to learn that most developers are functionally retarded and can't be trusted with even the most basic language features. So Go is really the best way to prevent this shit.

It doesn't stop devs from being retarded but it makes it much easier to come in, read their code, understand it, then fix it. Which is such a fucking boon compared to programming in C++ or Java where you have to track down the inheritance chain and figure what your base classes are and where it's mutated and etc. Go code is easy to delete code.

Although personally I still want generics.
>>
>>59509729
use CLAP man.
>>
>>59509790
>I like Go because it's primitive
You might as well use C.
>>
>>59509817

I do use C.
>>
File: mai waifu.png (94KB, 298x440px) Image search: [Google]
mai waifu.png
94KB, 298x440px
there is an answer
>>
>>59509790

yeah, c++ projects to me are basically dead code as soon as they are written. At least with java or c# or most other languages you can edit/compile quickly to figure stuff out but with c++, once you finally get to be able to compile it all, it takes 15 seconds (best case) every time you make any change.
Modern c++ is basically perl or worse at this point, utter madness, just reading their weird new additions I've never even heard of turns my stomach. I tried to find the link to that new c++ feature, it's called something like "left values" or "new rvalues" but point is that you just need to look at any codebase that uses boost and try to understand that.
>>
learn c#
>>
>>59509729
This is dead fucking simple. Pass it two lambdas. The first one you pass is run if the parsing is successful, and the second one (your error handler) is called if there's an error.
>>
>>59509975
The documentation is fucking shit mate. You can barely see how many arguments it takes let alone what they are.
>>
>>59509975
This is really not something the parser result object should be handling. These two lambdas have to have a very specific format in order for this to work, as you can see from the image OP posted.

What should happen here is that it raises an error if the parsing fails or just returns some form of empty object. This way the caller has full control of what is going on.

I can't think of any possible excuse for using this programming pattern, except not trusting OP to handle errors unless he is forced to.
Thread posts: 15
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.