[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Home]
Board
Settings Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: dpt_in_a_nutshell.jpg (16 KB, 499x249)
16 KB
16 KB JPG
What are you working on, /g/?

Previous thread: >>68807124
>>
>Don’t be seduced by the methods System.gc and System.runFinalization.
They may increase the odds of finalizers getting executed, but they don’t guaran-
tee it. The only methods that claim to guarantee finalization are System.runFi-
nalizersOnExit and its evil twin, Runtime.runFinalizersOnExit. These
methods are fatally flawed and have been deprecated [ThreadStop].

Java is a good language
>>
I have a girlfriend, hairy legs, facial hair, and I'm 6'3". Can I still be a pretty, pretty C programming princess?
>>
File: daicon.jpg (12 KB, 268x188)
12 KB
12 KB JPG
>>68814458
why did u make a new thread now the kind anons who were going to help me with sprite pools might not reply anymore
>>
>>68814458
that should be a LISP or Hasklel book desu
>>
Nth for Haskell
>>
I want to write code like this.
https://github.com/Co-dfns/Co-dfns
>>
>>68814458
Does someone have a good website/tutorials for learning this following two things:
>learning oop
>programming patterns in c++
>c# from beginner to good
>>
>>68814900
>learning oop
the best strategy is not to learn oop
and stay the fuck away from their "principles"
which are just a bunch of apologist patches to their terrible programming paradigm

why do you think they need all those verbose acronyms for various kinds of unfucking themselves and all those books talking about "dont do this pls, do this ideal thing which will never happen"? because deep down OOP, at a fundamental level, is completely fucked in the ass
>>
>>68814900
Udemy is a pretty good website for programming tutorials in general. For design patterns i can recommend the book: design patterns explained by alan shalloway. The website: refactoring guru is also pretty good for OOP and design patterns.
>>
In C#, suppose I have something like:
private int _id;
public int Id{ get{ return _id;} set{ _id = value; } }

Should I just set _id to public and skip the whole process of creating accessor methods? If I'm not doing any additional processing with how a value is set or accessed, what's the point of using a property?
>>
>>68814504
>>68814554
No worries.
The code below is more ilustrative than anything. And it's not tested/compiled.
https://pastebin.com/MtJy1qS5

I took a linked list approach. You can just as well do this with a ring buffer or stack. But the linked list version is more obvious.

I'm thinking maybe I should have considered pretending there's a linked list implementation.
Also it's important to note that the update code at the bottom still needs to check if the sprite they index into is_used or not. The peakCapacity just avoids walking over all the sprites that haven't even been used once.
Tell me if you're confused.
You can just google freelists aswell, this was just me trying to explain for fun. Freelist is a concept that comes from allocators but it's useful for any type of resource management.
>>
>>68814977
>The website: refactoring guru is also pretty good for OOP and design patterns.
that´s a great website, wish they would also have implementing of the pattern in c++. Because I must admit I need most of this for university.

C# is more like for me and portfolio.
>>
>>688149
OOP can indeed be tricky. If say an object A needs to use object B, then object A depends on object B. This can sometimes lead to problem if not implemented well. This is why certain patterns and standards are realy important. It keeps your code maintainable.
>>
>>68815041
You can just write

public int Id { get; set; }

Instead. It's called an auto-implemented property.

The advantage of using a property over a public field here is that if you decide to control how it's accessed later, any code that is already using that field won't break, since it's already going through accessor methods.

Changing from field -> property and vice versa can also break reflection code, so keep that in mind too.
>>
File: inhocsignovinces.jpg (80 KB, 900x506)
80 KB
80 KB JPG
>>68815042
thank you bro.
good luck to me
i still havent implemented sprite-sprite collisions lol
>>
>>68815108
>The advantage of using a property over a public field here is that if you decide to control how it's accessed later, any code that is already using that field won't break, since it's already going through accessor methods.

Ah, that is a very good reason, and is something I'm actually currently struggling with as I try to change my public fields to properties during my refactoring.
>>
>>68815156
The other advantages are rather helpful as well: properties allow you to control accessibility (you can write protected or private before the get/set, or omit them entirely for read/write-only properties).
Additionally, an interface can require a type to have a property, but not a field.
Also note that the JIT compiler will often optimize simple properties such as the one in your example (and auto-implemented properties) into direct accesses to the underlying field, so you won't pay a performance cost in the majority of cases either.
Hope that helps explain the reasoning behind why many people recommend using public properties over fields.
>>
>>68815194
Yeah. You've convinced me. Thanks.
>>
>>68815194
>>68815258

One more question. Is the style I chose for my field and property correct? That is, naming my field with an underscore _id, and my property with a capital letter?
>>
>>68815286
It's up to you, really. It's your code.

Personally I dislike the underscore prefix that tends to get used, and instead opt for just naming my private fields in camelCase. The reason people use the underscore is generally so that the names of function parameters and variables don't conflict with field names, so you'll have to decide for yourself whether you use the prefix or not in your code.

As for your property, that's correct. Generally the naming scheme for C# stuff is to use PascalCase for anything that's public, protected or internal, and use camelCase for private stuff and variables.

Microsoft themselves offer documentation on this subject: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines
>>
>>68815042
Is there a way to do this without new btw? Using only static memory? I wont be running out of space in the pool because sprites leaving the screen are freed.
>>
>>68815370
Or rather killed, disabled etc.
>>
I'm trying to learn C as well as use the ncurses library. What's going on with my code? It doesn't print anything


