/dpt/ - Daily Programming Thread

Old: Working on?

Other urls found in this thread:

en.wikipedia.org/wiki/Bouba/kiki_effect
youtube.com/watch?v=0QT4YJn7oVI
gnu.org/software/emacs/manual/html_node/emacs/Blank-Lines.html
twitter.com/SFWRedditVideos

First for C++ is shit.

Cred Forums Pass user since September 2012.

Second for fuck anime

>can't even post the /dpt/ correctly
baka desu familia
[Cred Forums Pass user since April 1945.]

...

What do you do when you want to work on a bunch of different things? One is work too.

What language should I learn first?

I ignore my responsibilities and play video games all night.

Python. Do not listen to the following autists who are about to try to waste your time with autistic memes.

Javascript, because it's easy and fun

wow

...

C

memes

4ᶜʰᵃᶰ ᴳᵒᶫᵈ ᵘˢᵉʳ ˢᶦᶰᶜᵉ ᴼᶜᵗᵒᵇᵉʳ 2003⋅

java, and you won't need anything else.

statements like these make me feel nauseous

Statements that evaluate to true?

Literally doesn't matter

>In 2001, Vilayanur S. Ramachandran and Edward Hubbard repeated Köhler's experiment using the words "kiki" and "bouba" and asked American college undergraduates and Tamil speakers in India "Which of these shapes is bouba and which is kiki?" In both groups, 95% to 98% selected the curvy shape as "bouba" and the jagged one as "kiki", suggesting that the human brain somehow attaches abstract meanings to the shapes and sounds in a consistent way.

>Ramachandran and Hubbard suggest that the kiki/bouba effect has implications for the evolution of language, because it suggests that the naming of objects is not completely arbitrary.

probably statements that are only true if you're a mentally deficient script kiddie.

Not programming related, but I did related the curvy figure to "bouba".

I have co-op job offers from two different companies. One is a 6 person team with small dingy office and the other is a 30 person team with a nice office. Both are mobile development jobs. Which one should I pick if I want to learn the most?

How do I estimate the upper bound for how much I can compress some arbitrary data before it has all of the repetitiveness squeezed out of it?

I think I'll do that too.

You will work with all 6 in the small job, work with maybe 1 or 2 in the big 30 job. You will not learn from the others in the 30 job, you will be doing nothing but learning in the 6 job.

anyone else program(ming) in Fortran95?
Im designing a program that works with Pythagorean triples and force vectors

My first language I learned in school was VisualBasic, then I learned Java, then at the beginning of last month I started teaching myself Fortran95.
Really one thing I like about programming is if you have good logic skills and can understand the basics of syntax learning a new language is easy
.if you think you only need Java then you should work for Notch designing only Minecraft mods, C/C++ is useful for many a programming task, Python is good ive heard, F95 can be used around the industry
very carefully :^)
desu I dont really know. what kind of arbitrary data are you working with?

sounds have different textures. so much of science is stating the obvious

C

It's still interesting to note that language-concept mappings aren't entirely arbitrary.

Sounds neato but there are some problems.

This is just one example of two highly different letters (in sound and picture, K and B are as "opposite" as letters can be) with two pictures which happen to reflect their phonological and pictoral representations (B: "Bulbous", pronounced with soft air through the lips, rounded letter; K: Jagged picture, harsh tight sound pronounced with roof of mouth and tongue, brings to mind Crackle, Kick, Karate, etc.).


If I give you these symbols:

| | AND |o

and ask you to assign then either "Herbert" or "Patricia", I shouldn't be surprised if you pick "| |" for Herbert and "|o" for Patricia, when there are obvious symbolic similarities between those two letters and the symbols provided, especially when the two are contrasted with one another.

However "|o" would not necessarily bring Patricia or even "P" to mind if you just laid out the symbol itself. It is only in the context of providing the words Patricia and Herbert that you assign them to two things. For there to be a real consistent relationship, you'd have to show images and ask people to relate them to words, which is so variable that there is actually a word for this sort of thing in psychology: a Rorshach test.

There is no reason to suspect some non-learned internal mechanisms which assign pictures to sounds. Differences in characters of different alphabets should be all the proof you need.

Haskell

Kiki is a harsh sound. It uses jaggy letters the the Ki sound is short and hard. Bouba is far less so. Seems obvious to me

Why is this?

That addresses letter -> picture mapping but not sound -> object mapping. Bouba makes a "round" noise, while Kiki is very "sharp". Bouba sounds stretched out and fluid, while kiki sounds short and rigid. Much like their associated shapes in that picture. It would be fun to see the experiment replicated on people with different native languages / people who can't speak English.

He didn't wear enough turtlenecks

So you guys are saying if we took a generation of children and taught them that the letter B is pronounced [kay] and the letter K is pronounced [bee], we'd get opposite results?

no, can you not read

there was a point on this about mother and father in arbitrary languages

mother is usually softer than father

>asked American college undergraduates and Tamil speakers in India
>Tamil speakers in India

