/dpt/ - Daily Programming Thread

Last thread: What are you working on, Jow Forums?

Attached: dpt.jpg (270x224, 14K)

Other urls found in this thread:

min-lang.org/
youtube.com/watch?v=_zD33Hrbo4Y&list=PLKBPwuu3eCYkScmqpD9xE7UZsszweVO0n&index=3
en.wikipedia.org/wiki/Most_vexing_parse
Jow
youtube.com/watch?v=U1UtRnGn5hc
twitter.com/SFWRedditVideos

Even official rust people accept that Rust is bad for prototyping/iteration.
You can argue "y-you're just not experienced yet", but it's an objective issue in Rust even from people who have mostly gotten past BC fighting.

That's called a procedure retarded animefag.

not according to nim it's not.

>even official rust people
I've used the language, I don't need other people to tell me what to think.
The language has issues, but prototyping is fine.

Nim doesn't respect history of programming.

>nim

Introducing min.
min-lang.org/

>Entirely written in Nim. It can be easily embedded in other nim programs.
>Follows the functional and concatenative programming paradigms.
>Provides a wide range of combinators for advanced stack manipulation and dequoting.
>Provides a minimal set of data types: integer, floats, strings, booleans, and quotations (lists).
>Fully homoiconic, all code can be accessed as data via quotations.
>Includes an advanced REPL with auto-completion and history management.
>Provides a lightweight module system.
>Provides sigils as syntactic sugar to access environment variables, quoting, defining and binding data, etc.
>Includes a small, useful standard library for common tasks.
>Self-contained, statically compiled into single file.

NO YOU DONT NEED TO UNDERSTAND. THINK AS A GROUP NOT INDIVIDUAL.

Indeed. They may also be called operations. For example if you have a state machine, you don't need arguments since it operates on the state.

Can we expect min to hit 1.0 within the decade?

What the fuck does that even mean?
CS is a clusterfuck of cross-pollinating, renaming, liberalizing terms, misuing terms and so on.
There is very little set "history", nor should we be forced to abide by much of any of it, if the field itself cannot even enforce standards.

The plans is to hit 0.1.15 by the end of 2024

>The language has issues, but prototyping is fine.
what things have you made in rust?

>zoomer logic

2 things that a programming language need to be acceptable are:
be python
be a language I have used recently

Python is the only good programming language these days.

A couple of small games, which I've posted on /dpt/ before.

I only post on non-anime /dpt/ threads.

So you're an authority over Rust core devs because you've cloned a few arcade games?

I'm still going through Emacs' lisp tutorial but I'm feeling impatient.
I want to recreate Kontact in Emacs as a welcome screen before trying to become burger ZUN.

Attached: 1564698442893.png (1000x710, 410K)

Yes? I'm in charge here.

And your authority is? Go back toy our hivemind you fucking brainless zombie.

At least he programs unlike you.

>And your authority is?
literally any intro to rust talk, every single one of them bring up BC fighting.
1 Mozilla buck has been deposited

Like I thought, no authority. Fuck off brainless twat.

Lisp is the most powerful programming language.

So is Ada!

It insists upon itself.

This.

This, but to a lesser degree.

Don't be impatient. Doing things right the first time means you don't have to fix it later.

I'm starting to see the features people complain about as a positive thing for most languages. 9/10 times people are complaining about not being able to write an unreadable mess, or complaining that the language forced them to rewrite something better than they initially did.
Lanugages that force you to either 1) write your program in ways that should be typical for seasoned programmers or 2) project your own faults and blame the language design when it's yours that's at fault
>but I want to play code golf
>but I want to use my own standards (inconsistently)
>but I don't want to make sure it's runtime safe

>heap fragmentation
How much is this an issue in real programs?

Sorry but I follow the NASA C Coding standards. What do you follow?

does he plan to re-brand it with a name people have any hope of finding in search engines?

Depends on the application.

youtube.com/watch?v=_zD33Hrbo4Y&list=PLKBPwuu3eCYkScmqpD9xE7UZsszweVO0n&index=3

