[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]

/dpt/ - Daily Programming Thread

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: 352
Thread images: 21

File: 111dd098269e80afb5829c1f54351af3.png (564KB, 1024x746px) Image search: [Google]
111dd098269e80afb5829c1f54351af3.png
564KB, 1024x746px
old thread: >>59994465

What are you working on, /g/?
>>
>>60002301
metaprogramming like a lot of topics with the meta prefix, in that it can be difficult to define, some misunderstandings as to the definition lead to a small flamewar between a couple users

>>60002303
calm down man, strength can come from places other than raw masculinity, there's also things like strength of character and intellect

>>60002308
tumbling down tumbling down tumbling down

In all seriousness though a lot of these threads are just angry, bitter 20 somethings, myself included, lashing out at other angry, bitter 20 somethings, all of whom have some form of social or developmental disorder, or even in the lack of a diagnosable condition have typically been labled as 'different' by the society that they grew up in, so they sit in front of their pcs their bitterness and resentment eventually piling up and being poured all over those who remind them of themselves and their own failures, it's quite sad actually

But chans don't have to be about a bunch of angry misanthropes hating themselves and eachother, we can be better than that, there's a lot of intelligence and ingenuity that goes into these threads, we've just gotta sift through some of the bullshit to get to it

The less toxic we are the less toxicity there'll be, until the whole imageboard is actually quite pleasant to visit, makes you feel better about yourself too, having contributed to a discussion or project with other users

>>60002356
I can kind of understand that, just make sure you are cleaning out those registers after you've used them, leakage can be a real problem if you aren't careful
>>
>>60000000
>>
>>60002434
>Who are you quoting, anon?
>>
>>60002434
Reminder to gas anyone who posts frogs or Umaru
>>
>>60002434
>no u
>>
>>60002426
kys
>>
>>60002468
>I don't know what you're talking about!
>>
File: 1492067864196.jpg (49KB, 600x522px) Image search: [Google]
1492067864196.jpg
49KB, 600x522px
>>60002441
>hating umaru
>>
>>60002492
>What did you just say?
>>
File: 1490259898008.png (924KB, 7528x2744px) Image search: [Google]
1490259898008.png
924KB, 7528x2744px
>>
File: umaru happy ending - no sound.webm (511KB, 1280x720px) Image search: [Google]
umaru happy ending - no sound.webm
511KB, 1280x720px
>>60002499
>>
Please continue to program in C so I can continue fuzzing your shitty code for vulns.

Remember that Rust is made by SJWs and therefore is bad.
>>
>>60002501
If I get a retarded one I'm skipping forward by 1 until I land on a non retarded one
>>
>>60002468
>I don't see the text you quoted in that post.
>>
To this helpful anon >>59998088

I found out you can preview latex by doing
C-C C-P C-B
>>
>>60002538
Hello NSA, how's your day?
>>
>>60002538
>He doesn't know any non-trivial rust program requires 'unsafe' blocks
>>
>>60002501
Weren't (You)s disabled? or was that some other board
>>
>>60002538
kek

In all honesty though, Rust needs a whole lot of polishing. I tried to like rust but it has just too much syntax.
Maybe D spoiled me.
>>
>>60002538
This is why I use Ada, tbqh.
>>
>>60002501
roll
>>
>>60002501
rawling
>>
>>60002585
No it doesn't. Also unsafe blocks are designed to safely interface with the rest of the program.
>>
>>60002538
>>60002593
>>60002605
I don't see how C putting the impetus on developers to be responsible makes C a bad language. Guns are amazing at what they do, just because some people misuse guns or can't handle them properly doesn't mean guns are ineffective and we should find a better weapon.

Any language that doesn't give you the rope to hang yourself is ultimately too limited
>>
>>60002489
How is strength of character inherently masculine? Sure popular culture might have linked the two via action films, John McClaine comes to mind immediately as both an old-school ass kicker, and a character who stares down seemingly insurmountable odds, but this doesn't inherently correlate to one's character implying masculinity, you've got character if you can fight cancer with a brave face, but chemotherapy isn't exactly steroids, and you're going to come out the other side looking like a concentration camp survivor.

Intellect on the other hand makes even less sense, as predicating on the pop-culture reference from before, if anything those with intelligence are considered immasculine, to be some sort of bookish nerd is to be physically weak and socially inept, to fail to meet the traditional ideals of the male role in society.
>>
>>60002626
>the gun analogy
I wouldn't carry a gun with no safety locks in my pocket when my kids are around.
>>
>>60002489
Somebody hasn't played Horizon Zero Dawn.
>>
>>60002645
>I don't see how C putting the impetus on developers to be responsible makes C a bad language

the impetus is on you to be responsible with your gun. What you said isn't an argument against the analogy.
>>
>>60002626
>Any language that doesn't give you the rope to hang yourself is ultimately too limited
Rust isn't one of them. Also that so-called rope is a niche requirement
>>
Posted in the last thread but I guess it's ending so I'll repost here.

I've been making plugins for awhile for a program that uses C# as the supported scripting/plugin language, and I'm looking for the answer to a question I've had for awhile now.

In C#, is there really no way to manipulate(store, alter, or assign) class instance member variables without using their actual identifiers? Assume you're working with code/classes/structures in someone else's running application and redesigning the classes isn't an option.

For example, in C++, C, etc. you can do this kind of thing indirectly with pointers and references. In Python, you can make use of functions like getattr, setattr, and dir.

Does C# simply not offer this level of abstraction? If for some reason I'm forced to work with someone else's named member variable laden code where even simple things like position vectors can't be treated as a numbered array, do I have no choice but to write the specific class instance and member variable names(i.e. Book.Author) every time I want to do something significant to actual instances of data structures?

Related, a simpler question: is there no way to store references in an array/list/any container in C#?
>>
>>60002626
Guns have safely features, so that's a bit tortured. Also, Ada can do everything C can.
>>
>>60002645
don't put a gun in your pocket

I understand it's an analogy, hyperbole, whatever, just don't do this, this is a BAD idea
>>
>>60002656
>be responsible with your gun
Which is why my gun has safety locks. Is this even a debate?
>>
>>60002663
I wasn't specificaly talking about Rust sorry, not informed enough to have an opinion. I know plenty about C though and I think it's silly people use 'you can hurt yourself' as an excuse that it's a bad language somehow
>>
>>60002674
>>60002680
responsible C programmers do bounds checking and implement other safety measures into their code. Yes my argument still holds and it is still a debate please send more.
>>
>>60002501
I'm supposed to write a bootloader. What's a bootloader?

Since i assume it's not a program that loads boots i guess it's a program that load something at boot. But what does it load?

