Programming

  • 🔧 Actively working on site again.

bearycool

Gay God of Kiwi Farms
True & Honest Fan
kiwifarms.net
Joined
Aug 11, 2015
#include <autism.h>
#include <lolcow.h>

Int main (void)
{
Because why not have a deep thoughts about this?

After all, programming is pretty important, yo.

This does not necessarily mean you have to explicitly know coding in itself, but you can talk about theoretical problems, or pseudocode your shit. It is preferable you know some stuff just cause some of the discussion is going to get into complex ideas, but that's up to you. This is just a place for kiwis to sperg about this shit, as I've seen chat get really hyper about this stuff sometimes.

Also, if you are learning programming right now, this is the place to ask questions on what you're having trouble, and walk through certain problems as well.

To start, let's begin with something simple: what was your first programming language/ do you want to learn one if you haven't yet? Why do you want to code/ what makes coding interesting to you if you feel like you can't code?

}
 
public string Reasoning ()
{
string sperg= "Well, I program (dabble in the C languages, Java, the various web languages- HTML5/CSS/JScript/Jquery and all the libraries). Coding interests me mainly because it's a way of turning a few words into something either potentially awesome, or a massive spergfest (like Bob's Game)."
Debug.log(sperg);
return sperg;
}
 
Y'know, now that I think about it, I don't know how good most sperglords actually are at programming. In my experience, good communication is very important to being a good programmer.
@KatsuKitty would have an opinion on this.
 
@KatsuKitty would have an opinion on this.
Katsu communicates just fine, as far as I can tell. Like, in one of his projects, he implements an OOP setup in C. In my experience, novice programmers would find that sort of concept to be mindblowing. I think that's caused by excessively concrete thinking.

It's also why you see novice programmers sperging about which language is better, or why other languages suck. Autism.

Edit: Not that all novice programmers who think this way are autistic. I'm just saying autism would just make these normal novice problems worse.
 
Last edited:
  • Like
Reactions: ActualKiwi
That and programming kind of needs to be coherent, not some rambling monstrosity
Oh god, absolutely.

Stuff like single letter variables and a giant web of obscurely named functions with setjmp/longjmp scattered everywhere. Yes, yes, I'm sure the performance is absolutely boner inducing. And I'm also sure the guy's remaining coworkers are going to have fun debugging that after the author gets fired.

That's not rainman-like brilliance. That's rainman-like going-to-fuck-the-company...ance.
 
I'm too lazy to write main() right now.
Have fun with this shit code.
//@author: Purple Man
//@version: 0.0.001
#ifndef SHITPOST_H
#define SHITPOST_H
#include <string> // std::string

class Shitpost
{
private:
typedef enum
{
ERROR = 0, //Not needed, but it's good to keep track on it.
KNOWN = 23, //Normally would be previous value+1
BARELY_KNOW = 42,
NOT_KNOWN = 666​
} language;​

private: //Not needed, but helps.
std::string programming_skills(language);​

public:
std::string ask_me_shit();​
}

inlnie std::string
Shitpost::programming_skills(language option)
{
std::string knowledge = "";

switch(option)
{
case KNOWN:
knowledge = "C, C++, Java";
break;​
case BARELY_KNOWN:
knowledge = "Pascal, CSS, PHP, HTML5, JavaScript, bash";
break;​
case NOT_KNOWN:
knowledge = "Ruby/Rails, BrainFuck"; //And some others I don't
//feel like typing in.
break;​
default:
CATCH_ERROR_EXCEPTION(option);​
}
return knowledge;​
}

inline std::string
Shitpost::ask_me_shit()
{
std::string question = "";
std::string answer = "Something went wrong.";
language option = 0;

while (!option)
{
printf("Ask me what language I know, would like to know or don't know.\n");
scanf("%s", question);

if (question.find("quit") != std::string::npos
|| question.find("exit") != std::string::npos
|| question.find("I want to get off Mr. Bones Wild Ride") != std::string::npos)
{
answer = "Bye!";
break;​
}

if (question.find("fuck") != std::string::npos
|| question.find("bitch") != std::string::npos
|| question.find("cunt") != std::string::npos
|| question.find("cuck") != std::string::npos
|| question.find("faggot") != std::string::npos)
//Add more swear words if needed.
{
answer = "Rude!";
break;​
}

if (question.find("don't") != std::string::npos)
option = NOT_KNOWN;​
else if (question.find("would") != std::string::npos)
option = BARELY_KNOWN;​
else if (question.find("know") != std::string::npos)
option = KNOWN;​
}

if (!option)
answer = programming_skills(option);
return answer; //Having only one return in a method's body makes it easier to read.​
}
#endif

And to avoid double-posting:
Stuff like single letter variables and a giant web of obscurely named functions with setjmp/longjmp scattered everywhere. Yes, yes, I'm sure the performance is absolutely boner inducing. And I'm also sure the guy's remaining coworkers are going to have fun debugging that after the author gets fired.
Jumping is frowned upon, really. You only use it in low-level programming languages where it really is a necessity (i.e. Assembler).
And don't get me started on single letter variables. The same guy who codes shit like that doesn't remember quarter of what he tried to convey after a week.
Performance is only an issue in a real-time programs. When you're filling your taxes, two or two hundred processor ticks don't matter at all. Then again, poor optimisation can be a serious issue even for a simple calculator.
 
  • Agree