Why apologize? A dialect like that is exactly what I'm talking about.
It ceases to be C when you have an actual written and public standard that is enforced by standard tools. The fact that you have to mention it by name should reinforce that it's a language dialect of its own (as well as it's MISRA dependency), and by reading the standard you can see all the restrictions that people today seem to complain about nonstop today.
>ugh I wanted to use _feature_ but it triggers a compiler warning, NASA C is so bad :((((

Are you retarded? NASA C standard is a coding STYLE, not language you fucking imbecile.

How do I get rid of a singleton when I'm done with it? I tried calling delete theInstance in the destructor, but that caused a crash.

Your English comprehension isn't so good.
>It ceases to be C when you have an actual written and public standard that is enforced by standard tools.
You're arguing semantics alone because it's not branded, despite the fact that it is and you even called it by it's branded name.
>C++ isn't a language, it's a style of C
That's what you sound like.

>Score job on upwork to design a bot that can evade Facebook's detection
>Pay is extremely low for the work, but fuck it, job is interesting and I know better than to expect more from upwork
>Client asks for project proposal within 24 hours
>areyoufuckingserious
>Rush a draft of one and send it out
>Okay cool, we'll send you our generic contract shortly
>Don't hear back all day
>Start reading white papers on contemporary bot detection, do in depth research on ML-based approaches, might as well put this time to use
>3 fucking days later, get a garbage contract full of holes
>Whatever, sign it and start drafting a design doc
>Realize that this bot is actually going to be doing extremely advanced stuff
>Feel great about the fact that it will be probably one of the most sophisticated bots in the commercial sector
>Ask for their shitty abandoned code
>"Ah it's all cobbled together from open source projects, just write your own"
>Explain that I really just want it to save myself the trouble of writing boilerplate code for prototyping, and also to understand how their backend is put together
>"No, we're not going to send it to you, sorry."

I'm about to fire the client and go into business for myself with this shit on principle. I get that using upwork for employment means being a fucking code monkey, but this is completely unacceptable.

I knew something was bad the minute they took forever to send me a poorly constructed legal document. Don't ever take a contract on the cheap. 30 year old boomer startup retards will think they can walk all over you.

Attached: 1564858842293.jpg (540x704, 69K)

Not to mention it's literally the head of the standard. It's literally first principles lmao

Attached: file.png (796x196, 20K)

You're literally an idiot or a troll if you don't know the different between a styling standard to keep things consistent vs an entire new language split off.

singletons are eternal

Have any of you used the ISPF editor? Have any of you used a mainframe? What's it like?

The point was stated, misinterpreted, clarified, and now you're just being stubborn. Not sure what you're trying to gain other than attention.

You're doing nothing but goading it seems. The point remains that people bitch too much about foot gun prevention tactics and standards that enforce maintainable source code. You seem to bitch too much about nothing at all.

Got it, you're a troll that doesn't know the difference between coding styles and actual language splits like GNUC.

You're literally ignoring what was said and just repeating the word "troll". Why are you trying to save face while anonymous. You misinterpreted something, oh no. Are you worried people might reply with smug anime pictures. Come on user, not in the /dpt/.

Pretty sure IBM offers free access to a mainframe for learning purposes.

freelancer website best place to thief ideas or build portafolio projects.

the future is a language with exactly 1 style, and any deviation is a compile error.
languages who waste their time with bikeshedding tools are doomed to fail or drown in complexity.

the future is 1 language, and that is Lisp.

which flavor of lisp?

Javascript

How God intended it. We conjure the spirits of the computer with our standard spells.

Yeah I'm on the same page. I'm doing this shit for portfolio projects. At some point I'm going to switch to a real job, and then try to write some industrial software I can make passive income off of.

Any Android devs?

I want to see if I can modify the Kuroba(/Clover) code to add a couple features for my own use; I know Java, but not much about actual android dev.

my post from the clover/kuroba thread:
Basically how hard would it be for me to learn enough scraps about how android dev works, to functionally modify an open-source app's existing code?

Attached: 1508983525979.jpg (1560x2048, 302K)

Found a defect in C++.

constexpr auto operator "" _ex(const char *s, size_t len)
{
return std::array(s, s+len);
}


User-defined literal functions are defined as constexpr functions. This means you cannot use the given values to parameterize a template, despite the fact that literals will always be compile-time information.

Alert the committee

But how do?

Write a letter to WG14

what is the reasoning behind this syntax for constructors in C++?
class foo{
int bar;
public:
foo(int x) : bar(x) {}
};

why is this a thing
and while I'm here, what's the point of the 3 or however many to initialize a value
int foo = 0;
int foo (0);
int foo {0};

C++ is layers and layers of standards that never were cleaned up or synergized with each other.

Are 2011/2012 C# learning materials deprecated already?

>layers and layers of standards
it's like they forgot what a standard even is

For some reason they love repurposing and overloading old syntax instead of adding new stuff
For the second point, it's now recommended to use the third style {} everywhere possible, read about Uniform Initialization for why and how

does it matter? just learn from whatever you can and then do a quick read through all the changes

how does that even work? isnt it a unary operation? how come ur providing 2 arguments

what do you thing about clojure?

>tfw have insanely poor GPA
>NO GITHUB
>did well in TopCoder
>still got into FAANG
God I love America. Land of opportunities.

Attached: aQMHgpyh.jpg (960x960, 162K)

>NO GITHUB
>a negative
This is modern america folks. Bow down to the facebook of coders or get loss.

What language do they program in pic related?

Overheadful language, therefore I don't think about it at all and I do not acknowledge its existence.

>what is the reasoning behind this syntax for constructors in C++?
There are things you can do with initializer lists that you can't do in the constructor. The primary reasons are
* If your member is const, you won't be able to set it after declaration, including in the constructor.
* If you need to invoke a specific constructor of an object, particularly a move constructor, and especially if it doesn't offer default construction. Even if it does offer default construction, it's usually not ideal to construct an object twice. Unless it's optimized away, this is even true for non-class members, which you would prefer to only set once.
* If you need to invoke another constructor (delegation), or invoke a non-default constructor of the superclass, it needs to be done in the initialization list.

A minor reason is that it separates setting members from other execution logic in the constructor, but that only is true until you need to do other logic to set a member.

> and while I'm here, what's the point of the 3 or however many to initialize a value
The first is mostly historical, but compatible with classes in a lot of ways, allowing invoking constructors explicitly without risking a most-vexing parse situation (std::string value() declares a function that returns a string. std::string value(std::string()) declares a function that takes a function that returns a std::string): en.wikipedia.org/wiki/Most_vexing_parse
The second is explicitly calling a constructor, but is vulnerable to the most vexing parse with some changes.
The third is the new uniform initialization syntax. It can be used to explicitly call constructors without any risk of most vexing parse, but will default to an initializer list constructor when possible.

Welcome to C++. It's powerful and extremely useful, but until they bring in proper epochs (new editions of the language that may deprecate and remove old syntax), you need to put up with decades of historical decisions.

It doesn't have to be literally GitHub, but it is obviously a positive for employers if you have a portfolio.

This is why languages should be well thought out, updated once every decade / half decade and each change has to fit into the language and not make it into some frankinstein.

A portfolio of what though? Do you just find random things to program?

Once every month is my ideal time, quarterly is also fine.
These languages that follow strict every week/two week releases are kind of silly.

This is the truth. Why the fuck do I need to add spotless/ktlint to a fucking Android project to ensure that my retard Jr devs stick to style guides. It shouldn't compile anything else by default

Of course. Programming is fun, so I do a lot of it on my free time as well as at work. Sometimes I'll make work-related utilities that my job allows me to open source, or work on other open source programs and libraries. I create utilities, libraries, and other programs for myself and others.
It's a bit of a silly question. Imagine if this was about art and artists, and you said "A portfolio of what though? Do you just find random things to draw?" A programming portfolio is like any other portfolio. It's a showcase of your skill, experience, creativity, and ability to follow through on something.

Rich kid stuff. Kids from working and middle class families don't have time to find fantasy portfolios, they have to work to pay off their student debt. And they can't get into FAANG as a result. We need to change the system.

Bullshit. I started learning programming myself in my high school library on the school computers, got a second-hand netbook for $100 off Craigslist, taught myself to use Linux and program in C, built a portfolio instead of playing video games and watching TV while still managing to have a social life, and got an internship by calling tech businesses and selling myself. I then put myself through Community College while building my portfolio and working this job.
Don't fall for this bullshit. Most poor people aren't literally working every waking moment of their life. It's not easy, but pretending like it's not possible or that "learning to program and writing some little proof-of-concepts" is an impossible task is retarded, and you're an idiot for believing it.
So no, kids don't have time to find fantasy portfolios, but they do have time to hone a skill, cut back on other leisure time, and make some programs. It's the same concept as getting into any other skill-based fields from meager beginnings. It's hard. It's not impossible.

And stop talking about

*And stop talking about FAANG like it's the ideal programming position. I know engineers who work for Google and Facebook at the least, and for most, it's not a cushy position, it's stressful, shitty work. There are tons of programming and tech companies, big and small. Facebook, Apple, Amazon, Netflix, and Google are not the be-all and end-all of programming. They do some cool stuff and some terrible shit, and other companies also exist. I don't know why anybody would make "getting into FAANG" their end-goal of learning to program.

Because it opens doors for you, making God-tier companies like Jane Street possible for you. Sigh, idk maybe I'm prestige-whoring too much.

there's nothing prestigous about being an employee you cuck

The brainwashing is so strong in our generation jesus...

I think you are. The education system is fucked up, but having unrealistic ideas about the barrier into learning to program and building a portfolio or the abilities of the poor is harmful to everybody. The majority of my coworkers grew up poor.
Randomly trying to turn something like learning to program and building a portfolio into a political argument about class division screams of somebody who doesn't actually work in the field or with anybody in the field. Opportunity makes some difference, but making the judgment that everybody who has ever developed a portfolio or programmed for fun grew up as a privileged rich kid is ignorant and divisive.

what? are you from the 19th century? Do you think whining that you can't make a portfolio that you're "poor" and that having job for the best master is the best thing you can strive for in life? You're subhuman, born to be told what to do

This.

If I loop through a vector of pointers, and I call delete on each one, do I also need to write "myPointer = nullpointer"?

Why aren't you using Perl 5, user?

Attached: whynot.gif (540x603, 188K)

No. But if you ever iterate over vector again and delete objects again, you'll get what is called "double free", so it's usually encouraged to set pointers that you might access later to null after deleting.

What does double free actually do in some cases? I've never had a problem with it because Clang handles it gracefully and just quits.

>if you ever iterate over vector again and delete objects again, you'll get what is called "double free"
Can I avoid the problem all together by just not ever setting anything to nullptr?

Don't free memory.
Just allocate big enough arrays.
Use pointers whenever possible.
Don't sanity check inputs.

Attached: 647C7B9F-F4B8-4AC6-B354-A5C7B501CA4B.jpg (226x258, 9K)

You'll never be a good C programmer if you don't listen.

>Jow Forums-science.fandom.com/wiki/Computer_Science_and_Engineering
how's a person supposed to read all this shit

>how's a person supposed to read all this shit
installgentoo

>don't free memory
oh no no no
>just allocate big enough arrays
youtube.com/watch?v=U1UtRnGn5hc

Attached: 1564442701886.gif (498x278, 1.69M)

Double-freeing is undefined in C. Dunno about C++ (deconstructing an object which has already been deconstructed).

Apparently in C it can corrupt the memory manager, leading to a double hand-out of memory later, allowing a malicious process to overwrite other memory.

I have read all three entries of Effective C++ what are some other good books about C++?