Sorry if this is a stupid question.
>>
>>60002426
gtfo fagot
>>
>>60002696
>Implying perfect programmers
Get a better argument
>>
>>60002703
>He took it seriously
https://en.wikipedia.org/wiki/Booting#BOOT-LOADER
>>
>>60002501
let's go
>>
SOS anyone have a link to that awful connect 4 code that was posted a couple days ago? It had an if statement for every possible configuration of the game
>>
>>60002717
responsible != perfect

learn basic english. Feel free to try again
>>
>>60002696
Bounds checking is built into Rust compiler afaik, it's not anything special. Even though lack of bound checking is the source of many exploits.

I personally think C is good as it is, it just needs a little bit more features and the compilers have to be more strict about dangling pointers etc
>>
>>60002740
Nice mental gymnastics. Come up with an argument that's more advanced than "don't ever make mistakes"
>>
How do you guys estimate how much time would it take to do shit? Especially when you're alone?
>>
>>60002793
Estimate, triple it, add a few weeks.
>>
>>60002769
again, "don't ever make mistakes" isn't the same as being responsible. If this extremely basic conversation has become mental gymnastics to you that's telling.

I'm not sure I should bother coming up with a new argument simply because you can't understand the premise of the original
>>
>>60002793
Infinity.
Most of the time, i'm in the ballpark.
>>
>>60002793
if no previous experience on working on similar project, or parts of the new project then just guesstimating in any retarded way. Like find an OSS project that does something similar and divide result of running cloc on it (finding and excluding autogenerated code if applies/possible) by 5000 to get time to implement in weeks.
>>
>>60002401
I'm working on a basic c++ gui. Is basically every object in c++ managed by a smart pointer?

I'm splitting up the interface into modular components. So I've got a class the manages a word document thing and makes it look pretty, so every object within this class has a pointer attached to it. Now my main window which has a bunch of the modular class should basically be a bunch of pointers pointing to each of the class objects?

Is there anything I'm suppose to store on the stack other than ints and strings that are quickly used then go out of scope in functions that calculate stuff?
>>
File: spurdorokka.png (8KB, 380x591px) Image search: [Google]
spurdorokka.png
8KB, 380x591px
>>60002501
:3333 _DD
>>
Both rust and go has nice official developer plugins. For rust, they have cargo, rust language server, rustup etc.

What it does is simplifies IDE support. Technologies like this enable you to add language support to your favorite IDE. I'll give the credit where it's due so thanks Microsoft for the open source language server standard. Now the IDEs don't have to worry about making their own plugins for each language.
>>
>>60002793
I use the shitstorm anal blister that is Scrum/Kanban. It's what any actualy 'Agile' (fuck that word) companies claim to be proficient in.

trello.com is a free implementation.
>>
File: 1485951215266s.jpg (7KB, 250x214px) Image search: [Google]
1485951215266s.jpg
7KB, 250x214px
>>60002764
> the compilers have to be more strict about dangling pointers etc
the thing about C is that a lot of users consider the lack of compiler strictness or uniformity about undefined behaviour to be a feature

UB is almost as much a part of C as the standard itself
>>
>>60002845
>He can't understand making and using his own safety features requires never messing them up, because the compiler definitely won't help you. Leading to a sleeping bug you will never notice until 10 years later when a zero day hits your server.
Kys
>>
>>60002401
Installing a program on Ubuntu that's not in the software center.
>>
>>60002845
"Being responsible" is effectively the same as "don't ever make mistakes"

Unless you provide concrete steps to "being a responsible c programmer", all you are doing is rephrasing a truism.
>>
>>60002538

>made by SJWs

wuh, really?
>>
File: 1463928328626.png (219KB, 649x499px) Image search: [Google]
1463928328626.png
219KB, 649x499px
>>60002897
>UB is almost as much a part of C as the standard itself
That's why I stay away from C. The existence of undefined behaviors imply that the language creators left it unfinished.
>>
>>60002918
>"Being responsible" is effectively the same as "don't ever make mistakes"
I'm going to call that a bit of a stretch and that is an understatement.

are you really so thick that doing things like checking the length of arrays, buffers, and size of input/variables is something that needs to be spelled out? If you really want I can provide you with some best practices documentation otherwise it's not a secret lad.
>>
>>60002845
How can you be responsible if your code has lead to bugs and security vulnerabilities in the software that people use?
>>
>>60002867
Scrum estimating is kinda hard when you're alona or even there is 2 of you.
I don't think trello has implemented estimating poker, it's just boards
>>
>>60002956
>buffer overflows are the only class of exploits that exist
>>
>>60002960
this is a stupid question?

if you were responsible when coding you wouldn't have bugs and vulns in your code to begin with you dongoloid. If you choose to write shit code and publish it then the only thing your responsible for is paying up for your customer's losses.
>>
>>60002960
Responsible programmers don't write vulnerabilities.
>>
>>60002971
>cant extrapolate from an incomplete set

oh, do I need to list every possible type of exploit or do you have your big boy diaper on already and you can just infer for yourself what they'd be?
>>
>>60002974
>>60002978
So there are no responsible C programmers in existence
>>
>>60002997
Yes.
>>
>>60002401
what prog lang would be used to run Jenny
>>
>>60003004
Just confirming
>>
>>60002997
>>60003004
found the Java developers
>>
>>60002993
Some vulnerabilities are very complex and aren't going to simply be prevented with static analysis tools to check the size of arrays/buffers, it's not that simple
>>
>>60002858
>Is basically every object in c++ managed by a smart pointer?
Eh, wat? No.
You're responsible for managing objects yourself. There's a smart pointer implementation in stl, iirc, but if you want to use that you're still responsible for initiating that on object creation.
>>
>>60002974
No one chooses to write shit code. Except for Linus maybe
>>
>>60003030
do you know what the word extrapolate means?

ex-trap-o-late

look it up you clown :)
>>
>>60003019
Found the baby duck. Also, no one's mentioned Java.
>>
>>60003054
"It's almost like people bash on something more popular to feel superior"
>>
>>60003027
Did I imply it was simple? Does my listing of one type of vuln mean there are no others? Does it mean there are not other scenarios?

What kind of stupid world do you live in to have logic like this that forms the basis of your arguments
>>
>>60003047
I find it vaguely annoying that you think 'trap' is a syllable.
>>
>>60003087
it's 4chan you nigger traps are life here.
>>
File: 1463174335918.jpg (98KB, 865x924px) Image search: [Google]
1463174335918.jpg
98KB, 865x924px
>>60003047
traps make the best programmers
>>
>>60003066
>Did I imply it was simple
Yes, by stating the truism "just be responsible and there won't be any vulnerable code", you implied that preventing vulnerable code is as simple as basic static analysis and bounds checking.