void moving()
{
int row = 0;
int col = 0;
char message[] = "Hello, World!";

curs_set(0);

for(int i = 0; i < strlen(message); i++) {
move(row++, col++);
char c = message[i];
// printf("%c", c); works fine
addch(c);
// addch(c) does not
refresh();
}
>>
>>68815370
sure, you could use a builtin data structure like vector<Sprite> and pop() from one and push_back() to the other
>>
>>68815450
and this is just a snippet; i did include the library, close the brace, and call moving(); from main.
>>
>>68815370
>Is there a way to do this without new btw? Using only static memory? I wont be running out of space in the pool because sprites leaving the screen are freed.
Yes. You could just have a normal stack. It'd have to be at least as big as the original buffer to cover the case of everything being dead. Or alternatively you could clear the freelist and switch to O(n) in that case, you could even add a scan function that stores where it saw that there weren't any free slots. Which can then be dirtied by taking the min index between that scan and the element which was removed.
You could also just have the linked list be backed by a normal buffer of nodes. But that's a bit silly. The stack is better in this case, less memory footprint but easier to use.

There's so many ways to do this anon, I couldn't possibly explain it all to you like this. I'm sure you'll manage to find some solutions when you put your mind to it. I think this is a great problem to try and solve for a new programmer.
>>68815457
This still implies memory allocation though. It's not gonna hurt at all but I'm thinking anon here was intent on avoiding that.
>>
>>68815525
Also I forgot to say in earlier posts. You said you have 64 entities, it's never going to be a real problem however you do it. You can just look through the array for the first empty slot no problem.
>>
>>68814900
>good website for learning OOP
https://www.yegor256.com/
>>
>>68814458
why that dildo has a lock on it?
>>
File: not strong enough.gif (1.98 MB, 342x192)
1.98 MB
1.98 MB GIF
>>68814900
>>learning oop
>>
>>68814938
>le OOP hate meme
Love this meme.
>>
>>68815111
For videogames?

Take this advice: don't
Tons of works and it will only make the game frustrating and inconsistent to play
>>
Out of all languages I can unironically only tolerate C# and JS, even though I've been programming for nearly 10 years in various languages. Anyone else in the same spot?
>>
>>68815569
Probably not, but I dont want to be unnecessary lazy.
>>
>>68815636
Yes. It will be just rect — rect intersection tests. Enemies wont even be able to collide with each other.
>>
Is there something like an actual hash map for Excel (VBA)?

I need to keep track of 10+ integers associated with a column name.
It works, but either I have to pass a ton of arguments to every function or use an array and add comments regarding which index stands for which column, which is not very "elegant"
>>
Can someone explain how to hook up glsl shaders to my c++ program in visual studio?
>>
>>68815713
use some sort of graphics library like SFML
then you can load your shader with one line of code
>>
>>68814458
Lisp is the most powerful programming language.
>>
>>68814938
somebody is unemployed
>>
>>68815525
I think I know what you mean. I would place the indices of the unused sprites on a stack and then pop when needed? Then all I need is to make sure that the stack is rhe same size as max_sprites ?
>>
>>68815818
I actually am, and I should kill myself.
>>
>>68815804
Cringe
>>
>mfw I just realized console.writeline means you call a predefined method called writeline and pass an argument into it
>>
>>68816006
>replying to a bot
>>
>>68815822
>pop when needed
>make sure that the stack is the same size as max_sprites
Yes that's it. The linked list I did was basically a stack in the form of a linked list.
>>
>>68815713
http://lazyfoo.net/tutorials/SDL/index.php
This is pretty alright.
https://learnopengl.com/
This is a more raw approach than SDL. Uses glfw and opengl directly instead. You'll write the compile bind etc yourself.
SDL does that for you normally.
>>
>>68815713
you load the shader source in as a string and then you compile it using openGL commands
>>
>>68814576
>Hasklel
is pic related
now put on your cock cage and go write C, you need to leak at least as much memory as your gaping anus leaks in a day
>>
File: spritestack.png (11 KB, 340x262)
11 KB
11 KB PNG
>>68816176
Ok I think I got this down.

Now when iterating over those sprites which are IN USE I have to keep a separate stack?
>>
>>68815822
You can store a linked list inside the sprite objects themselves so it requires no extra allocations at all
I posted an example in the last thread
>>
>>68815450
You say printf works fine. Not sure what addch does, maybe adds it to a buffer? Which you need to print at the end?
>>
>>68816379
>Haskell programmers unironically think they're math wizards
>>
>>68813303
kek'd hard that this.
>>
>>68816391
This stack is just indices into the normal sprites. For just iterating and using the sprites you do that normally.
>>
>>68816441
bullying AND fucking trannies AND ruining their clothes what a guy
>you're not a she
>you're a he
>*cums on dress*
>HE
>*goes home and is a family man*
>>
>>68816428
>implying i'm a haskell programmer
hep-th gods > CS monkeys > SE niggers > nu/g/ šoibois
the haskell monkies are still miles ahead of any other CS pejorative term for homosexual male specimen of homo sapiens, at least when it comes to math
>>
>>68816471
what?
>>
>>68816462
But what if I want to iterate over only the sprites which are not in the stack? Is this what the linked list thing fixed?
>>
>>68816490
Do the sprites have to be stable?
>>
>>68816517
stable? I dont know what you mean.
>>
>sequential functional specification
>refined into concurrent functional specification
>refined into imperative implementation
>>
why are you even making a pool for sprites? There isn't much point unless you're uploading them a vertex shader all at once
>>
>>68816529
Does their address or index need to be constant?
>>
>>68816467
>>
>>68816542
no bully pls, their draw calls are batched, though they will have different shader parameters for indexed color using a texture lookup once I get to writing the shader
>>68816552
I am not sure.
>>
>>68816467
What's wrong with that?
>>
>>68816595
in that case you don't need to iterate through them, you just need to upload the entire vertex array to be drawn, so you only need a free list for keeping track of where free sprite slots are
>>
File: haskell guidelines.png (8 KB, 424x176)
8 KB
8 KB PNG
OH NO NO NO NO NO NO NO NO
>>
>have to write a small program that extracts data from pdfs
>find a library that lets me turn them into string
>however the result is different depwnding on the version of Adobe you use, ranging from precisely delimited to garbled mess, making me rewrite the algorithm for each version and having to find out how they each differ
>it's not even a commercial program, my boss is just a lazy asshole

Sometimes I wish I had studied sucking dick instead
>>
Is there any way to make error checking less of an eyesore?
>>
>>68816621
I need to iterate over the used sprites for other stuff. Like updating their AI, animations, doing collisions, checking if they left the room/died and should be disabled etc.
>>
>>68816485
that haskell programmers certainly have the right to call themselves math wizards, among the CS folk
>>
>>68816641
You did.
>>
>>68816642
Use a language with good error handling, like Haskell.
>>
>>68816663
--> >>68816631
>>
>>68816643
The data for non-rendering operations doesn't need to be batched. If you are batching render calls, seperate out your rendering data. Otherwise just use free objects to represent everything. Batching rendering calls for sprites isn't realistically neccessary in the first place, so if you're still a beginner you can safely just forget about it and do a draw call for each one
>>
>>68816658
Please delete this, thank you
>>
>>68816642
Check out Rust and other languages with the same style of error handling.
>>
>>68816641
Don't the pdfs themselves have version numbers embedded in the pdfs?
>>
>>68816593
>>68816598
>>68816631
>*cums on your dress*
>*guidelines you*
>>
>>68816490
Line 50 & 40-42 of >>68815042 is only a cheap way of ensuring we don't loop over parts of the sprite array where we know there's no sprites.
If we keep track how many new slots we're using (and the only way to get a new sprite slot is through the case on line 40-42) we can guarantee that there's no used sprites above that index because we've never given them out.

In your implementation you now added all the unused sprite indices to the stack. Now we won't know how many of the slots in the sprites array we've given out because any of them could be given away by now.
Your way makes for very nice and clean code at the expense of not knowing (right now). If we want to get the same ability we can just fill sprite_stack_data in reverse order:
[MAX_SPRITES-1, MAX_SPRITES-2, ... 3, 2, 1,0].
Then when you do pop stack the first index you will get is 0, then 1 then 2 etc.
When you delete one of those indicies you add them back on to the front. So if we deleted index 1 the stack would look like
(MAX_SPRITES-1, MAX_SPRITES-2, ... 4, 3, 1).
As you can see we won't get back any higher indicies than we already have unless we use more sprite slots than our previous peak.
So what we can do in our PopSpriteStack() function is
int PopSpriteStack(){
int ret = sprite_stack_data[sprite_stack_top--];
peakUsage=peakUsage>ret? peakUsage:ret; //max(peakUsage, ret);
return ret;
}

Then when we loop we know that we don't have to check indicies beyond peakUsage. Not sure what to call peakUsage to be descriptive. But it is just the biggest index we've given out. So because of that we know we don't need to go looking for sprites that are alive beyond that, anything beyond that was never initialized.
This code is much cleaner than newSpriteIndex() from >>68815042 despite being the same thing essentially. You're not checking if sprite_stack_top is negative, if that's the case in your code you've run out of sprite space.
>>
>>68816658
kek
>>
>>68816676
Rust errors are just more complicated exceptions
>>
>>68816595
>>68816595
>I am not sure.

Well if not, then you don't need the extra stack, you just need an index of the last sprite. Whenever you "add" a sprite, you put it in that index and increment it. Whenever you "remove" a sprite, just copy the last sprite into that slot and then decrement it. That way your live sprites are always contiguous at the beginning of the container.
>>
>>68816715
Rust errors are simply values that can be manipulated like any other value.
>>
>>68816752
So are C error codes.
>>
>>68816771
Yep, and they're better than exceptions too. But Rust is better at manipulating values in general, since it has first class sum types with pattern matching.
>>
File: 1539442393785.jpg (65 KB, 850x800)
65 KB
65 KB JPG
public static long millionSum() {
Long sum;
for(long i=0; i < 1000000; i++) {
sum += i;
}
return sum;
}
>>
File: 1542930262773.gif (136 KB, 311x360)
136 KB
136 KB GIF
>>68816787
*teleports behind you*
*closes the form of your expression*
>>
>>68816752
And Java exceptions are Objects that you can pack whatever data you want into, but I have never heard anyone call Java's error handling good
>>
>>68816783
>Rust is better at manipulating values in general
Why are you sucking Mozilla's cock so much? Rust is just another language, it's not automatically better at anything
>>
>>68816809
Exception handling (in Java but also in general) is a different world with a different set of rules. It introduces new control flow mechanisms that essentially make every method you call a wildcard in terms of whether or not it'll pull you out of the current context and put you somewhere else.
As regular values, error codes and error monads just don't do this. They behave predictably like everything else does.
>>
I know it's
>Java
but what's the point where StringBuilder is no longer worth using?
For instance I should clearly use an append in a loop, but is it still faster to make one for
string1 = string1 + string2;
?
>>
>>68816783
I like exceptions better simply because I don't have to check and rethrow them for every function call. I catch and handle them when and where I'm ready to do so.
>>
>>68816852
a string builder isnt any faster for a single operation
>>
>>68816685
>fill sprite_stack_data in reverse order
hmmmmmm... this is interesting
but this peak will never decrease right?
>>
Please help me /g/.

I've been a hobby programmer for many years (started QBasic and TI) did a few simple games, the usual. Quit for a long time, kinda want to play with programming again. I thought up some things to do and I tried Java but Java seems to be a complete mess. I got some prototypes working but I felt like I was spending about 80% of my time trying to find ways to cleanly (Interfaces to kinda multiple inheritance that half-works, streams versus loops, and all the crap around boxing numbers, etc.) do things that I expect today's computers should do for me, especially in the GUI stuff. The more I refactored things to do them the clean or "right" way, the harder it got to keep track of everything. (And then there's apparently a Java version 7 that sucks, 8 that has cool stuff kluged in that I've been using, 9 that maybe got deprecated fast, and a 10, 11, and 12 all of a sudden.)

Then I heard about Kotlin. It makes a really appealing promise about not needing so much typing and letting the computer do the repetitive stuff for me. And it sounds like it plays nice with Java so stuff I've already done that works I guess I can keep, and I really like the promise that I can write for PC and my phone together. But does Kotlin offer good GUI stuff and complete the things that are missing in Java (like math after C99 so I don't have to do trivial but annoying things like bring my own asinh) or is it really just the same as Java with sugar and I'll have the same dragons to slay after learning a different syntax?