Reactions: Marvin
Oh god, absolutely.

Stuff like single letter variables and a giant web of obscurely named functions with setjmp/longjmp scattered everywhere. Yes, yes, I'm sure the performance is absolutely boner inducing. And I'm also sure the guy's remaining coworkers are going to have fun debugging that after the author gets fired.

That's not rainman-like brilliance. That's rainman-like going-to-fuck-the-company...ance.
Yep, that's one of the basics we were repeatedly (always) taught when I was studying programming- make sure your variable and function names clearly indicate what the hell they actually do/represent, and try and avoid needless spaghetti code. Some people just seem to forget that as soon as they get into the industry though >.>
 
  • Agree
Reactions: Marvin
Katsu communicates just fine, as far as I can tell. Like, in one of his projects, he implements an OOP setup in C. In my experience, novice programmers would find that sort of concept to be mindblowing. I think that's caused by excessively concrete thinking.

It's also why you see novice programmers sperging about which language is better, or why other languages suck. Autism.

Edit: Not that all novice programmers who think this way are autistic. I'm just saying autism would just make these normal novice problems worse.

Object-orientation was a design pattern before it was a language feature. The idea is not that mindblowing when you understand how it works under the hood. C++-style object orientation is what I aim to replicate with the setup I use for my current project, a Steam-like ROM downloader for classic 16-bit consoles (and clones) containing USB-enabled flashcarts like SD2SNES and Mega Everdrive. It provides code organisation without the heaviness of C++ on a platform where C is already pushing it.

It's actually pretty inelegant or at least I think it's not where I want it to be still. Here is the BaseView class I define and descendent classes. Use of the struct and the "this" pointer in each function provides the application with encapsulation; vtables enable inheritance and allow me to define descendant view types, where I can add any descendant of a BaseView and call "render" on it no matter what type of BaseView it is.

This kind of organisation provides me with a familiar widget toolkit paradigm enabling me to put together a user interface on an embedded system with relative ease; it can be bloated with RAM though so it remains yet to be seen whether or not I'll run out of that 64KB the Sega Genesis offers. I don't particularly consider myself a seasoned systems programmer, and if you're experienced in Java or anything web-related you can see the clear design influence on this project.
 
Last edited:
Object-orientation was a design pattern before it was a language feature. The idea is not that mindblowing when you understand how it works under the hood. C++-style object orientation is what I aim to replicate with the setup I use for my current project, a Steam-like ROM downloader for classic 16-bit consoles (and clones) containing USB-enabled flashcarts like SD2SNES and Mega Everdrive. It provides code organisation without the heaviness of C++ on a platform where C is already pushing it.

It's actually pretty inelegant or at least I think it's not where I want it to be still. Here is the BaseView class I define and descendent classes. Use of the struct and the "this" pointer in each function provides the application with encapsulation; vtables enable inheritance and allow me to define descendant view types, where I can add any descendant of a BaseView and call "render" on it no matter what type of BaseView it is.

This kind of organisation provides me with a familiar widget toolkit paradigm enabling me to put together a user interface on an embedded system with relative ease; it can be bloated with RAM though so it remains yet to be seen whether or not I'll run out of that 64KB the Sega Genesis offers. I don't particularly consider myself a seasoned systems programmer, and if you're experienced in Java or anything web-related you can see the clear design influence on this project.
I'm curious to see this project in action once it emerges into the world of completion. It intrigues me.
 
Jumping is frowned upon, really. You only use it in low-level programming languages where it really is a necessity (i.e. Assembler).

I've used goto in C to implement a "finally" pattern. Not sure if that's best practice, but it is a suggested practice.

Here is an example from a unit test in my Sega Genesis ROM downloader. TestFramework_EXPECT is a preprocessor macro that jumps directly to finally if the assertion fails, and outputs the "it should" text to Gens' KDebug_Alert console (or on real Sega hardware, it can be the Everdrive USB port).
TestFramework_TestResult LinkedListTests_verifyLinkedListCreated() {
TestFramework_TestResult testResult;
LinkedListNode* node;
node = calloc( 1, sizeof( LinkedListNode ) );
TestFramework_EXPECT( node != NULL, "no heap corruption" );
LinkedListNode_ctor( node );
TestFramework_EXPECT( node->data == NULL, "node data after construction to be null" );
TestFramework_EXPECT( node->next == NULL, "node next after construction to be null" );
testResult = TestFramework_TestResult_TEST_PASS;
finally:
if( testResult == TestFramework_TestResult_TEST_PASS ) {
// This method is simple enough to just use directly untested
LinkedListNode_dtor( node );
}
return testResult;
}
 
  • Feels
Reactions: ActualKiwi
Null is pretty much a programming wizard and. . .yanno.
 
Should work without a login, I've just tried it in incognito mode...weird...
And... after opening it in incognito, and then normally, now it works for me. Nevermind then.

Also, nifty.
 
Because tcc for 65816 is SHIT, I'm going to implement the SNES version in plain assembly. That will certainly be an adventure.

section .text
global _start

_start:

mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int 0x80

mov eax,1
int 0x80

section .data

msg db 'That shit is going to suck, Katsu!',0xa
len equ $ - msg
 
Back