I see that you're not interested in having a discussion, only battling for fleeting moments of superiority, though, so have fun ;)
>>
>>60003123
[citation needed]
>>
File: 1468765719270.png (127KB, 503x467px) Image search: [Google]
1468765719270.png
127KB, 503x467px
>>60003087
I'm attracted to skinny traps and THICC women

On a scale of 1-10, how degenerate am I?
>>
>>60003030
specific to linear algebra:
https://en.wikipedia.org/wiki/Orthonormal_basis#Incomplete_orthogonal_sets

otherwise, in other fields an incomplete set is a set which can have implied elements based on certain inferences or other measures
>>
>>60003137
again no. being responsible means take extra time to implement safety measures, put code through proper Q&A and auditing, testing for bugs and vulnerabilites, going through UAT.

just because you are simple and cant think about things in a grander fashion doesn't mean that is what I am positing.
>>
>>60003197
>safety measures, put code through proper Q&A and auditing, testing for bugs and vulnerabilites, going through UAT.

And even with all those things we still see vulnerable software in the wild

wow it's almost as if "being responsible" isn't enough
>>
>>60003146
I don't give a fuck about what you're attracted to.
Just syllabicate properly.
>>
File: c-strikes-again.png (60KB, 925x697px) Image search: [Google]
c-strikes-again.png
60KB, 925x697px
https://github.com/sandstorm-io/capnproto/blob/master/security-advisories/2017-04-17-0-apple-clang-elides-bounds-check.md
Another day, another tricky vulnerability in seemingly correct C(++) code.
>>
>>60003197
>implement safety measures
How is this not equivalent to "just drive better xd"?
>>
>>60003248
Let me make a thread just for shits and giggles.

I'm sorry akari-bbs anon but C is actually quite shitty
>>
>>60002501
lole
>>
Too many regulars killed these threads. Get a life you fucks.
>>
>>60003219
>b-but we still see problems I win!
go ahead and describe to me a scenario in which the life cycle of real world industry software is not iterative? Openssl has a mess of vulns, is it because C is a bad langauge? No. It's because it never got the funding it needed to be developed properly.

I just realized you don't have any actual argument against how C is inherently a bad language.
>>
>>60003248
>seemingly correct C(++) code
If you're a Pajeet.
It's your own fault for not knowing the language you're using.
>>
>>60003293
C isn't a bad language, it's bad for Software engineering.
>>
>>60003300
That's just a sad and bad damage control
>>
>>60003293
C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things. C is for lesser programmers.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't support dynamic method loading/creating
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry
>>
>>60003366
I recognize this post
>>
http://www.strawpoll.me/12795505
>>
>>60003427
I don't think either are well suite for large programs
>>
>>60003433
suited*
>>
>>60003351
No. You're essentially saying that a language is bad for having false friends(https://en.wikipedia.org/wiki/False_friend) when the real problem is you not knowing the language.
>>
>>60002401
working on a cmus clone in ruby for managing a local anime library
-keeps track of what you havent watched
-play files with mpv/mplayer
-cmuslike format strings
>>
>>60003447
So you are one of those people who thinks a perfect programmer exists and he produces no bugs.
>>
>>60003474
Well, if you know what you are doing you are going to make less bugs.
>>
>>60003465
you haven't watched ghost in the shell?
>>
>>60003492
im rewatching all the ones that aren't airing, just put them n unwatched for demo
>>
>>60003447
>C's not at fault for not defining the most common arithmetic error
Goyim
>>
>>60003491
If you know how to play chess you will never loose a match
If you know how to drive you will never loose a race
If you know how to use a gun you will never miss a terget
By your definition know one knows what he is doing
>>
>>60003519
the anime series was shit 2bh, tried to watch it and couldn't. movie was kino, 2nd movie was ok
>>
>>60002626
C is a bad language because literally the only thing it provides is enough rope to hang yourself.
>>
>>60003012
Pure , virgin C. Ripe for exploitation
>>
>>60003553
Why aren't you banned?
>>
>>60002866
Honestly I just hope this ends the meme of regex for syntax highlighting.
>>
>>60003553
>>60003447
>>
>>60003474
How did you even get that from what i said?

No, i'm one of those people who thinks a retarded programmer who won't even be bothered to learn their craft and then try to shift the blame for their shortcomings onto their tools exist and you're that guy.
>>
>>60003526
>If you know how to play chess you will loose less
>If you know how to drive you will loose less
>If you know how to use a gun you will miss less
If you know what you are doing you are going to make less mistakes.
>>
stop shitposting this meme
>>
>>60002858
There are no pointers in C++ unless you explicitly order one. Objects/structs are allocated on the stack unless you use new, which allocates on the heap and returns a raw pointer to the object.

You can allocate the object with a smart pointer by either giving the pointer from new as an argument to the constructor of an owning smart pointer type, or use a ready-made function like make_unique.
>>
>>60003444
*sauteed
>>
>>60003585
Sorry your definition seems to claim that people that "know" their craft make no bugs.

Which is funny because no one makes a program with zero bugs.

>>60003603
>If you know what you are doing you are going to make less mistakes.
If you know what you are doing and if you use automated tools to help you further you are going to make even less mistakes.
>>
>>60003633
Explain yourself.
>>
>>60003659
How you were dropped on your head as a baby
>>
>>60003366
>C doesn't have delegates
It has function pointers
>C doesn't have resizable arrays
lrn2reallocarray
>C doesn't have strings
It has, and if you're butthurt about \0 you can write another string type
>C doesn't have string concatenation
It has
>C doesn't have namespaces
true
>C doesn't have exception handling
errno, setjmp, sigaction
>C doesn't have closures in the standard
Ok what for?
>C doesn't have unit tests
Ahem.... it's not a language feature anon
>C doesn't have Function overloading
It has explicit function overloading
>C doesn't have memory safety of any kind
What is Segfault?
>C doesn't prevent memory exploits and has no bounds and runtime checks
Write them
>C doesn't support dynamic method loading/creating
tcc exists, and TempleOS has a JIT so it's technically feasible and I'm almost sure I've seen a lib
>C doesn't even have generics and templates
They are shit
>C doesn't have meta programming
Write a code generator
>C doesn't have mixins
Quit bitching and mplement dynamic dispatch as you wish
>C doesn't have higher order functions
true
>C doesn't have contract programming
It has assert
>C doesn't have inner classes
Useless
>C doesn't have function literals
Lambdas? They are nice but not strictly necessary
>C doesn't have array slicing
It has
>C has a very limited support for implicit parallelism
Because parallelism should always be explicit
>C doesn't even have string switches
Would have weirdish hidden costs

