/dpt/ -Daily Programming Thread

What are you working on, Sup Forums?

Old:

Other urls found in this thread:

seebs.net/c/c_tcn4e.html
twitter.com/NSFWRedditImage

what's the 'poo' language next to lisp

...

>coding
whats the ceiling for you guys? i do network security and im at 120k in relatively cheap area.
all the programmers where i work make less then i do but idk if thats the norm

Need some advice on something I've been writing ideas down for for years, some business related customer management application. I started the application using nodejs as a back end without ever having used it, I thought it would be a good learning experience. I think doing this really affected my ability to make progress on the project.

Any suggestions for backend technogoly? I'm comfortable with c# and have some understanding of python. I want to use this project to learn something new, I don't think it's going to be node.

What's your gui framework of choice /dpt/?

>actually getting a job tier

everything in the lower tiers

Where is OCaml

>Python and C are "Hacker tier"
>PHP and Perl are professional tier
>Lua and "Poo" aren't below LISP
>le functional is 4 hipsters meme DX
>Shit tier doesn't include PHP and Perl
Did you just make this, OP? You're a faggot.

Anyone who makes an infograph like that is clearly too stupid to have any experience with Ocaml.

Is there anyone that voluntarily uses C++ when other options are available? I don't think I've ever met a developer that's genuinely enthusiastic about using C++. Usually it goes something like
>Well, we could implement it from scratch in [project-appropriate modern language]...
>...buuuut there's a library from 1997 that already does part of what we're trying to do...
>...ughh, I guess we'll stick with C++ again.
Not trying to start a language war here, I'm genuinely curious.

Where the fuck is Forth?

try being a game programmer, C++ is the only option

I'd like an answer to that too. Also, why does C# get shit on here?
I use it for work to automate processes and for all of our microsoft and windows shit, it just werks.

Yeah, game programming is one of those areas where there isn't really a genuine alternative yet. I can see Rust being appealing to developers once it has proper abstractions for all the popular APIs though, since it's basically all the performance of C++ but without the mandelbugs. I can't see many game developers being keen to stick with C++ even after they get a workable alternative, though.

considering Rust is all about safety it's going to be pretty unpopular for game developers

Me. It's a mix of using C++ and OCaml. I could use other languages such as C or Java or whatever but those are the ones I'm having the most fun with.
Language choice is usually more irrelevant than dpt and stack overflow memesters might tell you. I don't know about companies if that was your question though, but I'm sure for example LLVM could have been written in many other languages (a lot of compiler research is made using functional programming languages) yet they still went with C++. The self hosting argument doesn't really hold since all the front ends are written in C++ and clang etc are "tools", not the core library.
So the tldr is yeah, people still go for C++ even when starting multi million LOC projects from scratch.

This is quite unrealistic. First of all those should be categories, not tiers. The implication of a hierarchical relationship is fallacious. Secondly, it's all scrambled up. Here, I fixed it.

>Also, why does C# get shit on here?
It's not portable. I used to love C# when I was an exclusively Windows guy because the language and the IDE are designed for each other and everything works together like a beautiful machine, but after drifting over to Linux I cursed myself for not using Java instead.

Why's that? I think the days of squeezing single threaded performance using unsafe tricks are gone now, thesedays it's all about trying to squeeze multithreaded performance by maximizing safety and separation of concerns.

Ruby.
Ruby is practically made for game programming considering it's very easy to do multiple inheritance (Object#include) and per-object trait inheritance (Object#extend).
Too bad it's so slow.

Also consider a language that is less than 10 yo is basically still in the experimental category. The good thing about C++ is how conservative the committee is, only putting features that are really proven. The downside is people will feel it's not "modern".

I used to voluntarily and enthusiastically use C++ back when I was blissfully ignorant of shared_ptr. I would just manage all my memory on my own and fix things with valgrind and it was heaven because instead of shared_ptr< and then a > at the end all I had to type was *. Now I can't do that anymore because it's supposedly bad and I """"""""""should""""""""""""""" use shared_ptr instead.

game development is never about safety, it's about fast development and fast execution. It's not about using unsafe tricks as much as it just doesn't matter if your game crashes or not so safety features really just get in the way

>made for game development
>slow
you lost me

When will C++ have a gc_ptr class?

Guys is there a way to reset CLion trail on Linux so I can use that IDE indefinitely ?