Also, taking alternative recommendations for making simple multimedia/game/math projects.
>>
>>68816838
This isn't a Rust thing, it applies to any language with good type system features like sum types.

>>68816866
Dude just use >>= lmao
>>
File: wtf.png (62 KB, 898x813)
62 KB
62 KB PNG
>>68814458
I am pulling my hair out with this!

I am trying to write my own program that calculates probabilities of a 5 card poker hand. I am using BigInteger in Java because the numbers become enormous when I am doing manual factorials to solve the numerator and denominator of nCr problems.

But I digress, I simple CANT FIGURE OUT how to divide two BigInteger values and return anything other than zero!

Here is a snapshot......

The offending line is:
System.out.println("Probability of having one jack in a hand of 5 card poker = " + test_divide);
>>
File: wtf2.png (49 KB, 698x799)
49 KB
49 KB PNG
>>68816921
Here is the MathFunctions class that BigInteger is utilizing and wherein I am calculating BigInteger factorials and doing the nCr calculations with multiplication of BigInts JUST FINE

ree
>>
File: resultwtf.png (5 KB, 477x148)
5 KB
5 KB PNG
>>68816935
offensive output
>>
>>68816960
It should be multiplying 194580 and 4 and then putting that result over 2598960 to get the probability of having one jack in a hand of 5 card poker
>>
>>68815747
>>68816224
>>68816319
Thanks.

The open source project I'm building off doesn't seem to lead the shaders by filename. Is it possible it is going into the folder containing all of the shaders and loading then automaitcally? If so what should I ctrl+f to find where that is happening?
>>
>>68816866
You can still do that with errors as return values.
>>
>>68816921
Is the problem integer division truncating? Try replacing your bigintegers with bigdecimals
>>
>>68816980
I will try this and report back, thank you.
>>
>>68816838
Cthing
>>
>>68816979
No.
>>
>>68816895
GUI programming is always pretty bad, language doesn't matter
for games you'll want to use the libgdx library for java
start out by making something simple like snake
>>
>>68816980
Looks like this did not work
>>
>>68815641
Same here, 7 years, the more I program, the more I hate programming.
>>
>>68816978
yes, shaders are simply plain text source code
so they can be loaded from any string in memory
you could even hardcode them into some static strings so loading from file is not necessary
look for the function somewhere in the codebase that is executing shaders and work backwards from there
>>
Guys, see >>68814597