Now with this feud resolved, can we go back to programming discussion?
>>
>>60003638
I fucking said no word about "no bugs".
>>
>>60003366
>C doesn't have strings
>C doesn't have string concatenation
string type should have the concatenation built in so seperating those two is retarded just like the post author.
>C doesn't have unit tests
unit tests are not a feature of the language itself and you can have unit tests for C.
>C doesn't have memory safety of any kind
another fucking retarded claim.
>C doesn't have meta programming
metaprogramming is one word faggot
>C doesn't have mixins
C is not an oop language but you can write object oriented code with it
>C doesn't have inner classes
it doesn't have classes at all so it's obvious that there aren't inner classes
>C doesn't have array slicing
top fucking kek

it's so fucking obvious that you are just a retarded javascript codemonkey front-end web developer.
>>
>>60003633
Totally wrong.
>>
Hi,
Are there any good books on Java 8 to get up to date? Or maybe on Java 9? I know it's not released yet.
I need to something I can use more like a reference, so I'm not interested in beginner books. I simply didn't use Java for a long time. Thanks.
>>
File: ULTRA-rage-feels.jpg (106KB, 601x601px) Image search: [Google]
ULTRA-rage-feels.jpg
106KB, 601x601px
>>60003427
why do people keep voting python 3

i hate this, its a clusterfuck
>>
>>60003690
>Segfault as memory safety
Oh my God, wew.
>>
>>60003690
>lrn2reallocarray
What a fucking bullshit excuse, I didn't even read the rest of your post
>>
>>60003690
>What is Segfault?
LOL
>>
>>60003633
I recommend that you look up things you're not informed about before posting.
>>
>>60002501
var fRoll:Function = (::Math) -> random();
>>
>>60003659
Why it would be impossible to allocate structs on the stac, as per your clam, you fucking retard.
Although i carry no hopes for coherent answer anymore.
>>
>>60002501
rolle
>>
>>60003714
Yeah, an IndexOutOfBoundsError is so much better xD
>>
>>60003702
>it's so fucking obvious that you are just a retarded javascript codemonkey front-end web developer.
What kernel have YOU written recently, C fag?
>>
>>60003753
Do you even know what a C struct is?
>>
>>60003753
the meaning of "allocated on the stack" is well understood. why do you have to confuse people who just want to learn to code with your stupid autism.
>>
>>60003758
Kek, the problem is segfaults don't happen when it's valid memory. You can overwrite another object when the code says you are modifying another.
>>
can I make my multi-threaded async file transfer utility faster if I get rid of part checksums? need to make transfers faster /g/
>>
>>60003786
I guess if you're a pajeet that doesn't understand how memory works
>>
>>60003805
t. pajeet
>>
>>60003773
>Linus
What a shitty programmer. Go back to fixing that 15 year old dirty cow bug because you INTENTIONALLY left it out because refactoring is hard in C

Also, enjoying that 20% CPU cycle wastage?
>>
>>60003805
>I got BTFO
>Better call him a pajeet
Embarrassing
>>
>>60003836
>Whom quotest thou??
>>
>>60003836
Ur mum.
>>
Writing my own networking stack (tcp/udp/etc), is that a good idea?
The only options available on my platform are dusty old C libraries.
>>
>>60002667
Not sure if no one knew the answer(not unlikely considering if memory serves C# is(understandably) hated here) but I figured out something that works well enough, if not quite as powerful as simply having pointers to work with. I figured I'd just post the solution I found in case others didn't know the answer.

I haven't tested it much yet but I succeeded in doing some iterative operations that don't require explicit knowledge/use of variable names using functions in System.Reflection like GetField, SetValue, GetValue etc. It feels kind of awkward because even if you DO know the type you're working with beforehand, you have to either use the "var" keyword and/or type-cast values returned by GetValue, but it seems to do the trick.
>>
>>60003853
You should refocus your efforts on using something that runs on top of that stack. You'll enjoy it more :)
>>
>>60003854
>Did this post have a point?
>>
>>60003870
>>60003845
keep this up
>>
>>60003878
>keep this up
>>60003902
>Not that guy, but I think he's making fun of you.
>>
>>60003853
If you have no special reason to roll your own, don't. Besides, isn't networking handled by the kernel? Maybe you can get raw ethernet frames, but you can't coordinate yourself with what the rest of the OS is doing without pain. You've got a better luck giving a hand improving the "dusty old C libraries" you're talking about. And provide context, what's your platform? Networking is so important for 21st century buzzwords that I don't see how what you describe could be happening...
>>
File: 1492785869778.png (214KB, 638x808px) Image search: [Google]
1492785869778.png
214KB, 638x808px
Why aren't banks recruiting hardcore C and Assembly hackers from /g/dpt instead of relying on noobshit languages like Python and Java?
Surely the average $300k salary of a hardcore /dpt/ hacker would yield exponential profit.
>>
Fuck this shit. There's too much autism in this thread. I'm out.
>>
>>60003946
I don't think most of the people here are capable of working productively with others in an office environment. Just look at this board. The office would smell like jars of piss and feces and foot sweat
>>
AS3 is best language
const PRIMES:int = 3000000;
function isPrime(n:int):Boolean
{
if(n <= 1) return false;
var sqN:int = Math.sqrt(n); // Only need to check upto the root of n
for(var i:int = 2; i <= sqN; i++) {
if(n%i==0) return false;
} return true;
} var primes:Vector.<int> = new Vector.<int>;
for(var p:int = 1; p <= PRIMES; p++) {
if(isPrime(p)) primes.push(p);
} var primeSum:Number = 0;
for(var s:int = 0; s < primes.length; s++) {
primeSum += primes[s];
} trace("Sum of the primes upto "+(PRIMES).toString() + ": "); trace(primeSum);
>>
>>60003946
C programmers don't really program anything more than 500 LoC projects these days. C jobs exists only to maintain legacy codebase until a company finally bites the bullet and gets rid of it.
>>
File: 1437276336504.jpg (18KB, 271x200px) Image search: [Google]
1437276336504.jpg
18KB, 271x200px
>>60003985
>unironically using actionscript in 2017
>>
>>60004064
why not? its the greatest language ever, anon
>>
>>60003929
Platform is DPMI (32-bit ms-dos). Also I forgot to mention most of the existing solutions are dusty old 16-bit C libraries.
Getting the ethernet frames is easy and there's not much of an OS to cooperate with. But I don't really know the steps involved from converting a raw frame to tcp packets.
>>
>>60004064
package 
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Graphics;
import flash.events.MouseEvent;
import flash.text.TextField;
public class Main extends Sprite
{
public function Main()
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.addEventListener(Event.ENTER_FRAME, tick);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
}
private function mouseMove(me:MouseEvent):void
{
var offsetMX:Number = 15.5, offsetMY:Number = 10;
var posString:String = "x: " + mouseX + "y: " + mouseY;
tf.text = posString;
tf.x = mouseX + offsetMX;
tf.y = mouseY + offsetMY;
}
private function tick(e:Event):void
{
var obj:Shape = new Shape;
var c:uint = (Math.random() * 0xffffff); var a:Number = Math.random();
obj.graphics.beginFill( c, a );
obj.graphics.lineStyle( (Math.random() * 100) + 5, (Math.random() * 0xffffff), a);
var d:int = (Math.random() * 100)+(-25);
var r:int = Math.floor(Math.random() * 20) + 2;
var xp:Number = Math.random() * 800;
var yp:Number = Math.random() * 600;
var verticies:Vector.<Number> = new Vector.<Number>;
verticies.push(x, y);
trace("Decider: "+d+"| Color: "+c+"| x: "+xp+"| y: "+yp+"| r: "+r+"| alpha: "+a);
if(d >= 75) {
obj.graphics.drawCircle(xp, yp, r);
}
else if (d >= 50) {
obj.graphics.drawEllipse(xp, yp, r, r * (Math.PI / 100)+1);
}
else if (d >= 25) {
obj.graphics.drawRect(xp, yp, r, r * (Math.E / 100)+1);
}
else if (d >= 0) {
obj.graphics.curveTo(xp, yp, mouseX, mouseY);
}
else {
obj.graphics.moveTo(0, 0); obj.graphics.lineTo(800, 600);
}
obj.graphics.endFill();
stage.addChild(obj);
}
}
}
>>
File: 1481771380619.jpg (5KB, 184x184px) Image search: [Google]
1481771380619.jpg
5KB, 184x184px
>job interview next week
>it's for a .NET position
>no idea how to use the framework, just have some C# experience and a lot of Java