Also, the original experiment was performed on Spanish speakers, although with the words baluba and takete.
>Although not explicitly stated, Köhler implies that there was a strong preference to pair the jagged shape with "takete" and the rounded shape with "baluba".

en.wikipedia.org/wiki/Bouba/kiki_effect

Games Unity and C#
Scripting Python
Web development Javascript
Kernels C
Scratch that ... Everything C

Still a pretty limited group of people. Chinese/Japanese/Korean respondents would be fun to see.

I can read that you both seem to focusing on the visual shapes of the symbols B and K.

I was literally talking about the harshness of the sound of K. Why are you talking about languages when you can't pickup on reading comprehension? K is a jagged sound, when with an I it produces a short, harsh sound that requires you to push a lot of air out. B does not, it's phonetically opposite in that little air comes out and it's easy to say. When coupled with the aou sound, it's long, and requires a relaxed mouth. Of course people associate those sounds with harsh/soft images respectively.

키키 바어버

Compile-time data structures when?

What do you even mean?

Now you're just saying "K is associated with jagged, therefore K is associated with jagged".

The fact that most people think that [kay] is a jagged sound is just what the experiment demonstrates.

>The fact that most people think that [kay] is a jagged sound is just what the experiment demonstrates.
That's not subjective. It's a harsh sound because it's short and loud. There's no way around that, what's your argument here, other than pretending you don't know what the words "harsh" and "soft" mean?

Do you mean static types? Because we have those in every non-pajeet language.

just write all your programs exclusively with template meta-programming in c++ header files

I don't have an argument. I was trying to understand what your argument was.

I still think it's interesting that one associates both an audio element and a visual element to the same concepts "harsh/jagged", even to the point where you think it's idiotic to question it.

Generation of data structures at compile time. Let's say you are making a compiler and you are generating a state matrix. The language is known at compile time and no cycles what-so-ever should be spent at runtime generating those structures. The structure should be created and stored in the executable. Most languages don't support that.

It's simple, it really is my dude

Ich habe drei Katze
That is a harsh sounding sentence, because the "ich" and the "Kat" require you to move your mouth into a somewhat uncomfortable position and they produce a lot of air. More air means more sound, more sound means loud, loud means harsh.

Run your nails down a chalkboard. It makes an "EEEEE" sound. It's unnerving, or "harsh". Now imagine running your nails down it again, this time it makes a "bououuuuuuuuuuuu" sound. It's not annoying now is it?

D can do that with inline variables
with some doing GHC/Haskell can do that, but you need a way to forcibly tell the compiler to (e.g. INLINE pragma or template haskell quote)

constexpr?

We live in a consumer society that worships bullshit material objects. A much larger percentage of the population knows what an ipod and ipad are than who know that c and unix are.

The same engine that generated the prosperity allowing us to have affordable microcomputers also generated the society that cares more about ipods and ipads than c and unix.

I don't know if you can do malloc / free yourself

>OOP
not even once

you don't use malloc/free since c++11

>loud means harsh
no it doesn't. not necessarily
the fact that you think it does is what's interesting about this experiment

And your other argument seems to now suggest that viewing the kiki shape is unnerving and annoying.

It's a start, but how about compile time support of the entire language?

>inline variables
I'll look into it.

You can't allocate dynamic memory compile time, no. This bothers you, somehow?

What?

I think they're working towards making constexpr work on everything that's constexprable.
Although, maybe not. That might potentially lead to huge executables. Were talking about unrolling our entire codebase here.

>compile time support of the entire language

why would this be necessary

If I had to show a graph that is user inputted variables, how would I title it?

if you use a pure functional language this is much easier :^)

"user inputted variables"

>using console.log to try and find out which variable/array I'm meant to update with changes to the vertex array

a user inputted string

jesus cringe
youtube.com/watch?v=0QT4YJn7oVI

is this what wdg is all about

Well it's something the programmer should have easy control over. If they can afford huge executables let them. But in certain cases like compilers where each use must be serially as fast as possible large embedding certain core data structures enable decreased execution at slightly larger executable size is a good trade off.

kalman fuck you

I can't even listen to that voice for long enough to find out what that has to do with wdg

I should mention it's for work. I feel like "user inputted" variables wouldn't be too professional.

Like above, it's for professional work. For example, let's say the data is for 10 diseases across 30 nations. Both are selectable inputs. Any ideas?

What's the fastest way for me to code smartphone apps? I have a couple of simple ideas and it feels like a decent way to break into programming. I don't have a lot of experience actually writing software, but I can into terminals and write scripts.

Why not just "diseases across nations"?

I like that. Thank you. Your input is gonna be used in a product probably only health officials will see.

user inputted string

why do all spanish people sound like they have a speech impediment?

Because they do. Spanish is a speech impediment.

*Castilian spanish

Playing around with Coq again, the more I use it the more I like it. I think i'm gay :^(

You misspelled ethpa~nol.

I'd have done the tile-n thing properly, but Windows is fucking retarded with regards to languages. I'm not about to set up another input language just to type the occasional fucking accent or tilde.

That's one thing I miss from the Macbook I used to use.

How does apple solve that problem.

