/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

stackoverflow.com/insights/survey/2017
twitter.com/NSFWRedditGif

"The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages." -Richard Stallman

>literal fag shit
delet this

D

I need some program ideas which have nevar been dun befor.

Getting quite demotivated learning programming since all the
programming ideas I have came up with have been already done
or substituted by a different configuration of another program.
Doing examples in a C textbook is getting boring.

welcum too pedofag site

main () { while (malloc(1)); }

microsoft pls

>check stack overflow developer survey
>stackoverflow.com/insights/survey/2017
>We asked respondents for their gender identity.
>Specifically, we asked them to select each of the following options that apply to them:
>Male
>Female
>Transgender
>Non-binary, genderqueer, or gender non-conforming
>A different identity (write-in option)

Google just allows Male, Female, Other, and Prefer not to answer for its accounts.

What are some good features to make a programming language good & productive?
What's the best way to handle errors?
Does error handling through exceptions immediately discount a language as being "low level"?

Why would M$ allow antisemitism in their apps?

What's the essential list of Lisp commands?
I've understood the concept around lists, cars and cdrs, but now I want to program something Lisp-interpreter independent.

>seniority level on LinkedIn says entry level
>position in the advertisement text is for SENIOR level with 5-8 years experience

Someone please answer.

Which Lisp?

Use Scheme. There is no standard Lisp, while Scheme is a standardized version of Lisp.

Let's consider CL or Scheme.

dumb frogposter

What? Common Lisp is standardized. It has a very large standard compared to Scheme.

Kan man programmere på norsk?

please answer, someone?

Lisp =/= Common Lisp

I'm new to C and my code's not working, could someone test it for me and tell me what I'm doing wrong?

#include
static void test(int dist, int width) {
int o = (width - dist)/2 - 1;
for (; o > 0; o--) printf(" ");
printf("o");
for (o = dist; o > 0; o--) printf(" ");
printf("o\n");
}
static long thing(int l, char c, char delim) {
for (; l > 0; l--) printf("%c", delim);
printf("%c\n", c);
return 100000000;
}
int main() {
int i = 4, j = 0, w = 8;
do {
test(j, w);
j += i;
i -= 2;
} while (i >= -6);
thing(5*w, '\\', '=');
thing(5*w, '

Just start a project and google your way through your problems until you get an idea of what kind of operations are useful. As you learn more you'll discover more efficient ways of doing things that you probably hacked together before.
There's no laundry list of "here's how to instantly be successful with language XYZ". This is in general, not just Lisp

The name Lisp either refers to the Lisp family OR Common Lisp specifically. Be more specific.

Ja, det är nära nog svenska. Men bokmål går inte.

...

The answer is Lisp machines. What is the question?

Most of what you'd need to know to get up and running quickly is covered in Practical Common Lisp.

Is there any point in learning Haskell when Idris is about to reach version 1.0?

>Richard Stallman
Stopped reading right there.

Well, the discussion started out as a question of whether assembly is an abstraction of machine code or merely a translation.

Nope, they're both useless.

Only to make learning Idris a lot easier. Most resources I've seen assume some kind of Haskell knowledge.

>there
Stopped reading right there.

>>there
>Stopped reading right there.

>
Stopped

Is this something implementation specific? I've read the 2010 standard and there was no mention of this.

>Richard Stallsman

Any tips for getting familiar with a fuckhuge C codebase? Trying to contribute to open source but it's hard to start

Throw it in the garbage and start over.

>
Reading

>

Well the first thing I notice is-----
*pauses to actually test*
*compiles fine*
*runs*

... You motherfucker.

>Trying to contribute to open source but it's hard to start
what project?

start small, user

;_;

freetype

>>

epik

59533622

...

>freetype
start typing, then

Concurrency is the future.

I thought font rendering would be straight forward but it's actually just 200,000 lines of autism

Concurrency are jokes hard

What program is that you used to get the statistics?

cloc

Is it just me or is Java losing market share to C#. Is it possible that C# will overtake Java?

I'm just speculating but it seems that C# has become the prominent player in my area. It has more job offers than Java.

I thought that already happened a few years back, might just have been in my area.

I think Java will stick around for a long time even if it no longer has the largest market share, there's so much legacy Java code around that will never be migrated to another language.

You gave me an idea. I'm going to create my own version of cloc using Go!

It was trash before it even began.

Please don't.

Go is not a suitable language for any purpose.

Yes, I definitely see it. I see more jobs asking for C# than for Java. Java will probably be around a long time because of legacy shit, but most people are going to transition to C# because it is a better language and you don't have to deal with Oracle fuckery.

Maybe if you're not programming functionally.

Concurrency is easy if you don't have shared mutable state!

What language do you recommend then?

...

C++

Shit tech support, should have know snek.

pls no step

You would not s-step on s-snek, would you user-kun?~

Python is shit.

raise NotAnArgument

I don't step on Python because it's an abstract concept but I do step on people who use it

Your life is shit.

...

I just tried this and it said 50% of my C++ project is written in D.

>cow snakes
Is this a new organization plot to remove logical thinking?

I have a loop with 2 different escape checks that both do different things.
So i have
while(1)
if(check1)
do1()
return;
if(check2)
do2();
return;
doNormal();

But the loop parameter just feels wrong, is this standard practice or is there a better way.

SOMEONE ANSWER ME RIGHT NOW!!

Some situations do call for everything to be done while inside of an infinite loop.
It may behoove you to write that as a recursive function instead, however.

>Purely Functional Data Structures by Chris Okasaki
Has anyone done this for C?

>I thought font rendering would be straight forward
That was most definitely a mistaken assumption. I'd rather deal with high-end graphics shaders than font renderers.

Continuations or coroutines?

get a life nerd

rate my sieve of erismathea!
char *a = (char *) calloc(LIMIT + 1, sizeof(char));
size_t i, j, sq = sqrt(LIMIT);
for (i = 2; i < sq; i += (i > 2) ? 2 : 1) /* skip even */
if (!a[i])
for (j = i * 2; j < LIMIT; j += i)
a[j] = 1;

>his language doesn't have cond

Neither, there's no reason for either of them.

>calloc
mixed code and declaration
no braces
useless comments
four spaces indentation
confusion between char and bool
implicit cast

1/20 because you try

I cant think of how recusion would be any better, but thanks for the suggestion.
Cond does the same thing, just hidden behind another "function".

Man, just friggin hard-code the case of i=2. That is NOT an appropriate use of a ternary operator.

>make -j

It's shit, not only because you can't spell eratosthenes but the program is also crap.

I don't see anything wrong there, at least within the context given. Each check leaves the loop?

You mean a macro.

for (i = 2; i < sq; i += (i > 2) ? 2 : 1)

Yeah, i could use break instead of return for this example. thanks for your validation.

What is this, O(sq*LIMIT)?

>windoze

I need 1.5GB of memory to sieve all the primes up to 2 billion, so maybe.