Do you think that's enough to land the job? Can someone give me a quick rundown on the .NET MVC so I don't sound like an idiot?
>>
>the "structs can't be allocated on the stack" guy got banned and we can see every single one of his autistic posts now
Christ.
>>
File: file.png (1B, 486x500px)
file.png
1B, 486x500px
>thought of inefficient solution to problem during interview
>get home and realize the efficient solution
FUCK
>>
>>60004164
It's good to know the most autistic people here is actually just one really bad one.
>>
>>60004147
You wont learn enough .NET MVC in a week to perform comfortably in a job. Sorry, you shouldn't have lied on your CV.
>>
how can i into programming. summer is coming up and i want to learn the basics. any recommendation on which language i should learn and good books on it?
>>
>>60004191
There's a reason why those tests are retarded
>>
>>60003275
solved it yesterday, sorry
>>
>>60004252
Who are you talking to?
>>
File: 1490938931821.jpg (437KB, 1508x1493px) Image search: [Google]
1490938931821.jpg
437KB, 1508x1493px
>>60004358
>>
>>60004358
>Who are you talking to?
>>
>>60004252
You are being shadow banned so you can't see those posts
>>
>>60002501
let's do this boys
>>
>>60002501
(You)
>>
>>60004418
Phew.
#!/bin/sh
bc <<< $1 $2
>>
File: 1470851517867.gif (1MB, 499x499px) Image search: [Google]
1470851517867.gif
1MB, 499x499px
>overloading the comma operator
>>
>>60002501
(Me)
>>
>>60002501
i dont want to do this
ugh
roll
>>
>>60004426
Failed
#!/bin/sh
bc <<< $1 + $2
>>
>>60002501
lets do this
>>
Does dynamic typing increase runtime overhead? If so, how come?
>>
>>60004515
Because it's dynamically checked, anon.
>>
>>60004442
echo $(($1 + $2))
>>
>>60004515
>dynamic typing
You mean "dynamic type checking".
>>
>>60004532
>>60004546
Isn't the compiler smart to figure that out at compile time? I mean, it's obvious that x is a number in x*x.
>>
>>60004586
No it isn't.
Also what compiler? languages with dynamic typing are almost always interpreted, which brings with it a whole world of overhead.
>>
>>60004586
> I mean, it's obvious that x is a number in x*x.
No? It can be a vector or matrix.
>>
>>60004586
With static typing, it would be ensured that x is a number at compile time. With dynamic typing, the check is delayed until the very last moment (i.e. at run time).
>>
>>60004605
SBCL for instance.
>>
>>60004623
SBCL has both, no? You can annotate types if you want, which allows some static type checking.
>>
>>60004586
>Isn't the compiler smart
You're talking about dynamic garbage, anon.
>>
>>60004606
Vectors and matrices are numbers.
>>
>>60004515
>new IP
>inane question
>ends up shitposting (>>60004653)
Things that make you go hmmmm
>>
quick /g/, write an mspaint clone in 32 bytes or less!
>>
File: C6KIumjWYAArTsm.jpg (169KB, 1838x428px) Image search: [Google]
C6KIumjWYAArTsm.jpg
169KB, 1838x428px
>>
>>60004679
I posted the inane question, so I'm not >>60004679
>>
>>60004653
Fucking retard. No they're a different type.
>>
>>60004623
>Common Lisp
This is your problems, you're trying to rationalize this outdated mess instead of using actual programming languages.
>>
Dynamic type checking should be embedded in a static type system. You can pick how dynamic it is that way - anywhere from a tagged union (which I feel is what most people using dynamic type systems really need) to full blown RTTI.
>>
>>60004687
0110110101110011001000000111000001100001011010010110111001110100001000000110001101101100011011110110111001100101
>>
>>60004740
>actual programming languages
Like what?
>>
>>60004679
>>60004712
You might be retarded.
>>
static XmlDocument Updates(string ID)
{
XmlDocument xDoc = new XmlDocument();
using (WebClient wc = new WebClient())
{
xDoc.LoadXml(wc.DownloadString(new System.Uri("https://a0.ww.na.dl.playstation.net/tpl/na/" + ID + "/" + ID + "-ver.xml")));
}
return xDoc;
}