I think C++ needs something like OpenGL's core/compatibility contexts. Right now there's a few dozen ways to express any concept that you want - they should go through and identify which ones are idiomatic, and make the compiler error on anything else by default. That alone would make me enjoy C++ a lot more - the number of times I've done something then found out that it was deprecated in 2004 for some obscure reason is insane.

>you lost me
I have it relatively easy in terms of performance requirements because I am developing a 2D game
>inb4 developing a 2D game in this age is a waste of time
Wrong, it's a deliberate stylistic decision. My game will be story-heavy so to allow full emotional connection the uncanny valley must be avoided at all costs

Get a student license.

>found out that it was deprecated in 2004
What compiler are you using for it not to tell you something has been deprecated (very rare)? Unless you're talking about what is considered good/bad practices.

well ok but that's not exactly 'made for game development' is it

I keep getting a "Connection Error" everytime I try to submit my code. Is there a reason for it?

You should actually avoid shared ptr as much as possible. Multiple ownership is asking for trouble.

Put it on pasteboard, maybe it's your message that's getting censored though.

learning C++ thru a course on udemy, I kind of have an idea of what I'm trying to understand but I want to be sure whats going on exactly behind the scenes.
in pic related for Guess[GChar] is GChar storing the ASCII value of the char at that position to compare them to eachother and then checking that the values match with [MHWChar == GChar] or is the statement basically saying check the Guess variable at GChar/MHWChar position and then make sure that once theyre both at the same position, modify the count

Thank you user.
>maybe it's your message that's getting censored though
Can you please elaborate on this?

indeed it isn't, not in terms of performance
i just wish there were a language that offered high performance but also easy access to more advanced and obscure object oriented facilities such as multiple virtual inheritance, traits, and multiple dispatch
too bad ruby is the only thing that comes close and it's slow

Guys, I think I love the Rust ecosystem. I'm not sure about the language itself yet, but it's great that everything around it just works.

>didn't need to fuck around with build system bullshit like cmake
>didn't need to worry about library installation, compilation and versioning, cargo just takes care of that
>cargo has "build and run" built in, no need to write a script for my text editor
>autocomplete with racer works out of the box, no fucking around there
>tests are automated for you
>it even made a git project ready for me

Why can't C++ have a build system like this?

I'm not a student.

For anyone looking to learn programming with books, here's the reference you need.

"If you don't know what the 'C' programming language is, it is an outgrowth of an earlier language called 'B'. That's all you need to know about 'C'." -- Chris Date on how Oracle is written in C, 10th Australian Computer Conference, 1983.

There are some sequences of characters that will make your post fail.

>>it even made a git project ready for me
this is one step over the line imo

>Why can't C++ have a build system like this?
because its an ancient language.

>matlab
Why would you ever want to learn this?

So you're going to ignore .net Core and all the work they've done with Xamerian?

Too many different compilers and environments for it to be viable.

It's not for brainlets like you.

C++ has no standardized build system. Hell, even within cmake there are about ten different standards for how you should build your libraries with your project.

It has these things individually. I don't know if there's a true monolithic C++ development environment out there.

"C" is a disaster. It is not inherently re-entrant, has no guaranteed real-time design, and the pointers are a criminal inclusion. It is GUARANTEED to hang, in deadlock situations, and is inherently easy to "crack". It is notoriously difficult to read, and encourages terseness. It has dreadfully ambiguous syntax. Whoever designed the moronic "case" statement that requires "break" at the end of each option was an insane troublemaker. Anyone using "C" in real-time or safety-critical applications should be imprisoned. I mean that literally. Thrown in jail.

I wondered whether you'd come back

I used to write Structured programs in PL/1 and in COBOL, then moved on to NATURAL, and then Visual Basic and Java, and finally Python. I use Objects sometimes, inheritance rarely, parameterised calls often. MY overall perspective is that functions/procedures need not be tiny (a screen or less) and that larger functions/procedures can serve a system very well. The trouble is that many of the junior programmers leap into complex object hierarchies immediately and because one must work with a team and many members of the team will be recent graduates with almost nothing but OO languages at their command systems get stuck in the morass of huge object hierarchies. It is not easy to avoid.

>F#
For what purpose?

Don't use add until you can design your own binary full adder circuit

>thinly veiled python shill
>"Learn Python, program without Objects for a while"
Python is one of the biggest culprits of growing misguided OOP programmers. Python is a dynamic language that doesn't have a need for objects or classes; All dynamic languages need is functions and hash tables and anonymous functions. Python doesn't even have proper anonymous functions; you are forced to name them and use callbacks very similar to VBScript. Python is literally the closest thing to VBScript that we have today, a language which required delgate wrappers over functions for no real reason.