>atlassian is an australian company
>bitbucket is pretty much compromised now

Where should I move my private git repos to, /g/? Github makes you pay for them, and Gitlab seems to have a massive data loss every year
>>
>>68815713
Learn Vulkan.
>>
>>68817016
I literally did a replaceAll command BigInteger to BigDecimal btw
>>
>>68817027
Host it yourself, fagit.
>>
reminder
https://www.youtube.com/watch?v=QM1iUe6IofM
>>
>>68816997
You're not gonna make it.
>>
>>68817041
dlet
>>
>>68817039
fuck that, i dont want to worry about backups and availability
>>
>>68817045
>not signing up for GitHub's student account
>ISHYGDDT
>>
>>68817045
Then you fall to the wayside.
>>
>>68817016
You need a MathContext object to encode the precision you want your BigDecimals to keep. Check the math API.
>>
>>68817042
No.
>>
>>68817052
>"we will make you pay for all your private repos after you graduate"
no thanks

>>68817053
no u
>>
>>68817054
Ok, thanks.
>>
>>68817052
>Requires a student email
>>
>>68814458
Why does /g/ love mental illness so much?
>>
>>68817043
>>68817041
>inb4 you hate oop so you are unemployed
you love oop so you ool ni oop (hint: run some javascript module to reverse that string, pajeet)
>>
>>68815615
>being this new
>>
>>68815615
>>68817108
https://www.youtube.com/watch?v=CQA-cUIWCkc
>>
>>68816882
I see, thanks
>>
>>68814509
Always!
>>
>https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html
>More lifetime elision rules
Imagine full type inference... that doesn't always work.
>>
>>68817116
Based
>>
>>68817140
Whats a computer?

-- Sent from my Macbook Air--
>>
How can I extend a struct in C? I have a small lib for linked lists.
struct llist {
void *data;
llist_t *next;
};

How can I extend this to
struct llist {
void *data;
llist_t *next;
int count;
};
>>
>>68817156
I don't understand what you mean.
>>
>>68814458

How can I get on HRT in SoCal (California)?
>>
>>68817146
>Apple users are dumb
Wow what cutting edge comedy and timely social commentary
All I want to add is Justin Bieber is gay and George Bush looks like a monkey
>>
>>68817116
Forget crossdressing, green peppers are the true secret to elite coding
>>
>>68817173
Import cheap shitty drugs (poison)
>>
>>68817135
>Const fn can't even use && or ||
and this is supposed to replace C++? What a joke.
>>
>>68817173
Buy s o y. Loads of it.
>>
File: 1499023048271.png (6 KB, 335x261)
6 KB
6 KB PNG
>>68817156
Pair<llist, int>
>>
>>68817182
What's a george bush?

---- Sent from my Democratic Macbook Pro ---
>>
>>68817116
Unironically, 2018/22/1 was the best day ever in 4chan history. /b/'s post quality went up by mountains.
>>
>>68817226
There are only 12 months in a year, you retard
>>
>>68817226
Day 2018, Month 22, Year 1?
What calender are you on
>>
>>68817135
>Embedded devices has gotten ARM development working on stable Rust!
How has a so-called systems programming language been around for 8 years, and yet it has only just become viable for embedded?
>>
File: 1543016946969.jpg (76 KB, 500x496)
76 KB
76 KB JPG
>>68817211
I haven't read the generics part of the C book I'm reading. FML
>>
>>68817251
It doesn't exist.
Although you can hack up something pretty close to that with macros.
>>
>>68817251
C doesn't have generics. Take your pick of macros, void pointers and flexible arrays.
>>
>>68817270
>>68817290
>It doesn't exist
I know, bud.

>Although you can hack up something pretty close to that with macros.
I skimmed that chapter, and that's how the author does it.
>>
Whats a good amount of time to stick to your first job before moving on?
I'm looking at staying 8 months to show I got kept on past the probation period
>>
>>68817303
What's the book by the way?
>>
>>68817313
>asking that on a board of NEETs
>>
File: lrg.jpg (71 KB, 500x656)
71 KB
71 KB JPG
>>68817315
I don't care for his style, but I learned a lot from his book, as I'm an autodidact.
>>
I'm testing out an idea since more online providers are taking harsher restrictions against the people who made them popular. Freedom of expression is king, and that should never change, it's a basic human right. Post what you want, go nuts, we are free! Sure it's just basic for now, but I've gotta start somewhere: https://xefig.com
>>
>>68816735
I don't understand this at all.
Seems to me that you would be forced to sort the list/array/stack whatever of used sprites whenever you "inactivate" one if you want to make sure you never iterate over an inactive sprite.
>>
>>68817329
Judging by the amount of people complaining about OOP you're probably right
>>
>>68817156
Well you take this
struct llist {
void *data;
llist_t *next;
};


And you write
int count;
in it, like so:

struct llist {
void *data;
llist_t *next;
int count;
};
>>
>>68817404
[spoiler]fag[/spoiler]
>>
>>68817354
Just checked it out, the first part is pretty solid, even though it's not strictly language related.
>>
>>68817427
Yeah, the book is broken in two parts: dev env/compilation and versioning control and advanced and new techniques, specifically C11, of C.
>>
>>68817354
>>68817427
Something I forgot to mention, and that I don't find in the book, you might want to take a look at tools like clang's sanitizers, to make your programs more robust. You can never be too careful.
>>
>>68817383
maybe if i have a stack of unused sprites
but a double linked list with the active sprites
>>
>>68817427
REMINDER
https://www.youtube.com/watch?v=TvUqE-g3010
>>
>>68817383
Nah, when you "inactivate" one you just put the last active one in it's place.

Like, if the array max is 10, there are 7 active elements in it, and you want to remove the 3rd element.

int back = 6
array[2] = array[back];
--back;

for(int i = 0; i < back; ++i){
array[i] //do stuff
}


Like I said though, only works if the elements don't have to be stable.
>>
>>68817462
why even have a pool at that point?
>>
>>68817156
>extend
You are a loooong way from home, oopie boy
>>
>>68817480
>--back;
Disgusting
>>
>>68817480
that should be i <= back but you get the idea.
>>
>>68817475
>AMD
B A S E D
>>
>>68817475
FUCKING KEK MY SIDES
>>
>>68817520
>>68817525
shouldn't you be on /v/?
>>
>>68817156
I like to use lists like these:

typedef struct s_node
{
void *data;
struct s_node *next;
}t_node;


typedef struct t_node *t_list;