Any reason why this would give me a 'The remote name could not be resolved' error?
>>
>>60002501
(U)
>>
>>60004808
No. It's you who is retarded for thinking that an int = matrix
>>
>>60004740
Do you mean Common Lisp, or Lisps in general? What other programming language would you recommend?
>>
>>60004772
close, it's actually
1011100000010001000000001100110100010000101110000000001000010000101110100001111000000001110011010001000010111000000000110000000011001101001100111000100011011100100111100111001111110110101110000000000100001100110011010001000011101011111011110011111100000000

(that is a real program)
>>
>>60004850
will definitely be executing this
>>
>>60004809
I just figured it out in 10 secs but I'm not gonna tell you. I'll let you guess.
>>
>>60004808
Numbers can be identified with 1-element arrays or potentially larger arrays of smaller number sets. E.g. the complex numbers are equivalent in a sense to R^2.

But to say that arrays are numbers is stupid.
>>
>>60004858
>in 10 secs
How fucking slow are you?
>>
>>60004848
All languages with parentheses are obsolete.
>>
>>60004803
>>60004848
Either Python or Rust, depending on what you're trying to do.
>>
>>60004873
You actually tested something anon? I did, just to be sure.

https://a0.ww.na.dl.playstation.net, the new link to the /dpt/ wiki, a tribute for this too stupid to live dipshit.
>>
>>60004841
I never said a vector or a matrix was an integer.

>>60004862
Nothing stops you from making an array of 1 element, in which said element is a matric
>>
>select around street signs
WTF IS THIS SHIT? ReCaptcha had been getting more and more retarded lately, but this is a new low. Like this isn't GIMP or something, I'm just trying to post on a fucking imageboard you piece of crap Google executive....
>>
>>60004877
OK, so what language would you recommend.
>>60004886
>Rust
kek
>Python
double kek
>>
>>60004931
use legacy captcha newfag
>>
>>60004911
Stop moving the goalposts.
You said that the compile can assume x*x is a number. it fucking can't you retard.
x could quite fucking easily be a 64 element matrix. Now go fucking kill yourself.
>>
>>60004886
>Python
Stopped reading right there. Your opinion is entirely worthless.
>>
having to wrap everything in list() in python got old fast
>>60004931
you know you can set legacy captcha for quick reply window?
>>
_WORD *__fastcall sub_100048(_WORD *a1, _WORD *a2, int a3)
{
_WORD *v3; // r4@1

v3 = a1;
while ( *a1 )
++a1;
while ( a3 && *a2 )
{
*a1 = *a2;
--a3;
++a1;
++a2;
}
*a1 = 0;
return v3;
}

So, this function copies a3 characters from a2 to the end of a1 string, with characters being two byte wide, right?
>>
>>60004966
maybe
>>
S-expressions are pretty dumb. It's not like you need them for homoiconicity and all they achieve is making it simpler to write a Lisp/Scheme implementation at the expense of making every Lisp/Scheme program look like rubbish. Also the Lisp/Scheme ecosystem is highly fragmented as a result of implementations being so easy to write. What was achieved here?
>>
>>60004933
Embrace the block style of Ada and reach enlightenment.
>>
>>60004964
>you know you can set legacy captcha for quick reply window?
Yeah I know, I stayed for the retardedness.
>>
>>60004886
Rust is barely a programming language, to make it do anything useful you have to write everything in unsafe and talk to C
>>
>>60004911
x*
>>
>>60004947
No, someone else said that.

If by "64 element matrix" you mean a 64x64 square matrix, then that IS a number. Stop trying to assume a foregone conclusion. You, or whoever I replied to in that section, said that a number "is something that can be a single element of an array", that's what my response was about.
>>
>>60004979
>Ada
Yeah, nah.
>>
>>60005013
And yes, I know that person's definition of a number is absolutely fucking ridiculous, but it's faster to say "you can have an array of a single matrix element"
>>
>>60004973
Well you have to remember Lisp was developed before modern theory of parsing was formulated, so using S-exprs greatly simplified the implementation back in 1960. There is no reason to keep using it in 2017 tho.
>>
>>60004712
>>60004911
>>60004841
Every computer program is a number too.

https://en.wikipedia.org/wiki/G%C3%B6del_numbering
>>
>>60004973
>It's not like you need them for homoiconicity
Elaborate.
>>
>>60004996
That's a pretty stupid thing to say.
Rust is certainly a programming language, as proven by Redox OS.
The only reason why you have to talk to C all the time because C is the defacto standard and all the OS libraries are written in it, so naturally yeah you'd have to.
But to say that Rust is "barely a programming language" because of that is plain retarded and you're retarded.
There's nothing stopping you (except for maybe complexity) from making syscalls directly from Rust and implementing those libraries yourself in Rust.

Yes, you'll have to use unsafe a lot in implementation of low level stuff, obviously, because low level programming is inherently unsafe, and that's fine.
The point of rust is it allows you to implement guaranteed safe, high level, and low overhead interfaces on top of the unsafe low level interfaces.
It's basically a better designed C++.
>>
>there are math fags who think they can program
>>
>>60005160
Homoiconicity just means that the concrete syntax has a 1:1 correspondence with the abstract syntax.
>>
>>60005169
> 11m 24s to response
Rust Evangelism Strike Force strikes again.
>>
>>60005229
Nice argument, you really convinced me.
>>
>>60005241
Me too!
>>
>>60005229
>fast response = good response

>>60005241
>>60005249
>just doing gods work
>>
>>60005249
>>60005255
What?
>>
>>60005169
Rust has no standard, no spec, no verification that it's actually safe, no ABI, and no place in industry. It will never be used in production for the things it's supposed to be the best at. It doesn't work right on any platforms except x86 family + Windows and Linux. Its best ideas are already in C++ or being added in the next version, except it won't be buried under an impenetrable garbage pile of syntax that makes no sense to anybody.
>>
>>60005169
>Rust is certainly a programming language, as proven by Redox OS.
Nobody uses Redox OS, so that argument is worthless.
>>
>>60005295
nobody uses haskell either
>>
>>60005295
>Nobody uses Redox OS
This is incorrect.
>>
>>60005305
Nobody uses it in production, which is all that counts.
>>
>>60005284
>Its best ideas are already in C++ or being added in the next version
Like affine types, lifetimes, modules, a standard build system and package manager, algebraic data types and pattern matching, and separation into safe and unsafe?
>>
>>60005303
>nobody uses haskell
This is incorrect.
>>60005313
Your post says "Nobody uses Redox OS", which is incorrect.
>>
>>60005284
>Rust has no standard, no spec, no verification that it's actually safe, no ABI, and no place in industry.
It's still in development afterall.

>It will never be used in production for the things it's supposed to be the best at.
Ok. Nice assumption.

>syntax that makes no sense to anybody.
Maybe not to you.