I've learned the ascii codes for some of the non-english characters i use often and tap them out on the keypad. It's really annoying when i use linux though. Linux won't let me do that, and there doesn't seem to be way to configure Linux to let me do that.

I don't remember exactly, DESU.

What I do recall is this: there were shortcuts available for common Euro-language stuff (tilde, accent, umlaut, etc.) and switching between English and Japanese was easy, just Command+Space.

Windows now has Win+Space to rapidly switch languages, but before you always had to assign some hotkey like Ctrl+Alt, which was comparatively clumsy.

From memory, I want to say that Option+N would make an "ene".

>DESU.

WTF, I didn't type "DESU". What's this nonsense, Cred Forums substitutes some strings?

You serious, senpai?

wow baka desu senpai

I've always used alt+shift to switch between languages. But it's annoying to switch back and forth all the time.

Yes. I've been here for years and I've never had text get substituted in a submission.

pretty frequent occurrence on Cred Forums

Does anyone know of any resources on gameboy programming? I really want to make my own gameboy game. Yes, I realize it's 2016.

learn z80 asm

Already on it, I'm wanting to read some stuff about what goes into making a game both in code and in design. There's a lot of limitations that I'm not used to.

what's a simple, 2D game engine for beginners? I wrote a game entirely from scratch in C++, not really a game, just a character moving on the screen, and a sidescroller in Lua using the Love2D framework, but I want to start using a simple game engine. I want to make retro-style RPGs and platformers

also I would prefer the engine be in C++

>pretty frequent occurrence on Cred Forums

Why? What does that mean? Why was a word changed to DESU in my post?

newfag

Nevermind, I figured it out from Reddshit of all places.

>There are new wordfilters for:
>desu
>baka
>senpai
>cuck
>which now filter into baka, desu, senpai, kek, >etc.

We'll see how this comes out...

Let's test the filter...

>There are new wordfilters for:
>t b h
>s m h
>f a m
>c u c k
>which now filter into baka, desu, senpai, kek, etc.

If you want simple, make your own engine. Find a framework and build something off of it. Maybe SDL2?

castillian spanish, because that's the language that originated from castilla in spain.
fyi, they talk many different languages in spain...

int main()
{
return !solve(sequence, sequence_size, 1000000);
}

hmm good idea, maybe I will.

Any other frameworks that could help build a game engine? Maybe one with a lot of stuff for animations and collisions. Box2D?

I'm working on a project for class where I'm learning how to encrypt messages sent over a network between a client and a server. It's my first time using C++, but the syntax is just so strange.

I unfortunately don't know much about game frameworks, honestly. Generally, the more stuff your framework includes out of the box, the less control you have over those systems. Animations wouldn't be too difficult to make yourself if you're using sprites. And if you are going for the retro style, collisions shouldn't be too difficult either because your sprites will be pretty blocky.

I think you mean Cathtillian Ethpanish.

thank you again for your wise words, user. I'm gonna go build a game engine.

bye, /dpt/

>all this lisping
now you know what english sounds like to a lot of other nationalities

should I learn bash scripting?
thing looks so convoluted that I'd rather write my scripts in another language

working on a simple text editor

so far it's around 500 lines of C and can read/write files, insert/delete/navigate characters and handles vertical and horizontal scrolling, increasing buffer size, etc.

going to try to add skip/delete/splice characters/words/sentences/paragraphs functionality tonight.

C is the best for getting a gf

shell script is convenient for doing file and system tasks. if you know know of something better i'd like to hear about it

>Now you know what X sounds like to people who doesn't understand what a lisp is

How large a file can you edit?

I wanna do that. I need to figure out how to render text first.

>I need to figure out how to render text
printf

currently it loads everything into memory so basically whatever is reasonable to load from the hard disk at once time.

It uses a gap buffer structure so the size of the buffer shouldn't affect performance of local operations much.


i'm just doing a terminal editor
makes that easy

Don't wanna do a console app.