but I don't get what you want to do
>>
>>68817525
>>68817520
>>68817558
PHONE POSTERS
RISE UP
>>
>>68817480
does "stable" do anything performance wise for game loops like this?
>>
>>68817587
stable doesnt have anything to do with performance it means it retains the ordering of elements
>>
File: index-solution-01.jpg (90 KB, 528x473)
90 KB
90 KB JPG
I'm interested in traffic light control. How should I get started with make such program to control some lights?
>>
>>68817632
lol fuck off pajeet
>>
>>68817632
>make the road
>make the cars on the road
>make them move around
>make the lights
>>
>>68817480
Is that array my sprites array?
So i would be copying the struct from sprites[back]
and assigning it to sprites[2]?
>>
>>68814458
Is this pic legit?
>>
>>68817660
>not just making a 2*2 bool matrix until you need anything more complicated
>>
>>68817632
Usually this is embedded programming.
My best course of advice would be majoring in EE.
It will take time and will, but if it's truly your life calling, you shouldn't ignore it.
>>
>>68817665
>Is that array my sprites array?
>So i would be copying the struct from sprites[back]
>and assigning it to sprites[2]?

Exactly.
>>
>>68817714
thanks bro that was really clever
>>
>>68816428
>implying they aren't
Writing in Haskell takes substantially more intelligence than OO code monkey shit. There is a reason why the industry isn't dominated by FP, despite it being objectively better by every single metric. That being, there aren't enough geniuses.
>>
>>68817784
>Writing in Haskell takes substantially more intelligence than OO code monkey shit
it doesn't, dont confuse being obscure with being difficult
>There is a reason why the industry isn't dominated by FP
It's impractical and it's slow
>>
>>68814509
Only if you don't look like a Gaston.
>>
>>68817173
Planned Parenthood Informed consent
>>
>>68817796
>it's slow
No.
>It's impractical
Now we're talking. The real reason why it's not more used is the lack of libraries for pajeets to reuse to not fuck everything up.
>>
>>68817784
Hint: if your tech is "to smart to win" its actually just garbage
>>
>>68817796
OCaml is perfectly suitable in terms of performance for most tasks e.g. Java would also be suitable in.
>>
>>68817816
>No.
Immutable data means redundant memory usage and lambdas mean more indirection
>>
Things I have overheard in college

>Why did the prof tell me it uses too much memory, someone should tell him modern PCs have like 16 gigs of RAM
>I can't attend Algorithms 2, I have a game design class at the same time
>How are [state machines] related to programming?
>>
>>68817840
you sure showed those dumbasses making a post on /g/ about it
>>
>>68817847
Fuck you dad
>>
File: disappointed.jpg (66 KB, 537x469)
66 KB
66 KB JPG
>>68817840
>game design class
I may be a moron, but I will never have been so stupid as to study fucking videogames in college.
America is embarassing.
>>
>>68817847
t. video game loser who can't into programming
>>
>>68817869
>America is embarassing
If you think this only happens in America you are even more stupid
>>
>>68817876
yeah you wish you could play video games like me
>>
>>68817826
>lambdas mean more indirection
Only as much as objects mean.
>>
File: 1528760627098.jpg (59 KB, 395x401)
59 KB
59 KB JPG
>>68817892
>>
>>68817896
More in practise seeing OOP models are designed to use the least amount of indrection possible, while lambdas in many normal use cases are completely unresolvable
>>
>>68817869
>America
I'm actually from Thailand
>>
>Nobody alive understands C++ but the committee still proceeds at full throttle
http://ericniebler.com/2018/12/05/standard-ranges/
>>
>>68817937
AHHAHAHAHHAH
*breathes in*
AHAHHAHAHAHAHAHAHAHAHHAHA
>>
>>68817937
>Thailand
>16 gigs of RAM
>>
>>68817955
whats funny about Thailand?
>>
>>68817796
It's not slow. And when you fully grok it the language, it's beautiful and very clear to read. It describes each problem in a much cleaner way than OO can ever hope to achieve. Of course, if you're a brainlet then you will never reach that stage.
>>
>>68817927
"Real" OOP encourages turning every little thing into an immutable object. It's basically no different to FP lambdas but it takes 10x the effort to write.
>>
>>68817979
>"Real" OOP encourages turning every little thing into an immutable object.