>>60005295
And? it still exists, and that was my point in that sentence. Go read the source code, it's available if you don't believe me.
>>
>>60005303
Facebook uses Haskell. its spam detector is written in Haskell.
>>
>>60005317
>algebraic data types
What are they?
>>
What library should I read to get a grasp of what good C programs look like?
>>
>>60005284
>>60005317
Cont.
>Rust has no standard, no spec
It has a working specification in the form of a reference compiler and standard library.
>no verification that it's actually safe, no ABI
C++ doesn't either.

>>60005343
Constructing data types using sums, products, exponents (functions), and recursion.
>>
>>60005326
The point is, nobody can make money from Rust in a meritocratic economy, so it's hot garbage.
>>
>>60005303
I use Haskell
>>
>>60005353
>Constructing data types using sums, products, exponents (functions), and recursion.
Example?
>>
>>60005353
>It has a working specification in the form of a reference compiler and standard library.
Which is formed by strangers on GitHub. Nobody is in control: there's no committee and no BDFL.
>>
>>60005355
Except that's not what your point is. You moved the goalposts because I showed that you are wrong.

>nobody can make money from Rust in a meritocratic economy
Perhaps not now. But there's no saying that it can't happen in the future.

Rust is genuinely a good language and has lots of good ideas that aren't in C++, so it has the potential.
>>
>>60005379
-- read | as "or"
data Expr =
Expr :+: Expr
| Expr :*: Expr
| LInt Int
| LVar String
>>
>>60005386
>there's no committee and no BDFL.
Thank god. Committees are a fucking joke.
I trust the random strangers on GitHub more than any committee.
>>
>>60005379
enum List<T> {
Nil,
Cons(T, Box<List<T>>)
}

In more mathematical terms so you can see the algebra:
List(T) = Nil + Cons * T * List(T)


>>60005386
https://www.rust-lang.org/en-US/team.html
>>
>>60005410
Job creators can tell right away if a language is worth investing in. If it isn't marketable today, it won't be marketable tomorrow. Give up already.
>>
>>60005426
>https://www.rust-lang.org/en-US/team.html
Those just links to GitHub accounts. A collection of avatars doesn't make a committee.
>>
>>60005426
I should point out that Rust is smart enough to not actually represent this as a tagged union. The representation behind Box has at least one invalid configuration (null pointer) so it will use the case where the pointer is null to indicate Nil and otherwise it will be Cons.

>>60005460
Those accounts represent people.
>>
>>60005481
I don't see a committee or a BDFL. They are nothing more than contributors.
>>
>>60005498
>BDFL
I'm here.
>>
>Is it possible to allocate structs on the stack?
Who said that?
>>
>>60005498
They monitor pull requests and thus are a sort of committee. In any case, Rust is stable.
>>
>>60005526
They are human sanity checkers, not a committee. Try harder faggot.
>Rust is stable.
https://crates.io/crates/rand
>>
>>60005558
>They are human sanity checkers, not a committee.
What's the difference?

>https://crates.io/crates/rand
That is a non-standard Rust library.
>>
what degrees do you lads have
do you have a job
>>
>>60005593
PhD in CompSci
$300k / yr but I'm too intelligent to work like most of us
>>
>>60005593
BS in Electromechanical Eng.
I do.
>>
>>60005593
PhD in Fizzbuzz.
Yes.
>>
What's a service, when talking about design patterns? Anyone have a concise definition?
>>
>>60005625
>design patterns
What is this, 2001?
>>
>>60005571
>What's the difference?
A committee meets up to (re)define a specification. This way you, in theory, end up with a consistent specification. The Rust community is all over the place just like the JavaScript community. For example, look at the Tokio project.
>That is a non-standard Rust library.
So? It's the only proper way to do random number generation in Rust.
>>
>>60005625
service == function
>>
>>60005643
>For example, look at the Tokio project.
Not standard.

>>60005643
>So? It's the only proper way to do random number generation in Rust.
It will be stabilized and probably standardized at some point (this is how Rust builds its standard library) and even then you could just stay with one version of the library.
>>
https://pypi.python.org/pypi/pycrypto

what does IV456 mean?
>>
>>60005672
xD so funny
>>
>>60005664
>It will be stabilized and probably standardized at some point (this is how Rust builds its standard library) and even then you could just stay with one version of the library.
So Rust is not stable as of today.
>>
>>60005694
C has unstable libraries, this means C is unstable. Obviously not, retard.
>>
>>60005715
It does.
>>
>>60005723
Does that mean that C is unstable?
>>
>>60005693
what does it mean
>>
>>60005694
>A language needs RNG in the standard library to be stable
Why tho? If anything, a container library is way more useful, and many languages like C don't have one.
>>
>>60005593
Computer Engineering. No job yet, but I'm looking to do FPGA development.
>>
>>60005750
>>60005693
googled iv instead of iv456 and found it means initialization vector, thanks for no help at all
>>
>>60002501
meme
>>
>>60005663
Thanks.

I found this which has a concinse explanation of it if anyone else is interested. Although I don't agree necessarily endorse the content of the article itself, at least the explanation seems decent: http://naildrivin5.com/blog/2010/03/08/object-oriented-design.html
>>
>>60002501
rolleing xdDDDD
>>
>>60005715
>C has unstable libraries, this means C is unstable. Obviously not, retard.
You truly are one of a kind. Of course every language has unstable 3rd party libraries. It's just that you have to use a 0.x library for something crucial like random number generation. C random number generation is well defined (man random).
>>
>>60005762
That's not to mention that C's standard RNG is allowed to be (and often is) shit.