presentation should be separate from logic (^:

>gui
normalfag pls go

True, but i wanna do both.

>Been learning Perl
>Find it strangely pleasant to write in
>Don't actually have anything to write scripts for
why must this happen

fizzbuzz

>currently it loads everything into memory

Windows's Win32 supports memory-mapped files. Other OSes likely have similar functionality.

Track edits in memory, reflect them on-screen, and modify the file on save.

Building an i386 POSIX OS in asm and C86

>In turn, applies a parser that returns a function to a parser that returns an argument to give a parser that returns the result of applying the function to the argument, and only succeeds if all the components succeed.
what the fug :-DDDD

I need a C++ book to write a hash joins/set matching operator for a dbms.

I can already program C11/89, what's a good C++ resource, I have the basics already from an MIT course but lacking description of most lang libraries which I'm already coming across and wondering wtf is this how do I even.

tl;dr C++ documentation final solution

I really don't like weakly-typed dynamic languages, but fuck, python makes it SO EASY to create complex data structures.

tuples as return values, dictionaries (hashmaps) with crazy combinations of other structures as keys

I miss static typing, but compared to Java, creating data structures is so simple.

Is there any language with middle ground? Perhaps a statically-typed language that makes it really simple to make complex data structures?

I want to write my own ARP poisoning tool, where do I find all of the technical details?
When I googled it's not showing how it's actually done just what tools to use.
Maybe I'm not searching with the correct keywords?
Links? Anyone?

having trouble googlign this - is there a shortcut for entering a new line without having to go to the end of the current one and pressing enter (so that i don't have to do this part)? talking about sublime but i want to believe there's a standard

haskell

data Expr = Lit Integer | Add Expr Expr

parseLit = ...
parseAdd = pure Add parseExpr

C-o

Haskell

Are you guys just memeing or serious?

I have been considering getting into haskell, but haven't done much with it yet.

>C-o
right, sorry, what does this mean?

Yes

basically it takes two parsers (a and b), a returns a function, and b returns an argument. Then it passes b to a, and if that also succeeds the parse succeeds.

no haskell is really great for that once you get a hang of the type system and it doesn't trip you up so much

gnu.org/software/emacs/manual/html_node/emacs/Blank-Lines.html

C#.
Because literally everything is an object, you can create any form of data structure you could ever want, and make anything a return value.

sorry, I mean it passes the result of b to the result of a.

Is there any way to get valgrind to take me to gdb as soon as it encounters a memory error?

> C#
> everything is an object
Try smalltalk. In C# a lot of things are actually adhoc and not first-class objects. This doesn't matter much practically ofc.

Have any of you snuck your own botnet into company code?

No you cunt

should I use git even for simple math problems?

no

Treat git like a patent office. Only the stuff you want to make sure others see was aaaaaaalllll you. Of course, if it's a portfolio make sure to include small project programs and maybe a complete folder with your project euler code.

I said git niggas not github

don't post if you're a retard.

I said no not yes

I had the same thought

"Bouba" is too close to actual words that are analogous for "soft, round, fat" etc

is it possible to use vim for big projects? people keep saying that you need an IDE for that
is that true /dpt/

A makefile and text editor is all you need

You can use Vim for any size project. If you need auto-complete, use YouCompleteMe.

Yes, you can use vim

pretty much anything that can be done with an IDE can be done through vim (or emacs) with various plugins / extensions etc...

but by no means are they the same thing.

I made a highly customizable web crawler (more to come, the ultimate goal isn't web collection itself, it's data collection)
and now I sleep
probably gonna post this again tomorrow since nobody will see it

Been compiling a list of good C and C++ libraries for funsies and categorizing them.

>nobody will see it
Nice Java, fag!

t-thanks user

It's alright, I'm just fucking with you. I'm sure it's a decent program regardless. Also, there's a 1 in 4 chance I'm going to be having to use Java for a class this quarter, so I really shouldn't start making fun of people for using it, lest I jinx my chances.

As far as web crawlers I've used before, it's actually fantastic. It takes almost no time at all to check for duplicates because it uses a custom trie implementation and can filter for regular expressions (for instance, right now it's downloading every fullsize media file on the entirety of Cred Forums, ignoring thumbnails and repeats- so far it's got 2gb of unique content within ~12 minutes)

plus it's threaded and all that fun stuff

good luck with your java class, java is far from ideal

LMAO DID YOU JUST WRITE A WEBCRAWLER IN JAVA NIGGA

oh shit

in python that shit is like 100 lines tops

fuckin webcrawler in java really nigga

Lisp

>A multithreaded crawler with this much functionality would have been 100 lines
no it wouldn't have

you don't need multithread, just run multiple instances of the same script

how are multiple instances of the same script going to avoid rechecking the same pages
How are multiple instances of the same script going to avoid over-spawning themselves if you hit a bunch of difficult pages, or prevent infinite loops? (I.E. A: Big page, I need help ---> Creates B -----> B: Big page, I need help -----> Creates C.....

Playing with Processing

idk, use a database like redis?

look man im sure your script works great i just think it would have been easier if you wrote it in python

Vartender model 2.01?

Oi, hol up, those are mine webms, nigguh

XSE scripting works for some games

Gamemaker is your friend. The tutorials by rm2kdev are a great intro to using the engine for an rpg type game.

It's not a Java class, it's just that Java might be used for the assignments. The professor wants us all to be using the same language for the assignments, but is less concerned for the language used. She basically told us to write down our order of preference between C, C++, Java, and Python, and she'd come back with the choice of language for all of the class' assignments.

In any case, I've used Java before, and I've used Python before, but given my choices, I'd rather C++ or just plain C.

Inter-process communication. Which is what you should be doing in Python and Ruby if you want to do anything in parallel, since neither is capable of concurrent native threading because of the GIL.

now with two ants

Extracredits channel on youtube is great for starting with design

and now they're miiiiiine
and so is the rest of the media on Cred Forums, eventually
progress was easily trackable until someone crossboard linked and then the coherency of the log output exploded

Also, that looks cool. How quick is it?

Unless you're in an upper division CS class, good luck getting C as the majority choice. Even then it might be difficult.

looks good

...And we never heard from user again...

Lisp is DEFUN
>also dub dub

It's a graduate level AI class.

>How quick is it?
I'm doing 20 iterations for 4 ants at a consistent 60 FPS so I believe it could go much faster.

Totally agree, i learned data structures in java and c++.
Python is amazing

python is not weakly typed.

No since i have never been able to get a prog position. :(

Oh hell no emacs KILL IT WITH FIRE

My grad level ai class was a pleathora of powerpoints and Lisp.
>my univ is shit

Currently I'm working on a dominoes AI, so far I just have the Tile, Player and gamestate classes set up and it'll follow along a game and tell what player potentially has what tile. Anyway I'm gonna try running a BFS which is probably gonna turn out awful due to the complexity inherent in non deterministic games then after that fails I'll try implementing some form of Monte Carlo tree search.
P.S. I'm hacking all of this together in Java.

>trying to learn WebGL

How do I update a vertex array object?
And how do I create multiple vertex array objects and assign them to their respective attributes?

You'd think that with so many guides out there, one would make such important things immediately clear.

I just started learning C and tried to make a tic-tac-toe game what am I doing wrong:
pastebin.com/iQ2DQ7PJ

You should probably rename your variables to something more significant if you want people to help.

Yeah indeed. I wasn't gonna share it I was just playing around then I was like "let's do that" so yeah I should have done that.

Hello /dpt/ !

I require your help. I need to write a C# program that makes the user input his birthday date and then shows his age + 10.

This is my code so far:
using System;

namespace AgePlusTen
{
class Program
{
static void Main()
{
Console.WriteLine("Please enter you birthday as MM.DD.YYYY :");
DateTime BirthDay = DateTime.Parse(Console.ReadLine());
int age = (int)((DateTime.Now - BirthDay).TotalDays / 365.242199);
Console.WriteLine("You are " + age + " year(s) old.");
int sum = (age + 10);
Console.WriteLine("After 10 years you will be " + sum + " years old.");
}
}
}


How do I make it so it uses EU formatting and checking if the input is correct (otherwise it should ask the user for new input)

First things first: learn how functions work and don't write them inside of main. Don't do this:
int main()
{
void foo()
{
/* stuff */
}
foo();
}

Instead, do this:
void foo()
{
/* stuff */
}

int main()
{
foo();
}

And pass your arguments via parameters, rather than making them global.

>Don't do this
why ?

Brainfuck

How much JAVA I should know before I can get an entry level JAVA job?

I'm a little older and started later, I want to change career because my previous job made me want to kill myself.

What's the best route for me?

I'm in the middle of a Finnish University JAVA programme that teaches the basics of Java OOP

After that, I'm thinking of a few months of making Java apps just to practice, semi - real projects

I thought of learning the Android ecosystem next... and make some Android apps

is this a good path?

is it better to go freelance since I have no CS degree and I'm a little old?

or is it better to look for an Android Java entry level dev position ?

I'm willing to move to anywhere and accept almost any pay at this point

I'm in Europe

Trying to learn GLSL but nothing renders. Really fucks my shit up.

Well for starters, it's not actually allowed in standard C. GNU C allows it as an extension, but it's not an extension any C programmer ever actually uses. It makes your code harder to read and maintain, and most importantly, those functions can't be called from other functions in your program that may, for example, be in different files altogether (and when you don't want those functions to be visible, the standard keyword to use is static).

Basically, just don't nest functions. Ever.

You shouldn't ask this here.
Personnally I'd go with C because it will teach you rigor. You will tear your hair at the beginning and you will use Stack Overflow a lot, but this is the way to enlightenment.
If you want to become a dirty ass programmer, learn Javascript first. It will teach you how to store -34.62 fishing rods in the cell with label "bear" in an array of desks. Then you will be too lazy to learn more rigorous syntaxes and you will never grow out of it.
PHP is pretty much the same, maybe a bit less dirty. But you have to learn HTML (and optionally CSS) first, which may be a good start because they're not actual programming languages.

If you decide to go with C and want to do advanced stuff, you might also want to have a Linux machine. Not saying that C on Windows is bad, it works well for most purposes, but holy shit the Windows Shell sucks.

If I write something like
char x=0;
x+=3;
there is no implicit type conversion going on, is there? i.e. this is not slower than if x was an int, right?

Oh I see thanks.

>this is not slower than if x was an int, right?
Why would it be?

char is just a smaller int (depends on the system inb4 autists)

x += 3

is the same as

x = x + 3

is the same as

x = (char)((int)x + (int)3)

>standard C
Kek

>GNU C allows it as an extension
GNU C > C

>but it's not an extension any C programmer ever actually uses.
it's used in linux

>It makes your code harder to read and maintain
it's the inverse actually:
the global name space is not polluted
code locality is better
helps to avoid repetition of code
helps recursion

>those functions can't be called from other functions in your program
which is good.

Java, and you won't need anything else.

Someone told me that if you perform an arithmetic operaiton on a char in C++ it is always coerced to an int first, costing cycles. That seemed strange to me so I wanted to make sure I'm not crazy by asking you guys.

>in C

How do I use #define so as to replace every 0 with a char, "£"

I'm trying: #define 0 £
but getting : error: macro name must be an identifier

See

Yes, the b is soft compared to the k. So you associate it with rounded edges. Like bubbles, and bunnies. Hard sounds imply just that, cut, tip, point. The p, k and t are especially hard sounding imo.

>Kek
>GNU C > C
Laugh all you want, but there are cases where you can't use GNU C. In particular, you can't use it in the Intel C Compiler, which finds a number of uses on supercomputers.

>it's used in linux
It is not encouraged, and the style guide actually chooses its different brace style for functions on the fact that functions are "special" and cannot be nested in C. That said, I would expect that there will always be some code in the Linux kernel written by absolute retards.

Also, Linus says that if you need more than 3 levels of indentation, your code is screwed, and you should refactor it. Nesting functions brings in an additional unnecessary level of indentation, so fuck it, make it on its own.

>the global name space is not polluted
Make it static. Then, it's only visible within the file, and why would you ever write two functions with the same name within the same file?

>code locality is better
No it isn't.

>helps to avoid repetition of code
In no way does moving a function from file scope to nested avoid repetition of code. If anything, it may increase repetition if the same function is nested in more than one function.

>which is good.
No. You fail to grasp the purpose of a function. The point is to re-use code. If you do not wish to pollute the symbol table, you use the static keyword. Otherwise, you allow the function to be visible to other modules in your program so that it can be used as often as possible.

L-systems are fun

Do you reject closures as a matter of principle?

>In no way does moving a function from file scope to nested avoid repetition of code.
it actually does. functional programmers know how.

As they are used in functional languages, no. In C, absolutely.

That's nice. C is not a functional language (although it can be used functionally kind of), and nested functions are not considered to be good practice, even in GNU C.

>As they are used in functional languages, no. In C, absolutely.
Why

>Intel C Compiler
>supercomputers.
kek

Penrose in da house yo

If nested functions were a good idea, they would have been added to the standard. They aren't, and even among programs that make regular use of GNU C extensions, they are rare.

Oh, you haven't written programs for a Top 500 computer? That's cute...

>If nested functions were a good idea, they would have been added to the standard.
You'll be surprised when they are added to C21.

Why would you ever want that?

for a project
>do your own homework
im trying

0 is not an identifier (i.e. a valid variable name).
Pick something else.

1. You don't.
2. "£" is a string, not a char.
3. £ is neither a string nor a char.
4. If £ could be fit as a char, it would be '£'. As UTF-8, however, it takes multiple bytes, and therefore cannot fit into a char.
5. 0 is not an identifier; it is a value. So as mentioned in 1, you fucking don't.

i cant, thats the task!

Write a gui in assembly that preprocesses your files.

I have to print an array. so, array = { 3,2,1,0}
but i want to print 3, 2,1, £

brb, learning assembly

It's impossible using the C preprocessor. It's simply outside of what the language allows (or any sane language allows).

Tell your instructor that it's literally impossible.

Are you sure that this is not what they're asking for?
#include

int main()
{
int array[4] = {3, 2, 1, 0};

for (int i = 0; i < 4; ++i) {
if (array[i] == 0)
printf("£\n");
else
printf("%d\n", array[i]);
}
}

What is the exact wording of the task given to you?

Are you a C++ user?

Why does it shake so much

No?
What I posted was clearly C.

i swear this is always the issue

thats the solution, thanks.

>int main()
>++i
hmm

You fucking retard...

thanks

Finally gonna try Vim, lads.
Vundle is still the go to right?

I feel like I'm just too stupid for Haskell.

I just wanted a comfy programming language, not to take a fucking PhD in pure maths

we did his homework nice

Both are valid C.

"no"

it scared

>holy shit the Windows Shell sucks
?

Wow, I managed to fuck up posting that twice.

Are you fucking serious?
Did you just arrive here from 1980?

The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
parameters:

int main(void) { /* ... */ }

or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):

int main(int argc, char *argv[]) { /* ... */ }

baka senpai

I agree

The question mark of this stupid is for the reason of saying sucks instead or useless.

Sucking implies pleasure.

I'd like to write some scripts or small programs that make use of graphical alerts, I was going to use Python but I actually don't have a clue how to do anything graphics/windows-wise in it.

Is there a framework for writing graphical elements in Python?

Programming never involves posting information that another programmer did not look up.

Would you like the last index search I did about binary tree exception validation.

No you would not.
It would be like me posting my google results to people looking for help for having sex. They don't want results, they want help.

If this did not make sense then you should fuck off for reading useless shit. Not that you know how to read you fucking retard.

int main() is compatible with int main(void).
The semantics are different with prototypes, but are the same for function definitions.

How the fuck asked for this?
Cunts should learn to search for this shit.

Stop flooding your lacking education results.

Pussy ass tree

The use of function declarators with empty parentheses [...] is an obsolescent feature.

Don't go full baka.

function dick(){
system.cunt("fuckoff");
}

There are plenty.

The use of a function...

Who the fuck is getting taught programming here.

Fucking end yourselves. Let retards learn this shut by themselves. Stop stating useless statements.

Hey. Hey. Hey. Guys, want the entire dictionary posted on here. I know you didn't ask for it but fuck it.

>KYS retard

Reported

But hurt nerd.

It is not my fault you started a programming lessons on a non stackover flow website.

Sorry but if cunts cannot read then let me continue to be potato programmers.

So you just admitted that it's still valid.
Just because something is obsolescent, it doesn't mean that it's valid.
I can write
int typedef myint;
and you can't call it invalid.
Sure, it might be stupid, but not invalid.

>that it's valid
invalid*

le reported meme
le lack of of power statement

Do you also come with fedora hats...

its valid ffs.

Didn't take long.

Tell your girl that she has a pussy for a bf.
>Assuming you have had sex at least once.
>If not, remove everything but you being a pussy.

>
>This

No one cares about being reported. You just lack the ability to contemplate not being a total fucking retard.

You do not need to state you reported anything. Just fucking do it.
>God I hate retards like you.

No OP btw.

The cancer you created.
Wow.

By any chance have you even programmed before?
Have you not been taught on how to handle fucked feedback. Somehow I can see why you're a NEET.

When I report someone I do it without a post following. What are you after by doing this?

Reported for off-topic

new thread when ? :3

Category theory is an undergrad course.

>Trying to solve this with macros
nigga, what are you doing

Someone tell me what SIMD is and why I should care

He is most likely Andalusian, to be specific. It is a province within Spain that uniquely pronounces the letter s and c as a th. Other Spanish speakers will mock them incessantly for this .

imagine you have 2 jews
you drop a penny
they both go an pick it up at the same time

If you don't know, you shouldn't.

>confusing SIMD with race conditions

Your life is absolutely worthless. Please end it immediately.

function declarator and function definition are two different things.

One is a subset of the other.

Cool. You learn new things on /dpt/.

>john mccarthy is ignored so much he's not even mentioned in that pic

Any idea pitches for a final year CS project?

what is obsolescent is a prototype being untyped when the parameter list is (). defining a function with () as the parameter list is the same as with (void), it's a feature that has been introduced with c99 for compatibility with c++.

kpop idol facial recognition

Finally figured out my compilation issues & crashing issues -- who the fuck would have expected a service called 'Application Experience' to have any effect on file accessibility?

Try vimtutor

>haskek
>category theory

And, as much as I love Ritchie, we had programs & generic text languages before he designed C with Thompson. There was a whole slew of them, even.

The guy said

>not to take a fucking PhD in pure maths

so the logical conclusion was that the guy was complaining about category theoretic concepts.

>Application Experience
Sounds like something Pajeet would put in his resume.

I'm as surprised as anybody else would be. I guess Application Experience is really doing the needful.

Nothing.

Reddit Gold user since November 2015.

but category theory is an undergrad course :^)

there is nothing difficult about category theory

Maybe the "category theory" that Hasklel uses, anyway.

Category theory is type theory for babbies.

Well, there's a reason it's called "C" user.

So why didn't Bjarne call his language D?

Because it's built on top of C? So it's like C with a lot of add-ons, so C++ instead of differentiating it completely by calling it D.

because it built on C

I really like my job, but I'm thinking I will need to start looking for a new one next year.

The problem is that a very arrogant software engineer at work has basically taken control. She is charging full force on this big rewrite project and has convinced management to sign on. The problem is that the system is fundamentally broken. Basically, what we have is a sophisticated ETL program for managing insurance data. Currently, the system has the "transform" and "load" process being completely separate. There is very good reason for this. A LOT of additional steps can happen between the initial transformation and when it finally gets loaded. Additionally, the load process is non-trivial. It's actually more of a "merge and load". We have 100+ different transformers and the load process needs to merge them and perform cross validations before it puts it in the target database. So don't think of the load program as just a SQL insert. it's much more sophisticated than that. Somehow, this idea that the transform and load steps can be combined got spread and a rewrite project to do that commenced.

So now we have a situation where we have two very complicated programs being combined into a single monolith of even greater complexity. A lot of our other software that did those "additional steps" between the transformation and the merge/load process now have to be rewritten to accommodate that. So the rewrite of one project has basically been bloated into a rewrite of nearly our entire organizations software systems.

(continued in next post...)

continued from..
But it will be okay at the end, right? No. That's what I mean by fundamentally broken. A lot the things we NEED to do are now IMPOSSIBLE with this new design. It just won't work. It's now been four years, the scope creep on the project gets bigger and bigger and it's now reached a point where it's "too big to fail". Too much has been invested for the organization to back out now. Shit is going to hit the fan HARD.

The cause of all this is a single software engineer who managed to convince upper management that this was a great idea. Was anyone else consulted on this or asked for input? Nope. Literally EVERYTHING in a 500 person organization is changing because one individual is a bit of a control freak.

Already there is talk about her "transition". You might think that means she would be fired for gross incompetence, right? Nope. What I mean by transition isn't that she gets fired, but instead gets to move onto another project after this garbage goes to production. In other words, she gets to lead the charge, rule over everyone with an iron fist for 4+ years, then when the thing ultimately fails, she gets to divorce herself from any responsibility and say "not my problem anymore". That's fucking infuriating.

>She
hmm

>what are office politics for $400

Just ride the wave and do good work

Aggressive power freaks get money, sorry to say. You can only hope they are half-way competent. That sucks though m8.

So she fucked up your software, but why do you want to leave? Is the work unbearably difficult or stressful now? If you are very familiar with the subject you could go work elsewhere in the field, tell them of your mistakes, and be that aggressive dick, but set things straight if they are out of line. If it ends up doing good you'll get a nice management job. Shit pays better even though managers usually do fuck all.

To be fair, C++ is further from C than D is at this point.

>a single software engineer who managed to convince upper management that this was a great idea.
But what made HER think it was a great idea?

Her gender isn't the issue. We have a lot of great female developers where I work. Also, there are plenty of men with the same kind of mindset. The worst situation was a couple years ago when some intern started committing code to a project I was in charge of. He was new, so I figured that maybe he got confused about what he was supposed to be doing and started working on the wrong project. I went and introduced myself, told him I was the project lead, and asked him about what he was really supposed to be working on since he wasn't on my team.

The intern looked at me with surprise and said, "But I thought Craig was in charge of this project?" I had no idea who the fuck Craig was. I had to talk to a lot of managers to figure out WTF was going on and why this unknown Craig person thought he was in charge of my project and why he was telling this intern to make changes.

Turns out he is such a control freak and wanted to impress this intern (how fucking pathetic can you get to want to impress an intern?), that he basically picked a random project to try to hijack and claim to be in charge of.

>actually working for a woman boss

C was written as a substitute for B.

>actually being a NEET with no experience in the real world

Whats the easiest way to make android apps. I know c++ really well but have barely used java. So id like to use c++ since I dont have to think about the syntax of everything.
Not looking for a super complicated touch screen master piece game. A basic gui with buttons and a large box that displays dynamically is really all Im looking for right now.

Did you actually do anything about it or say anything to anyone?

>muh real world meme justifying being a faggot

just do it in Java

> >muh real world

She doesn't think it's a good idea, just different. You've never heard this tactic before? New person comes in, convinces management that what they are doing is wrong and what they aren't doing is right. If it works out they get awarded a nicer job because of their good idea. If it doesn't they get fired or leave and they do that shit to the next business they get hired at. It's a con, it's a self-important gambit, but it's common. Managers usually become wise to this shit soon, but god knows any retard can pass through business school these days.

This is Dilbert tier farce

Haskell a shit. You want to feel smart? Read a quantum mechanics book. Fuckers

>jealousy

I can't even fathom anyone being this devious on this scale.

I've asked this many times. I think the project only exists to satisfy her ego and for her to have control over something. I got very hand-wavy, non-specific answers whenever I asked. The only real technical reason I heard was that in some specific error scenarios the data can get out of sync between a transformation and the load procedure. This requires starting the process over again with fresh data. It's really not a big issue at all. It doesn't happen often and is trivial to fix. Because the rewrite version of the project does the transform/load process together, there isn't an opportunity for an errant program to accidentally modify the data between those stages in an invalid way, thus it resolves that issue.

That's the closet thing I got to a real answer. It's a dumb answer though because we're basically trading one flaw that is easy to fix for an entire mess of technical debt and a billion other flaws. When I asked, "well then how do we do X, Y, and Z if the transformations and loading aren't separate?" and I never got an answer other than "I don't think that's an issue". It is an issue. It's a massive issue. It's just not an issue to her because she isn't involved in those projects that get fucked up by it.

Sure, but even still, how do you convince management it's a good idea?

>Let's combine two fundamentally different portions of our software solution into one mega-clusterfuck! Separation of concerns? pshaw.

devious? scale?
Some people will do anything to make more money. She was lucky really. If she came to me I'd tell her to fuck off, but that's because I know the business I'm in. Apparently, that business has middle managers who don't know anything about their industry and trust their knowledge (or fancy sycophancy) more than the judgement of their subordinates. Also if I was a low-level manager or project lead and I didn't agree I would've quit. No middle manager that listens to the snake oil salesman is worth working under.

She isn't my boss. In fact, my boss has been a total bro. I've told him how I think this project is going to be a massive failure and he's done what he can to make sure I don't have to be involved. He can only do so much though. When this shit gets turned on for real, it's going to affect nearly every project at our organization, so one day I am going to have to face the results. That's why I'm thinking of a new job.

in haskell this is just

load >>= transform

/!\ A L E R T /!\

New thread

/!\ A L E R T /!\

Monads are the future.

Well management doesn't always know the business they are in well. Maybe it's just more pronounced in the software development industry. I hear all kinds of horror stories about incompetent management.

>she
and that project is going to be a waste of money and will never get done

monad transformer classes are pretty good

To add:
The middle manager probably also see the success of this change as a way to climb the ladder. He is in a comfy position where if it does work out he can claim the responsibility, and if it fails he can blame it on her. But that depends on how big the company is. You couldn't pull that off in a small company.

Jealousy for what? Because of your placebo? You are a living meme.