The reason these languages do not scale is because they cannot simply read a file, eval it into an object(hash table of functions/arrays/etc), and use that object while you need it, then have it garbage collected. This "requirejs" like mechanism allows dependencies to be hooked to local objects instead of imported globally and used everywhere in your code when you feel like it; you have to pass the object around or re-require it. This makes dependency management explicit. Perl/Lisp packages are the contrast to this, where you have a global symbol table and you hook all your packages to symbol tables creating namespaces. This causes you to grow a huge amount of dependencies which you can't track the flow of. This is okay for extending the language, but not okay for a small utility you want to use once and throw away; this causes a huge amount of gabrage to stick around the global scope for no good reason; anonymous functions and requires allow us to eliminate global scope pollution and keep our programs scalable and clean of stuff we no longer need.

I got very fast internet now, guys. What should I do with it?

Download porn

boring. now that I have the power, that doesnt interest me at all

Please tell me she has a dick.

The problem with almost all Fortran books is that they only focus on math programming. The ONLY book that teaches Fortran as a general purpose language is Modern Fortran in Practice

>This is quite unrealistic. First of all those should be categories, not tiers.
here you go

How does this make you feel?

has anyone ever heard people describe p5.js as the "ruby on rails" of js?

i dont do front-end but im sort of interested in it

what's the best book for python brainlets?

No clue but you should ask these things here as the guys are clearly more interested in web.

Can you initialize a nested structure in C89 without putting braces around it?

#include

struct sa {
int a;
int b;
};

struct sb {
int va;
struct sa vb;
};

int main(int argc, char *argv[])
{
struct sb mystruct = {0, 1, 2};
printf("%d\n", mystruct.va);
printf("%d\n", mystruct.vb.a);
printf("%d\n", mystruct.vb.b);
return 0;
}

Qt, because I'm a Qt

Rustlets - When will they ever learn?

auto_ptr

No, you need the braces.
Your compiler may accept that as an extension, though.

What do mean by `extension`?

>>didn't need to fuck around with build system bullshit like cmake
Agreed
>>didn't need to worry about library installation, compilation and versioning, cargo just takes care of that
Agreed
>>cargo has "build and run" built in, no need to write a script for my text editor
Agreed
>>autocomplete with racer works out of the box, no fucking around there
Clang-complete does that
>>tests are automated for you
Agreed
>>it even made a git project ready for me
You don't need this

Rust is a nice language overall. But C++ is way more mature.

It means the compiler may accept something which does not conform to standard C.
An extension to the language.

He means a non-standard feature of the compiler itself

Are Code Academy intensive courses worth it for $199?

No. Not at all.

But if it is valid C89, why would they add an extension to make it semantically ambiguous?

?

Wait never mind, I misread the original answer.

There are lots of reasons for compiler extensions.
For this one in particular, it's because C compilers typically try to compile code with their best effort, ignoring/accepting things which are technically errors.
With gcc, if you compile with -Wall, it'll tell you about it.
$ gcc test.c -Wall
test.c: In function ‘main’:
test.c:15:26: warning: missing braces around initializer [-Wmissing-braces]
struct sb mystruct = {0, 1, 2};
^
{ }

Working out examples out of the textbook. I want to turn this into an app. But before I do so

Theres got to be an easier way to do this right?

pls no bully

Please tell me this is satire.

Use the switch statement

Jesus fucking christ

You are not helping

Be less retarded and use a more automated approach, i.e. let them computer do some mathematics on the date to figure out the zodiac animal.

damn thought I had reached nirvana with the little assembly I learned, you're telling me there's more levels

I'm not the questionnaire, I told him to use the switch statement

le sigh, it seems like there are 12 zodiac years that repeat in the same sequence.
Use modulo.

>tfw to intellegent

thanks guys. pic is literally me in three years lmao

/dpt/ UTTERLY BTFO
hahahaha how will they ever hope to recover?
seebs.net/c/c_tcn4e.html

Did you read anything besides the title before you posted that?

obviously /dpt/'s wellbeing hinges on the fact that there does not exist a single bad book on C

Let's see any of you faggots do any better.

Do your own homework.

Post the full problem

you really think im typing out all that shit?

string[] zodiac = {all that shit}
string you're-sign = zodiac[year%12];

What are you even talking about?
There are plenty of crappy C books. The most notable these days is "Learn C the hard way".

t. brainlet