>>60005801
Okay.
>>
>>60005819
>Okay.
Now fuck off to you Reddit safe space.
>>
>>60005801
> C random number generation is well defined
C RNG is a fucking mess, especially when used within threads, and it's even more shittier since most C-tards use it as rand() % some_value, totally screwing the randomness of the distribution.
>>
>>60005854
Rust doesn't even have RNG.
>>
>>60005873
https://crates.io/crates/rand
>>
>>60005873
It does tho: https://crates.io/crates/rand . It's like saying C doesn't have GUI or Zip libraries because GTK+ and zlib isn't in the standard library.
>>
>>60005894
>>60005897
That is a non-standard Rust library.
>>
Ok I'm fucking confused here. You guys seem shit on every language out there, every single one has some huge flaw or it is simply relegated to 'meme status'. So my question.. what languages do you all actually use?
>>
Anyone familiar with SQL/db concepts here? I'm a noob and not really sure what to look up for this.
What's the general practice for giving an entry in a table a list of things?
I have a table called Tags - the columns are just the integer Id and a string for its text. I have another table called Items with various columns - but I want each Item to have a list of tags (tag IDs) so I can select items that have certain tags.
What's an efficient way of doing that? Or what should I look up? I don't like the idea of a comma separate string (if I search for the ID "1" wouldn't "1" and "21", etc. match that?)
>>
>>60005873
Would you rather that the Rust developers throw in a rushed and probably flawed RNG just to have it, or incubate it for some time as a non-standard library before stabilizing and eventually standardizing when they're happy with it?
>>
>>60005907
So is gtk and zlib
>>
>>60005922
>>60005923
So how I generate a random number in """stable""" Rust?
>>
kind of a dumb simple question.. in python is 0 equivalent to 'false' and literally any other number equivalent to 'true' in boolean expressions?

Im confused as fuck about this
>>
New:
>>60005942
>>60005942
>>60005942
>>
>>60005931
You use rand and either freeze it or update your application as it gets breaking changes. Or you link to a hardened RNG library with a C API. Or you DIY.
>>
>>60005947
0 is false, 1 is true
>>
File: 1486795070841.jpg (225KB, 1920x1080px) Image search: [Google]
1486795070841.jpg
225KB, 1920x1080px
>>60005916
VAL3
>>
>>60005958
But Rust is stable right? So why do I have to resort to an unstable library or use a C (muh safety) API?
>>
>>60005969
what about numbers like 2,5,6,19,52?
>>
>>60005947
Read up on thruthy and falsy.
>>
>>60005931
Rust is still in development.
C has been around since the 1970's.

Stop being retarded.
>>
>>60006041
>Rust is still in development.
So it's not a stable language?
>>
>>60002944
>season 2
The best news to come out of 2017 thus far
>>
>>60006073
No.
I don't know why that other anon is trying to claim so, but no Rust is not entirely stable yet.
So it's no surprise that Rusts libraries are still pre 1.0.

That doesn't somehow make the language garbage, like you're trying to claim.
>>
>>60002944
>The existence of undefined behaviors imply that the language creators left it unfinished.
No it doesn't. You're just too stupid to understand why UB exists.
It has a role in optimization.
>>
>>60006103
I never claimed that the language itself is garbage. I'm just amazed how far people will go to defend Rust.
>>
>>60002501
rolle
>>
Fuck. I like sepples and all, but doing multiple return values is horrible to the point that it's neater to just use output parameters instead!
>>
>>60002501
roll
>>
>>60006284
In Rust multiple return values is a breeze with tuples.
>>
>>60006348
Except for random numbers.
>>
>>60006348
I'm not going to rewrite my entire project in Rust, though.

C++ tuples are a part of stl, and almost everything in stl is a fustercluck.
>>
>>60006373
>Add rand to Cargo.toml
>rand::thread_rng().gen_range(0, max)
>>
>>60003946
Honestly I don't have anything against Python (I actually really like it) but I advise people to Learn C first over Python because it gives you a more holistic understanding of the underlying machine.

To quote someone else:

>C forces you to build a mental model of what the computer is actually doing when you run your programs, much like a teenager figuring out how the gear mechanism works by playing around with the clutch. As you ask why and keep digging for answers, your mental model will grow to encompass the process model, the CPU architecture, the memory hierarchy, the operating system, and so forth. It’s that mental model — rather than the C language itself — that will enable you to poke through the abstractions created by others, and write programs you never thought possible.
>>
>>60006449
>Use 3rd party 0.x library for random number generation
>Doesn't work
>"B... but anon, it's not stable yet"
>Go back to C
>Antifa's in your backyard kicking your garbage cans
>>
>>60003690
>segfault
>memory safety
You know being able to cause a segfault is one of the preliminaries for arbitrary code execution, right?
>>
>>60006550
>>Doesn't work
Works fine for me.

>>Go back to C
You mean C++.
>>
>>60006495
But people don't want a more holistic understanding of the underlying machine. Not at the beginning. People want to make things happen and get shit done. Starting by teaching them the underlying machine scares people off and makes it harder for them to grip high level programming principles.

By your argument we should start people off with assembly first.
>>
>>60004255
Well, what do you want to do?
>>
>>60006627
>But people don't want a more holistic understanding of the underlying machine.
And this is how you know that someone shouldn't be programming.
>>
>>60006627
>Starting by teaching them the underlying machine scares people off and makes it harder for them to grip high level programming principles.
I disagree, starting people people off at a high level spoils them and leads them to take a lot of the low-level concepts for granted. Why learn about how strings are stored in memory when you can just type newstring = string1 + string2?

>By your argument we should start people off with assembly first.
I actually don't have a problem with this.

I started with Python and wish I learned C first, for what it's worth.
>>
>>60006606
>preliminaries for arbitrary code execution
I don't understand what this means.
>>
>>60006722
> Why learn about how strings are stored in memory when you can just type newstring = string1 + string2?
because by the end of your first day learning you will want to know how to access a particular character in the string
>>
>>60006722
>Why learn about how strings are stored in memory when you can just type newstring = string1 + string2?
Exactly! Why? As a noob you don't need that shit.
Obviously as you progress and start doing more advanced things your going to have to learn about memory management at some point, and having that understanding helps with debugging sooner rather than later, but don't scare noobs unnecessarily with the hard parts from the get go.

I started with C and in some sense i'm glad for it for just the reasons you mention, but at the same time that caused me (and many others) to take an inordinately long time to get comfortable with higher level programming where you can actually get shit done/

>>60006679
I knew SOME elitist fag would say this.
>>
>>60006932
>Exactly! Why? As a noob you don't need that shit.
And this is why software is shit and bloated today.
>>
>>60006932
>to take an inordinately long time to get comfortable with higher level programming where you can actually get shit done/
But it has all payed off in the end right? it may have taken a while but you're now much more skilled and experienced than your peers in the same amount of time compared to someone who would have started high level.

Scaring noobs off is a good filter to stop software from becoming even more shit than it is already.

Go fuck yourself with your "hur everyone should kode! XD" crap.
>>
>>60006952
And that's still preferable to the alternative where we would still be stuck on a mid 90's level today.
>>
>>60006996
>But it has all payed off in the end right?
It hasn't.
>>
>>60007044
Why not?

Payed off for me.
>>
New thread:
>>60007077
>>60007077
>>60007077
>>
>>60007052
Because i'm still stuck reinventing the wheel, badly, for "educational purposes", others with arguably less understanding are out there getting paid building actual usable software. I will always have a time handicap.
>>
>>60007125
If you do that in your own time it should be fine.
For actual work, just choose the easiest route like I do.
Thread posts: 352
Thread images: 21


[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.