And thats a problem how?
>>
File: anon kun.jpg (227 KB, 1053x1070)
227 KB
227 KB JPG
>>68817955
>>
>>68817978
>It's not slow
>>68817826
> It describes each problem in a much cleaner way than OO can ever hope to achieve
depends on the problem
there's a few problems that have a 'beautiful' functional solution, not many
>grok
don't use this made-up word, it's the nerd equivalent of saying xim or xer
>>
>>68817979
The thing functional programming crybabies complain about is that mutable state is too complicated to manage (while at the same time saying nobody usses FP because they're too dumb, hmm)

>>68818006
it's slow
>>
>>68817927
OO is 90% writing pointless boilerplate and not the thing which actually matters, mapping the relation of domains to each other in terms of computation
>>
>>68818023
is this a thai ladyboi
>>
tryna hack shit on hack the box
>>
>>68816379
Does yukari construct a new object everytime she calls for a gap?
>>
>>68818045
Almost my entire codebase is side effect free. Why wouldn't it be? It's not hard to manage state when it's confined to just a few functions.

Imperative pollutes the whole program with state, when (in most cases) you just need to read something and write something one time per cycle. It's absolutely retarded.
>>
>>68818092
it's not hard to manage state period
it's just a contradiction that haskellers say it's evil because it's hard to manage yet say people won't use haskell because they're too dumb
>>
My only problem with OOP is that it encourages shit like
list.sort().reverse()
>>
>>68818118
Are you retarded?

If someone is dumb enough to do list.sort().reverse() then they are dumb enough to do sort(list); reverse(list);
>>
>>68818140
What I mean is using inefficient code to keep it "clean" and due to not being able to rewrite objects
>>
File: 1543354344951.jpg (112 KB, 538x581)
112 KB
112 KB JPG
At the end of the day we can all come to the conclusion that even if you don't use Haskell for any production use, if you don't know it fluently by now you are a 100% below average CS monkey programmer.
>>
>>68818255
I learned Haskell in university and can write some basic shit, but when I take a look at any "real world" Haskell, it seems like a fucking mess.
>>
>>68818255
Haskell is for 3rd graders, every /g/entooman must at the very minimum master Idris.
>>
>>68818113
>it's not hard to manage state period
Nice argument you got there
>>
>>68818210
That has nothing to do with OOP and for all you know those could be in place operations that simply reference a reference to the same list.

OOP does not mean everything is immutable and you must follow some functional style coding standard. You could make the same fuck up in any other programming paradigm.
>>
>>68818210
how is it inefficient? the only overhead is passing and returning a reference to the list
>>
>>68818264
Because it's full of state and is a clusterfuck trying to overcome the limitations.
>>
>>68818333
this is functional programming in pratice
it has the same problem as poo in loo ( ool in oop)
they cant follow their own rules because reality does not confirm to their ideals which dont really solve problems satisfactorily anyway.
>>
>>68817949
niebler is based
>>
>>68818255
Erlang has actual production uses. Haskell is just an educational circlejerk.
>>
>>68818433
There are times when it's okay. Things that are largely stateless or seldom change state works great. They do surprisingly well in microservices depending how you pull from the backend.
>>
>>68818468
yes, everything has a place, presumably.
Some things work great in very specific instances.
but these faggots build entire pyramid schemes called "programming paradigms" to feel smart and then fool people into buying their stupid books
the only useful programming books are those that give you the basics of the language, and those that give pure algorithms and data structures
>>
>>68818784
>buying books
Anon...
>>
File: 1543725567435.gif (184 KB, 244x248)
184 KB
184 KB GIF
>>68818784

>books

Go back to CS101 monkey
>>
>>68818796
>>68818837
Not studying theory is why you niggers can't go beyond fizzbuzz.
>>
>>68818796
>buying books
exactly are you retarded? you have no reading comprehension, probably because you never read a book.
>>68818837
go back to watching pajeet on youtube animefag
>>
I decided to write an informal introduction to Python called 'How To Code Like a Snake'.

Here's the start of it.

HOW TO CODE LIKE A SNAKE
by Jonah Mann
2018

--- Preface ---

But snakes don't have hands.

Well, they don't have feet either, but that doesn't stop them from getting around.

Oh yeah, this book's about Python.
It's a programming language, but I'll explain that in the intro.


--- Contents ---

01. Introduction
02. Set up
03. Syntax
04. Variables
05. Operators
06. Selection
07. Iteration
08. Numbers
09. Strings
10. Lists
11. Tuples
12. Dictionary
13. Date & Time
14. Functions
15. Modules
16. File I/O
17. Exceptions


--- 01. Introduction ---

Python is a programming language. It can be used to make stuff do stuff.
By stuff I mean computers and by stuff I mean computations.
This book will explain how you can use Python to make stuff do stuff.
Oh yeah, and the contents are pretty much lifted from another tutorial, so.


--- 02. Set up ---

Installation is a bit boring to explain (and do), so just go to the Python website, download the stuff and get it working.
-> python.org

By the way, I'm assuming Python3, so if you're in the future and using version 4 or greater, than I don't know. Things might not work.


--- 03. Syntax ---

Let's make the computer do something. We're going to make it say hello. How friendly.

print("Hello world!")

That's it. One line. That's the program.

So how do you run it?

There are two ways. The first way means you use Python like a big calculator, doing one thing at a time. The second way means you write out the entire program, then run it.

The first way goes like this:
Open a terminal (or command prompt) and write

python3

or

python

or whatever works for you.

Then write the program above. You know, that one line one.

The computer should go

Hello world!

like that.

If it doesn't work, then something is wrong.


More in next post.
>>
>>68817840
>game design class
Holy shit. Some people really are so stupid.
>>
>>68818897

Now write

exit()

to exit Python.

The second way is the way we will be using in this book.
Open a text editor (a PLAIN text editor like notepad or gedit NOT WORD) and write the program in that. save as

something-or-other.py

Notice the .py extention. But call it something else like helloworld.py. The .py means it's a Python file.

Ok, what you need to do now is navigate the terminal to the folder where you saved it. You'll probably need to use

cd SomeFolder/SomeSubFolder

to get there. This is not a command line terminal book, so just google your operating system. cd is change directory.

Ok, once you're in the folder run

python3 helloworld.py

or

python helloworld.py

depending on your system/setup.

By the way, if you're not using a distribution of linux, you should. Partly because many of them come with python installed.

Anyway, the terminal should spit out

Hello world!

like before.

And that's basically how you write a program and run it.

Congratulations, you're now a computer programmer.

Let's look more closely at the program. You can see it as being in two parts (or at least I do).

First part is this:

print()

And the second part is this:

"Hello world!"

The first part is a function, or method, or command, or whatever you want to call it. print() tells the computer to perform an operation. That operation is to print something to the terminal. But what? The poor computer needs to know WHAT to print!?

"Hello world!" is a string. We know it's a string, because it's in quotation marks. A string is, to put it simply, a bunch of characters.

Chucking "Hello world!" inside the parentheses of print() tells the computer to take "Hello world!" and print it to the terminal.

Chucking something (or some things) inside the parenthese of a function are called arguments or parameters of the functions.


More in next post.
>>
>>68818919

It's kind of like math, but like easy math, so don't worry. Hence the name function.

Like the area of a circle is pi*r^2 where r is the radius. You need to know what r is to get the area out the other end. r is the parameter and the function returns area.

If we defined a function called areaCircle() to compute the area of a circle and wanted to find the area of a circle with radius 3.4, we could type.

areaCircle(3.4)

And it would return 36.31681108.

In this sense print() is a function. But it doesn't take in and spit out numbers. It takes in a string and prints it to the terminal.

Thefore you might conclude that functions can do more than just math on numbers and you would be correct.

Functions and strings will be examined in more detail in later chapters.
>>
>>68817116
>3 of my posts are there
who's this retard by the way
>>
>>68816642
stop making errors
>>
Is there any functional language with no autism and with decent IDE and debugging tools?
>>
File: spritestack.png (23 KB, 764x339)
23 KB
23 KB PNG
>>68817714
thanks man works perfectly
>>
>>68818981
>Is there any functional language with no autism
No
>>
>>68818981
>functional programming
just study real analysis and numerical methods for solving partial differential equations and be mathematician instead
>>
I build an application that identifies people in a certain living environment
And divides them according to IQ state and human skin color
>>
>>68819084
>i built an application
>built an application
ok
>>
>>68819012
>PDEs
>real math
Dumb engie.
>>
>>68819098
is it so important?
>>
>>68816883
No not unless you write a compacting step into your program.
You move the later elements to free spots earlier in the array. With a free list (or really any other reference to the sprites position in the array) that becomes much more complicated. It'd probably be wise to just re-create the free-stack once you're done moving.
>>
>>68817025
I don't think it's constructive to give this simplified view of opengl shaders. The pipeline for a shader is too complicated to just boil it down to a compile step.
>>
I just got accepted to a 6 figure salary position up in boston. It'll be the first time I'll live a city other than NYC

What is it like to live in a place other than NYC? Do they have halal? What about pizza? Or hobos? Do they even have cheap Chinese food?
There's so many questions I need answered
>>
>>68814458
Just wrote an awk script that writes a shell script that numbers music files in a playlist so they appear in the right order when transferred to my MP3 player.
#!/usr/bin/awk -f

/^.*$/ { printf( "mv \"%s\" \"%s%d %s\"\n", $0, NR<10?"0":"", NR, $0 ) }
>>
>>68819400
>/^.*$/
This matches everything, so you can just leave this off.
>>
I'm working on a program involving image manipulation via a GUI in Python, trying to implement an efficient flood-fill tool. The algorithm part was easy; queue-based scanline using a deque works perfectly fine. But actually writing the pixel values is taking way too long.
My original data structure for the image was a naive 2D array of pixels
[[bytes(3) for x in range(512)] for y in range(512)]

Writing to that took about 200ms to write 512 rows.
Experimenting with timeit() in the CLI, it seemed like writing slices of bytearrays was much faster than writing individual bytes objects to a list, so I changed my data structure to a single list of rows
[bytearray(1536) for y in range(512)]

But using this, the flood-fill took longer in practice, over 500ms for 512 rows.
Are there any good data types for this kind of work, or is it a lost cause in Python?
>>
>>68819462
For some reason awk doesn't seem to like it when I have a block with no pattern before it.
>>
>>68814509
get your girlfriend to show you how to shave and dress you up in her clothes
>>
>>68814458
Should I always optimize my code?
what's the difference between
-O3[\code] and 
-fexpensive-optimizations[\code]
>>
you should optimize for release but if it significantly increases compile time it's usually not worth bothering with while you're just developing/debugging (unless you specifically want to test performance)
>>
>>68819687
I've written a few programs and never gotten around to optimizing them. Now I want to recompile some other programs using optimization and I don't want to do so only to find out that it leads to problems down the line.

So as far as I'm understanding, optimization won't break functionality?
>>
>>68819751
>optimization won't break functionality
As long as your code only relies on well-defined behaviour you're good. It's pretty common for technically broken code that "just works" to stop working when optimized.
>>
>>68819802
Alright sounds like a good extra way to make sure my code is good and not "just works" before releasing anything
thanks!
>>
>>68819660
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-fexpensive-optimizations turns on with O2.
For gcc at least.
>>68819751
If optimizations break functionality you've got a code problem (undefined behavior). It's not good to be in that state even if you never optimize because moving to a new platform or compiler is risky in that state.

Optimizations for conforming programs don't hurt. Assuming there's no compiler bug. But those are very rare. Other people are likely to have hit then before you and it's obviously one of the most high priority issues in a compiler.
>>
Does anyone know any reason why I would use Microsoft/platform specific mutex to go with my shared memory?
https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-createmutexexa
Like this.
Or can I just use any mutex implementation from any library.
I'm wondering if the context of shared memory for IPC has any special circumstances regarding mutexes or if it's just as if there were two threads.
>>
>>68817784
>being slow is considered to be objectively better
It's a good thing FP is easy to unit-test since pretty much anyone touching your code later will likely break it making the tests even more important
>>
>>68815641
Don't really like Coctothorp but I'll back you on JS
>>
We should never have allowed universities to teach languages like Java and C#.

>>68814484
This post is about precisely the sort of utter nonsense that we should never have permitted to exist. It reeks of a language which was constructed with no overall design plan, no regard for soundness, no adherence to mathematical principles, and no study of what worked and did not work in previous languages. A gigantic bodge job.
>>
>>68817816
Haskell has a wealth of incredibly good libraries. Look at lens, semigroupoids, mtl, etc. They are far more reusable than anything that exists for Java or C#.
>>
>>68819574
then cum on «her» dress
>>
>>68819898
Statically typed functional code is harder to break than poorly typed object-oriented code, with hidden side effects, nulls, and exceptions everywhere.
>>
>>68820084
Rather, breaking statically typed functional code actually breaks it and gives you useful error messages so you can fix it instead of storing fucked up data somewhere deep in memory and causing a null pointer exception 15 minutes after the original root cause
>>
File: 1476998709917.jpg (396 KB, 1570x1536)
396 KB
396 KB JPG
>unironically using meme terminal editors instead of an actual ide
>>
>>68820135
Yes, indeed - I was thinking of breaking it in terms of deploying broken code to production because problems didn't get spotted. In languages like Haskell and Idris the compiler catches so many more things it's not even funny, it's just sad that most people don't have access to that level of assurance from their tools.
>>
>>68820180
>unironically knowing neither vim nor emacs
>>
>>68820205
what is vim and emacs good for if you dont watch anime?
>>
>>68820230
Watching anime takes time and attention away from programming.
>>
>>68820205
Waste of time and not as productive.
Only faggot NEETs believe otherwise.
>>
>>68820205
I use Vim-mode in my IDE, and I wouldn't have it any other way.
>>
Real men use nano
>>
>>68820180
Give me one (1) good C IDE thats compatible with linux. ONE
>>
>>68820187
most code monkeys haven't put more than 5 minutes' thought into it and still think the compiler throwing errors and warnings at them is a BAD thing
>>
>2018
>not doing this
cat file
echo "contents + your edits" > file.new
rm file
mv file.new file
>>
>>68820310
emacs
>>
>>68820310
Eclipse with CDT.
>>
>>68820310
mousepad
>>
>>68820310
CLion, but I assume you thought of that and just think it's bad. What IDEs on other platforms do you think are good?
>>
>>68820310
Linux not even once.
>>
>>68820353
Despite the bloat, Visual Studio is okay enough, though I've heard its C++ support isn't too great.
I only program on linux since developing programs on Windows is hell and I don't want to shell out the money to use a Mac.
Here's a pic of my current "IDE" that does everything I personally want at the moment. Vim, make, command line git, and gdb all work good enough for my needs.
Geany might be something I consider using, given that it's just a text editor with some IDE-like features.
>>
>>68820438
Whoopsy daisy.
>C++ support
meant C support. My bad.
>>
>>68820310
>>
>>68820458
No.
>>
>>68820438
Hey if it works for you I'm all for it.
I jumped around and used some editors for a while, but after not being able to find anyone I liked (including Vim and Emacs), I just went back to Jetbrain's products and couldn't be happier. Everything just becomes so much easier.
>>
>>68820458
It unironically has many things going for it, but auto complete is SO slow on it it's essentially unusable. I would often finish typing even very long names before auto complete would show up. Also becomes very slow after you've installed a bunch of extension.
>>
I need to write a simple algorithm to generate all possible rectangular matrices M = a*b; a < b filled with zeroes and ones, in a way that every row must have exactly one 1, and no column can have more than one 1. Any help? Language doesn't matter, preferably C or Python.
>>
>>68818282
It's really not, people have been doing it for ages. Is it as easy as in a functional programming language? No, but is it hard? No, not at all. You just need to be more disciplined in an imperative programming language, while in a functional one, the compiler enforces it for you.
And what do you get for that discipline? Much faster performance. Why would I want my application to run 2-3x (in some cases) as slowly as an equivalent C++ program and have to rely on a run time?
However, what I can say is that there definitely should be more people using functional programming languages. You should only need performance for things like OSes, compilers, browsers, video games, etc. Most applications can take a 10% performance hit (or less), but be much more safe in a language like Haskell or F#.
>>
>>68820575
>F#
Ditch it and use a language with a real type system.
>>
The project I picked up is built with visual studio which I am not familiar with and it is not building because some object defined in the shader is not being found

Is it possible I have to manually do something within the IDE to link the shaders to the project?
>>
>>68820685
Lol, I don't use F#. I just said that since it can leverage .NET libraries, which can potentially speed up application development time. If we're purity spiraling, I would probably choose Coq or Idris. You can get a proof of correctness and then automate a translation to Haskell with faster performance. That's probably overkill for most applications though, but there has been interesting research in using them for privably correct OSes and filesystems.
>>
>>68820575
>You just need to be more disciplined in an imperative programming language, while in a functional one, the compiler enforces it for you.
Yes, and generally when you need to be disciplined you won't be. At least not at all times, and the times you aren't can end up hurting you and your colleagues for a very, very long time.
I have never touched Rust, but from what I understand they permit mutability but not if there is more than one reference to whatever it is being mutated. Sounds reasonable to me.

>>68820685
What should be used instead? F# has many good things that can be hard to find.
It has a web stack that lets you write in F# at every step, GUI frameworks, and if there's something that doesn't exist you can always use C# libraries, even if it's not idiomatic.
>>
redpill me on encapsulation
maybe it's my brainletness but I don't see the point
>>
I fucking, got a CS degree and never really learned algo's so I'm stuck working IT support and working through fucking Sedgewick's algorithms and at the same time working full time and trying to work through free code camp lol.

Probably end up dropping 10k to go to Utah Universities fucking bootcamp or something but I don't have that kind of money. Bleh. Work hard in College kids. Do an internship.
>>
>>68820728
https://www.youtube.com/watch?v=QM1iUe6IofM&t=923s

In general oop has many concepts that exist in all types of programming and often make sense, it's just oop fucks everything up so hard it becomes awful.
But idk, I see a function as encapsulation even if that's not what programmers usually refer to when they say the word. Sems to fit the definition.
>>
>>68820725
>Sounds reasonable to me.
It isn't.
>>
>>68820749
>I'm stuck working IT support
It doesn't make sense that you're working IT support just beacuse you don't know algorithms that well, very few people do, you must be doing something wrong.

>trying to work through free code camp
Did you actually do anything during your studies?
>>
can anyone recommend a crash course in java? i have some experience with high level languages
>>
>>68820801
How much is some experience? mooc.fi has good content, if you have some experience you might consider starting directly at part 2. But maybe even that is too basic.
>>
>>68820777

Yeah I did some stuff with Ocaml and did a "large scale" dev class where we did game programming and built a multiplayer shooter with networking, and did a bunch of security stuff, like a sandboxed war game in one class and basic cryptography. Nothing to write home about though, I guess. I did an "Algorithms and Data Structures" course and basically they covered like 3 data structures and no algo's, and I just picked up a few algo's here and there, but I get fucked pretty hard in programming interviews because I'm lazy and spend months not programming.

Idk I can schedule a phone interview soon for a "IT Engineering" job that has some development in it if I can pass the interviews, that'd be like a 20k/year increase from where I'm at now. Any other suggestions?
>>
>>68814484
Jesus christ
>>
>>68820725
>What should be used instead?
Haskell, Idris, and OCaml are just three examples of more practical functional languages. Assuming you're not just interested in writing pretend-FP as a thin layer over OOP libraries.
>>
>>68820830
learnt a bit of python
took a software design course in highschool in which i learnt VB and made some shit with it
i understand structures like multidimensional arrays and shit pretty well since that was stuff i had to learn
>>
>>68820834
>Yeah I did some stuff with Ocaml and did a "large scale" dev class where we did game programming and built a multiplayer shooter with networking, and did a bunch of security stuff, like a sandboxed war game in one class and basic cryptography. Nothing to write home about though, I guess.
I think it sounds like something to write home about. You just finished uni, you're not supposed to be a senior programmer. What you described to me would definitely make me interested in hiring you as a programmer. Not that I am in any position to hire programmers, but you get my point.
>>
>>68820754
rank-N types > anything OOP has to offer on the topic of encapsulation
>>
>>68820718
>leverage .NET libraries
Sounds like a great way to accumulate technical debt. OOP libraries are a false economy IMO. I agree about Idris, it's going to be the sweet spot in FP very soon.
>>
New thread:
>>68820951
>>68820951
>>68820951
>>
>>68820861
>Haskell, Idris, and OCaml are just three examples of more practical functional languages. Assuming you're not just interested in writing pretend-FP as a thin layer over OOP libraries.

I am not dissing on any of those.
I love Haskell, but it does not have a standardized gui framework. It does not have a web stack that lets you do everything from the web server to the frontend programming.

I am super impressed by Idris, but even Edwin Brady is calling it a research language, it is not appropriate to use in an industry setting, maybe in a few years. I mean he even stopped working on it and started on Idris 2.0, that just shows how early it is for that language.

I have no idea about OCaml. I'm sure it's great.

But you say more practical. In many ways I agree, but I brought up some points about F# that I think make it a practical language. Do you not agree with them at all?


>Assuming you're not just interested in writing pretend-FP as a thin layer over OOP libraries.
I'm interested in writing stuff that works. If it's FP or "pretend FP" is extremely uninteresting to me.
>>
Let's face it, even Lisp is better than Java and C# and it's older than them by decades. Unlike them it allows you to write and use non-trivial abstractions.
>>
>>68820961
F# has neither higher-kinded types nor ML modules. It is not practical.
>>
>>68820725
>At least not at all times, and the times you aren't can end up hurting you and your colleagues for a very, very long time.
Perhaps, but, that's the price you need to pay for faster performance. Additionally, with code review and a careful design process, you can very careful isolate the parts of your code where you are doing stateful mutations. You are bound to be correct a large fraction of the time, which is sufficient for most applications. And once again, performance is not something that can or should be ignored.
Also, Rust is a nice attempt at introducing functional paradigms to systems programming, but systems are definitionally stateful, so you will end up running into roadblocks. Have you taken a look at graph or doubly linked list implementations? They all require large unsafe blocks because of cyclic memory dependencies. Mutating state is often more efficient than not and rust is trying to target the efficiency space, so it has to make a somewhat awkward compromise. I'd rather have guaranteed safety or be efficient, not some safety == no safety and some efficiency. Also considering the language changes every other day and its generics aren't as powerful as C++'s I'm not amazed by it at all.
>>
I'm playing with opengl. I've generated a torus and a sphere. What are some other fun shapes I can render?



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.