[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 325
Thread images: 35

File: nwt7x5fr9mlz.png (208KB, 500x700px) Image search: [Google]
nwt7x5fr9mlz.png
208KB, 500x700px
What are you working on, /g/?

Old thread: >>62431668
>>
How do I free a trie?
>>
>>62441186
Recursion
>>
>>62441191
Thanks
>>
reminder that if unit tests arent a native feature of your language, it's time to switch.
>>
>>62441264
such as
>>
currently participate in a course about mobile phone application development. the main course is about java but the lecturer tell us that for the final project we can do whatever we want be it ios, android, etc.
Can i have a suggestion for what platform should i make my project on? please anon?
>>
>>62441273
depends on your field.
>>
>>62441273
Rust.
>>
File: 1494653714143.jpg (109KB, 539x410px) Image search: [Google]
1494653714143.jpg
109KB, 539x410px
>>62441293
>*for whatever reason*, it's time to switch to Rust
>>
>>62441273
Rust and C# and maybe python
>>
how can I become a C Hacker, /dpt/?
>>
>>62441327
Learn ASM instead.
>>
>>62441333
but C Hackers are cooler
>>
>>62441324
(You)
>>
What are some good MOOCs on algorithms and data structure?
>>
>>62441350
>but C Hackers are cooler
Not really, ASM people have infinity more respect. C's learning curve is fucking nothing.
>>
2^n > n > m/2^n > m/n > ...
>>
>>62441394
> ASM people
All 3 of them.
>>
>>62441175
A cookie clicker for iOS in unity, for my cousin to use as a sort of "proof of concept" when showing investors he can do stuff
>>
>>62441273
D
>>
>>62441436
>what is rom hacking
>what is emulation
>what is embedded systems
>what are compilers

C brainlets need to go and stay go.
>>
>>62441448
>emulation
>embedded systems
Done in C.

>what are compilers
Generating assembly is far easier than trying to write large applications in it manually, and that's nowhere near the hard part of compiler-writing.

>what is rom hacking
Sure, I'll give you that one.
>>
>>62441446
unless that thing is generating revenue i would look for something cooler to try to impress investors with
>>
>>62441469
>there is no ASM in emulation
PLEASE stop existing.
>>
File: 1500199337112.png (94KB, 971x280px) Image search: [Google]
1500199337112.png
94KB, 971x280px
>>
>>62441475
>people still write emulators in assembly
But they mostly don't.
>>
>>62441478
writing in != using
Emu's arent even just written in C anymore though.
In fact the big ones are sepples.
>>
>>62441471
No, the actual project is unrelated to the cookie clicker he just wants a simple app to show off and say "look I'm a dev, too not just a network engineer," the actual product he wants them to invest in is based in customer service and would need to connect to restaurant backends and network all sorts of shit together (without giving away the idea it's all I can say).
There's no way we could make a demo of that, he needs money to get started and hire a serious dev team for shit. He has is drawing out the whole business model and plan and shit. Don't worry, not retarded.
>>
>>62441485
>writing in != using
How are they "using" it, then? Emulating a particular CPU's instruction set in no way requires you to be an assembly hacker. I know it because I've done it numerous times.
>>
File: anime BITCH.png (708KB, 1280x720px) Image search: [Google]
anime BITCH.png
708KB, 1280x720px
>>62441175
If I have n different audio samples represented as 32-bit floats between 0.0 and 1.0, and I want to mix them together, do I just sum them all up and clip to 1.0 if the sum is greater than that? Is that all there is to it?
>>
Is there a language that looks similar to java but gives you regular binaries?
>>
>>62441476
Do they have anything worth reading in this guides? I just started python after java and c++.
>>
>>62441510
you still have to use it and know it even if youre not writing it in 100% asm.

And for emulation you will eventually have to touch it. Don't even know why youre trying to argue this hard. C is on its way out because its a shitty brainlet lang.
>>
>>62441527
java 9 will allow ahead of time compilation if that's what you mean
>>
>>62441175
Is rust a meme?
>>
>>62441551
sorta, but you should learn it any way.
>>
>>62441535
>you still have to use it
You don't "use" it at any point.

>and know it
You don't even have to "know" it, you literal retard. You have to know the details of the CPU and the instruction set. Chances are you won't even see any assembly.

>C is on its way out because its a shitty brainlet lang
I don't even program in C these days anymore, but you're clearly some kind of degenerate sepples user. Assembly programming is pretty limited these days, even if you're programming embedded applications. Stop spreading misinformation.
>>
>>62441558
What for?
>>
>>62441591
insight
>>
>>62441527
C++
;)
>>
>>62441522
yes
>>
>>62441522
Yeah, just add them together. As long as they aren’t correlated it’s not a big deal. Adjust the gain on the output. This is the canonical way to do it
>>
>>62441548
basically I just want to be able to run it without the jre
>>
>>62441628
c++ looks way to different
>>
>>62441635
might run without the jvm but I doubt it'll run without jre

go look some languages with compilers that typically emit fat binaries like Go
>>
>>62441635
j2exe?
>>
>>62441635
http://www.mono-project.com/docs/about-mono/languages/java/#compiling-java-code-to-x86-code
>>
>>62441634
What do you mean by adjusting the gain on the output? I also need to modify the final volume somehow? It's not determined by the sum of the amplitudes themselves?
>>
>>62441527
Basically, no, there’s small trade offs for anything else. Go if you’re ok with losing a lot of OOP (a good thing, probably). Python if you know there’s an interpreter (any Linux system). D if you’re ok with a slightly less popular language. Vala if you’re a weirdo. C# if you’re on Windows. Typescript/dart if you have a js runtime. Don’t write cepples if you’re not comfortable with super complex memory management

But basically, no, nothing has the libraries of Java and the ease of writing
>>
>>62441635
>compile java program with static jre
>hello world binary is 218mb
>>
>>62441697
C# can be compiled to native code?
>>
>>62441696
I mean turn the volume on your speakers. As long as the signals aren’t correlated it’s fine, this is how your ears work. Adding 10 uncorrelated samples won’t make it 10x louder, it’ll be 3.2x
>>
>>62441527
D, it's probably the most under-rated GC'd language
>>
>>62441722
> the most under-rated GC'd language
That would be Haskell. D really has nothing special about it to be underrated, it's just a weird C++/Java hybrid from the late 90s.
>>
who here uses vscode
i am trying to get it to check my python code for errors as I go like any IDE would, I have the python extension installed and pylint, all the paths are correct settings are turned on, and yet nothing happens
i can write gibberish and not a single complaint will show anywhere
>>
>>62441731
Haskell would be one if it wasnt painfully slow.
>>
>>62441731
>hasklel
please. Go circlejerk about your type theory academia bullcrap somewhere else
>>
>>62441737
>i can write gibberish and not a single complaint will show anywhere
Isn't that how Python works?
>>
>>62441731
lol, Haskell is not underrated. It’s taught at universities and every programmer I know knows it, including my nonhacker engi friends
>>
>>62441731
>haskell is so underrated!
Is that why it has armies of shills telling everyone how great it is everywhere and all of the time? Looks rather overrated to me.
>>
>>62441737
did you reload it?
Did you make sure your PATHs actually work?
>>
>>62441751
>every programmer I know knows it
Guess how I know you're a sepples user. (Protip: don't lie so boldly next time)
>>
>>62441744
haskel fast, just don’t use any builtin data types and write this 200 line symbol soup pure code that simulates nonpure code :-)
>>
>>62441765
cepples is disgusting. move to SV and meet skilled programmers, it’s refreshing
>>
>>62441722
>>62441697
I'll probabbly look D then
>>
File: Untitled.png (7KB, 689x109px) Image search: [Google]
Untitled.png
7KB, 689x109px
>>62441761
yup, that location is in my PATH and pylint is also installed on that environment
>>
>>62441731
I'm surprised more people are attacking Haskell than defending D.
>>
http://ddili.org/ders/d.en/
>>
>>62441787
>>62441797
>>
>>62441789
so you can actually run python stuff but none of your extensions work?
>>
>>62441795
Maybe because haskell is useless?
https://www.youtube.com/watch?v=iSmkqocn0oQ
>>
>>62441775
kys fag
>>
>>62441795
>I'm surprised
why is that? haskell is fucking garbage and its users are smug reddit fags. D is meh/irrelevant
>>
File: 1480556889035.jpg (345KB, 830x830px) Image search: [Google]
1480556889035.jpg
345KB, 830x830px
>>62441797
thank you anon
>>
>>62441814
poorfag neet is mad he can’t into irl professional satisfaction
>>
Okay I wasted a whole day because I lost interest in reading through "Compositions", "Aggregations" and "Association" --because I fail to see a practical point of these theories.

This means that I am moving too fast with C++.

I have been doing uni-fags' homeworks in reddit for free because I like doing those and it boosts my confidence. I dropped out of the uni. Where can I find some more uni homeworks?
>>
>>62441852
How about you build up your portfolio and apply for jobs lad?
>>
File: tumblr_nz0jt3jM421sbzv20o1_500.gif (2MB, 500x522px) Image search: [Google]
tumblr_nz0jt3jM421sbzv20o1_500.gif
2MB, 500x522px
>>62441833
np
>>
File: 848.png (205KB, 659x525px) Image search: [Google]
848.png
205KB, 659x525px
How do I program in machine language?
>>
File: Capture.jpg (35KB, 844x239px) Image search: [Google]
Capture.jpg
35KB, 844x239px
>>62441807
I must be overlooking something. Where am I supposed to check if they don't work? All the consoles don't say anything is wrong.
>>
>>62441175
In C++ can you forward declare standard library classes like fstream?
>>
>>62441862
>jobs
Dude I don't even know about inheritance, move-semantics and templates yet. I have a C++ project as a clear goal though
>>
>>62441866
become a hardware dev and make your custom environment.
>>
File: 1485646993138.jpg (41KB, 466x800px) Image search: [Google]
1485646993138.jpg
41KB, 466x800px
>>62441833
>>62441863
cute
>>
>>62441866
read the specifications of your CPU
>>
>>62441866
dumb frogposter
>>
File: 1503659746434.jpg (44KB, 640x360px) Image search: [Google]
1503659746434.jpg
44KB, 640x360px
>>62441881
fun ends here
>>
>>62441866
Read the manual.
It's not any harder than ASM, just more tedious.
>>
>>62441868
Are you actually saving your file after the gibberish?
>>
File: 1486431480793.jpg (31KB, 695x363px) Image search: [Google]
1486431480793.jpg
31KB, 695x363px
>>62441899
>>
So i have two local variables in C with same name. One is declared right in method and another is declared in code block inside method.

How do i access outer local variable without using pointers? (this is done just for research purposes)

Currently i managed to print outer variable using pointers

[CODE]int a = 10;
printf("%d", a);
if(param == 15) {
int a = 99;
int *ptr = &a - sizeof(int);
printf("%d", *(ptr));
}[/CODE]
>>
>>62441899
Didn't watch the show but why was she being a dick?
>>
File: 1503331247541.png (646KB, 800x924px) Image search: [Google]
1503331247541.png
646KB, 800x924px
>>62441909
>>
File: Capture.jpg (55KB, 1266x251px) Image search: [Google]
Capture.jpg
55KB, 1266x251px
>>62441901
Yeah, not like that matters though I have autosave after delay and lint on type enabled
>>
>>62441866

It's literally assembly, only with mory cryptic commands (instead of "mov ax,0x3" it's "01100110 10111000 00000011 00000000").


>>62441852

A lot of those higher design patterns are pretty pointless unless you do large scale development.
>>
>>62441809
>Maybe because haskell is useless?
You didn't understand the point of that video (if you even watched it at all).
>>
>>62441916

bump
>>
>>62441876
>implying that you need to know any of that to get a job as a webshit
>>
File: 1487906103383.jpg (51KB, 393x372px) Image search: [Google]
1487906103383.jpg
51KB, 393x372px
>>62441924
Over the line, sicko!
>>
>>62441941
Jesus, calm down. It hasn't even been 5 minutes.

>>62441916
You can't. Variable shadowing removes your only way of directly accessing that variable.
>>
File: 1498587650333.jpg (42KB, 495x810px) Image search: [Google]
1498587650333.jpg
42KB, 495x810px
>>62441924
>>
>>62441916
if you care, this is undefined behavior. you can just take the address of a in the outer block to fix that but i'm sure u know that. i'm pretty sure it's impossible without storing the address
>>
>>62441941

1) Code tags are not upper case.

2) Don't bump your own post after 3 minutes, fagtron.

3) Took me literally 20 seconds with google:

#include <stdio.h>      

int a = 12;

int main(void)
{
int a = 15;
printf("Inside a's main local a = : %d\n", a);

{
extern int a;
printf("In a global a = %d\n", a);
}

return 0;
}
>>
>>62441987

This is not what i am doing though. Extern won't work in this context.

    int a = 10;
printf("%d\n", a);
if(param == 10) {
int a = 20;
printf("%d", a);
extern int a;
printf("%d", a);
>>
File: 1502043361182.gif (3MB, 600x338px) Image search: [Google]
1502043361182.gif
3MB, 600x338px
>>62441956
>>62441973
>>
>>62441997

I think you are confusong things..

What you did in your example is overriding the variable. The old value is now gone and not restorable.

What you were asking about before that is called "overshadowing", it's something completely differnt:

You're not supposed to switch back and forth between differnt scopes. If you declare an "inner x" it's a differnt x, first and foremost to pretect the outer value.
If you need the outer value, take a different variable name, everything else will be confusing.
>>
>>62442021
wtf that's so rude
>>
>>62441476
too close
I'll just pick up the one book i have physically and git gud
>>
File: 1474767156249.png (44KB, 254x252px) Image search: [Google]
1474767156249.png
44KB, 254x252px
>>62442021
Do that again; I fucking dare you!
>>
So, trigraphs are getting removed.

C++ breaks backwards compatibility like that?
>>
>>62442157
Yes, auto_ptr, random_shuffle and gets have been removed too.
>>
>>62442021
what is that from? yt link by any chance?
>>
>tfw want to program but can't stop masturbating
>>
>>62442263
programming while masturbating
>>
File: IMG_20170915_095845.jpg (2MB, 4640x3480px) Image search: [Google]
IMG_20170915_095845.jpg
2MB, 4640x3480px
Hey friends, I have a board with a Atmel ATmega32u2 microcontroller for a uni project. Whats something fun to do with it

I've never played with one before. It has an LED receiver, how general purpose are these things, for example, could it pick up a TV remote
>>
File: 1253456678463345.gif (2MB, 398x298px) Image search: [Google]
1253456678463345.gif
2MB, 398x298px
>>62442099

>>62442206
yozakura quartet
>>
This is actually pretty fun
http://learnyouahaskell.com
>>
>>62442206
hownew.ru
>>
>>62442289
No thanks, I'd rather learn JS
>>
>>62442276
Build one of those car robot things.
>>
>>62442303
I thought about some kind rccar but its not powerful enough to do anything interesting
>>
>>62442276
if by led receiver you mean Infrared receiver then yes it can receive tv remote signals.
>>
>>62442276
not so much GPIO? how can it communicate with other module?
>>
>>62441175
>What are you working on, /g/?
Verified that my distributed NVMe driver library works by creating an util to read and write from disk blocks.

Now it's benchmarking time, I guess.
>>
>>62442337
>remote controlled
Make it automatic, senpai.
https://www.youtube.com/watch?v=gZ-AAXpM4U4
>>
When writing the length of your experience with a programming language on job sites, do you write the time since you first started using it, or the length of time that you actually used it?

For example, I built a big project in Python about 5 years ago. I spent about a year on it, but since then, I haven't really touched Python although I have been programming in other languages. Should I write 5 years of Python experience or 1?
>>
>>62442369
i think it should be the continuous time you use it. like you use it for 1 year 5 years ago and then just recently pick it up a gain, your exprience should be 1 year. but of course the python 5 years ago maybe drastically different with the python now.
>>
>>62442369
Why would you say anything other than 5?
>>
>>62442276

Make an LED cube.

Baby tier:
https://www.youtube.com/watch?v=03bkigwYOx0

Beginner tier:
https://www.youtube.com/watch?v=3K8i0JQzx2w

Intermediate tier:
https://www.youtube.com/watch?v=dVHP7Nhsn4E
>>
>>62442403
Because there are a lot of people who say this:
>>62442402

I know I could re-pick up Python in a week or two if I need to. However, if I mention that I have 5 years experience with Python on my résumé, there's always the possibility that the company might say Python isn't necessary, then randomly whip out a question about it just to test me, in which case I'm fucked because I look like I have 0 years experience despite having had a solid year.
>>
>>62442369

I would rather write down what projects you did with it. It more honest and it will give your empoyers a better picture.

For example:
I used Java since University, but only ever wrote smaller programms (nothing beyong A*, ant algorithms or basics swing applications). Now if I wrote "6 Years Java experience" it would be misleading, because it's differnt "6 years" than someone who learned Java for 3 years and then had additional 3 years as Java developer and various frameworks.

Also the otehr way arround:
I made a bigger application with many gotchas and lots of customisation in Rails in one year. It was my first Rails project, but I'd still consider myself "intermediate" in rails but only "beginner" in Java, because I had to take a deep dive in the one project.

Also write down waht makes your projects special.

bad = "I wrote a chess game in python"
good = "chess game in python, with a GUI via GTK+ bindings, a custom made AI which is inspired by the blablabla algorithm, multiplayer support via a server (server not implemented yet).."


The latter will give your employer a pretty good idea of your skillset.
Whatever you do, please do NEVER write "Java skills: good, Python skills: beginner". That's an incredibly stupid thing to do.
>>
>start up windows
>CodeBlocks.exe just disappeared
>have to re download all extensions and customization settings I did 3 years ago
wtf
>>
Say you have a function that issues some network request somewhere. You have another function that takes some parameters and calls the network request function.
How do you test function 2 without having to test function 1? Do you put all the IO in a separate .c file and then include another one for unit tests?
>>
>>62442548
Popular job application websites in my country allow no room for expanding upon experience. It's literally just check boxes next to the years.
>>
Where is the strcpy smartass from yesterday?
Why does Ass and Whore get separated by strtok if there is no
 ", "
in between them?
 
char *last, *first, *middle;
char pres[20] = "Fag, Ass Whore";
char pres_copy[20];
strcpy(pres_copy, pres);

first = strtok(pres_copy, ", ");
middle = strtok(NULL, ", ");
last = strtok(NULL, ", ");

printf("%s %s %s", first, middle, last);
>>
>>62442601

I'd never apply in one of those shops to begin with. But if I had to, I'd probably have two criteria:

1) Is it plausible?
If you claim you have 6 years experience, they might be asking what you did in those 6 years. If your answer is "I did one project" it has to be the hell of a project or you will come off as lier.
However, if you can somehow reasonably justify what you did in the time, I'd always give it a few more moth of experience. Just don't lie too much.

2) Your skills
Ask yourself: "Am I as good as most people, that do Python for 6 years?" Probably not. If you feel like you are good enough like someone with 3 years, I see no harm in "expanding" the length by claiming it was 3 years, given you explain say what you did all the time (see point nr 1).
>>
>>62442637
Your strtok separates by space and comma.
use
strtok(string, ",");

instead dumbfag
>>
What is the gcc command that auto generates a header file for C?

I can't find it on manual
>>
File: 1503597398469.jpg (61KB, 1000x800px) Image search: [Google]
1503597398469.jpg
61KB, 1000x800px
>>62442670
>>
>>62442696
sasuga dumb frogposter
>>
>>62441551
Rust is the future, come join us! We're very welcoming and love to have people from all kinds of diverse cultures, backgrounds, and beliefs. Unless you support Trump that is, in which case fuck you.
>>
Anyone know of a single digit (?) RGB pickers online?

Single digit as in 0 to 9 in only 3 fields.

R(0-9),G(0-9),B(0-9). Something like this.

Please and thanks!
>>
>>62442637

Interesting.

It seems like the second argument works as a list, and if the first delimiter doesn't work ,it takes the second one..

#include <stdio.h>      
#include <string.h>


int main(void) {
char *token;
char pres[20] = "Fag, Ass Whore";

token = strtok(pres, "as");
while(token != NULL)
{
printf( "%s\n", token);
token = strtok(NULL, "as");
}

return 0;
}
>>
>>62442780

I forgot, it returns:
"F"
"g, A"
" Whore"


You can see that it uses both delimiters at the same time and does not perform a pattern search.

Learn something new everyday..
>>
>>62442696
dumb frogposter
>>
>>62441276
Blackberry
>>
File: canpicker.com.jpg (236KB, 1280x706px) Image search: [Google]
canpicker.com.jpg
236KB, 1280x706px
https://canpicker.com/

Clojure/clojurescript(react based)
I listened to you memers and now I code in a lisp on a chinkpad in a vim implementation in emacs.
>>
>>62442347
Sorry yes, overtired...

I have to make a two player game on it for an assignment, having proper remotes will give me an advantage :3
>>
>>62441175
Homotopy Type Theory

>>62441264
Why would you want a language cluttered with useless features? A language should be minimalistic (obviously extended with libraries).

>>62441417
>2^n > n
>m/2^n > m/n
This is a contradiction.

>>62441745
>type theory academia bullcrap
>Implying your jobs won't be automated by said academics in the near future
How does it feel, poojeets?
>>
Whats the easiest way to randomize an array in c#?
>>
>>62441744
just use the ST monad and related datatypes :^)
>>
>>62442883
>unit tests
>useless

>getting all future functionality through 3rd party libs
hello rustlet
>>
>>62442769

You're welcome:

#include <stdio.h>      
#include <string.h>


int rgb_to_weird_colors(int r, int g, int b)
{
printf("r: %i, g:%i, b: %i",
(int) (9 * ((float) r) / 255),
(int) (9 * ((float) g) / 255),
(int) (9 * ((float) b) / 255));
}


int main(void) {
rgb_to_weird_colors(123, 255, 12);
}
>>
why is the installgentoo wiki dead?
>>
>>62441707
>C# can be compiled to native code?

https://docs.microsoft.com/en-us/dotnet/framework/net-native/index
>>
>>62442883
>This is a contradiction.
>what are negative numbers
>>
>>62442964

Sorry, you don't even need the includes.

This will do:

int single_digit_rgb(int r, int g, int b) {
printf("r: %i, g:%i, b: %i \n",
(int) (9*r/255.0),
(int) (9*g/255.0),
(int) (9*b/255.0));
}
>>
>>62442893
Are you trying to actually randomize the array in place, or do you just need to pick random elements?

Why are you using an array?

You can do this:
muhArray = muhArray.OrderBy(x => Guid.NewGuid()).ToArray();


Or instead of reassigning and calling .ToArray(), just continue with whatever you're actually trying to do.
>>
what are the features of a good IDE?
>>
>>62443106
All of them, or as many as possible.

Otherwise, you install a "Totally-Not-An-IDE" text editor and are constantly interrupted by having to install and maintain tons of addons to make your "Totally-Not-An-IDE" useful.
>>
>>62443106
Easy to extend and configure, emacs is good example.
>>
File: 1505350212564.jpg (5KB, 225x224px) Image search: [Google]
1505350212564.jpg
5KB, 225x224px
>>62442637
>C++ doesn't even have a range splitter
>>
>>62443103
Thanks, works great
>>
http://cr.openjdk.java.net/~jrose/metropolis/Metropolis-Proposal.html
>Specifically, we wish to re-implement significant parts of Hotspot’s C++ runtime in Java itself, a move we call Java-on-Java.
post you're face when C++ is dying. are you ready for some hot java-on-java action?
>>
>>62443036
Okay, but it is not a tautology
>>
>>62442637
>the strcpy smartass from yesterday
I assume you're referring to me.

>Why does Ass and Whore get separated
Because it uses both ',' and ' ' as separators, not the string ", " as a whole. Anyway, you should use this superior C12 beta version of strtok:

const char* superior_strtok(char* out, int n, const char* s, char delim) {
for(; *s && *s == delim; ++s);
for(; *s && *s != delim && n > 1; *out = *s, ++out, ++s, --n);
for(; *s && *s != delim; ++s);

*out = 0;

return s;
}
>>
>>62443270
JAVA is supports inbreeding, you heard it here first folks
>>
>>62443270
gay
>>
>>62443310
A language that can't self host is shit anyway.
>>
>>62443341
you mean implementation of langauge
>>
>>62442769
What? Just divide by 16
#FF00FF -> #F0F
#010101 -> #000
#294610 -> #341
>>
Trying to write a tool that interacts with X11 in Rust. I know nothing about either X11 or Rust and I feel like I'm in way over my head.
>>
>>62443518
Why would you waste your time on X11? Sure it's still being used, but it's on its way to deprecation.
>>
>>62443518
>x11
>rust
stop using obselete libraries/languages
>>
>>62443423

He didn't want a 16x16x16 color scheme though, he wanted 10x10x10 colors..


>>62443304

Nice.
Are you the hacker called Anonymous?
>>
>>62443575
Because I'm using X11 and I can't use Sway yet (can't rotate screens).

>>62443586
I don't have a choice about X11 and Rust is GOAT.
>>
How would I execute code after a return statement in c#?
>>
>>62443695
You're doing something horribly wrong.

What are you actually trying to do?
>>
I'm trying to parse multiple strings and doubles from a single user input into their rightful variables.

Say a user has to input some sort of statement in this format:

"String". Double. Double. "String

and I need to assign those into
String1;
Double1;
Double2;
String2;

I'm using
String s1 = scan.next();
double d1 = scan.nextDouble();
double d2 = scan.nextDouble();
String s2 = scan.nextLine();

It's working for the most part but I'm not getting any value assigned to the second string. I know it has something to do with the \n deal with how certain scanner types discard user input when they save into a variable and how some don't.

Can anyone here help me with this?
>>
File: snip.png (4KB, 516x138px) Image search: [Google]
snip.png
4KB, 516x138px
>>62443739
I need deck_position to be incremented after returning. I tried a Finally block but it doesn't seem to recognize it.
>>
>>62441175
I want to change two uint16_t variables in a thread-safe (atomic) manner. Can I just keep them combined in one uint32_t variable through some bit-diddling? Would this be considered needlessly obfuscated?
>>
>>62443800
why would you do that?
Whatever it is you're trying to do, rethink it.
>>
>>62443800
>I need deck_position to be incremented after returning.

Post the rest of your code in a Hastebin or something with an explanation of your objective. You're doing something horribly wrong.
>>
>>62443800

Brainlet.

deck_position++;
return new_deck[deckposition - 1];
>>
Anyone have a checklist for writing C++ valid C code? I only know you should cast malloc().
>>
>>62443800
you could do something like

temp_deck = new_deck[deckposition]
deck_position++
return ret deck
>>
>>62443594
>Are you the hacker called Anonymous?
That's right, kiddo. You have never seen code like mine before. I've written over 500 superior replacement version to any given C standard library function.
>>
File: snippy.png (4KB, 429x115px) Image search: [Google]
snippy.png
4KB, 429x115px
>>62443800
lmao
>>
>>62443876
>>62443921
thank you sirs, this has helped me to do the needful

glad I do not use the Java anymore
>>
What language to begin with? What resources to use?
>>
Say you have two functions, f1() and f2(). F1 takes some parameters, does something with them, and then calls f2() with the result. How do I test this? Do I rewrite f1() to be pure and then add under the tests something like:
assert((f1(TESTCASE_F1_1_ARG1, TESTCASE_F1_1_ARG2, TESTCASE_F1_1_ARG3) == TESTCASE_F1_1_EXPECTEDRETURN));

Or is there a better way, like dynamically replacing f2(), and if so how?
>>
>>62443938
What do you want to do?

Programming is a tool. Learning programming with no goal is silly.
>>
File: ss-2017-09-15-16-30-05.png (42KB, 524x282px) Image search: [Google]
ss-2017-09-15-16-30-05.png
42KB, 524x282px
>>62443778
are the quotation marks and fullstops really there or not? because I'm confused
>>
>>62443304
>writing edgy code
please don't do this
>>
>>62443800
>>62443931
>that code
>sirs
>glad I do not use the Java anymore
wtf pajeets love microsoft now
>>
i'm gonna get the 2nd edition of artificial intelligence a modern approach, but i hear it's more lacking on statistical machine learning than the 3rd edition. any recs for a book to supplement this
>>
>>62443876
>incrementing it and then subtracting
>what is postfix increment and why does it exist
Brainlet.
return new_deck[deck_position++];
>>
>>62441276
>>62435822
KDE phone will need apps. Make one.
>>
>>62443983
That was clearly a false flag, anon.
>>
>>62443980
Memes aside, that's not even "edgy code". That's actually pretty straightforward and acceptable code. This is edgy code:
#define A(x, s) x s x
#define B(x, s) A(x, s) s A(x, s)
#define C(x, s) B(x, s) s B(x, s)
#define D(x, s) C(x, s) s C(x, s)
#define E(x, s) D(x, s) s D(x, s)

int mystery(int x, int y) {
int t = 1, p = (-!!(x & 1) & y);
E(p += (t <<= 1, y <<= 1, -!!(x & t) & y), ;);
return p;
}

Now figure out what it does.
>>
>>62441175
>pic
TDD is such a joke.
https://softwareengineering.stackexchange.com/questions/299796/is-it-normal-to-spend-as-much-if-not-more-time-writing-tests-than-actual-code
Look at these fools. His estimate for normal development is so far off its ridiculous. Nobody competent spends 90% of their time on debugging/testing. That's simply not how you achieve robust code.

Why does our industry attract all the retards?
>>
>>62443304
i can't understand this so it's unmaintainable and i'm taking your Software EngineerTM certification
>>
>>62443963
no I just tried to do that to clarify things. A sample of user input would be something like this:

Hello 23.434234 26.5345345 This is the second string

and after scanning and printing back out to the user it should say
s1: Hello
d1: 23.434234
d2: 26.5345345
s2: This is the second string

but using my code and yours as well, you will print this out:
s1: Hello
d1: 23.434234
d2: 26.5345345
s2:
>>
>>62443888
>>62443800
sorry, I fucked up, this should be

temp_deck = new_deck[deckposition]
deck_position++
return temp_deck
>>
>>62441751
I learned a bit of haskell at my university. Found it interesting and fun (kind of tough too)
>>
>>62444027
i think in industry it's common to spend way more resources on testing than click clacking of actual code, but on personal programs (even stuff you release to the public) that's xs imo
>>
>>62444038
const char* superior_strtok(char* out, int n, const char* s, char delim) {
while(*s && *s == delim) {
++s;
}

while(*s && *s != delim && n > 1) {
*out = *s;
++out;
++s;
--n;
}

while(*s && *s != delim) {
++s;
}

*out = 0;

return s;
}

Does this really make you feel better? Do you not understand how a for loop works?
>>
>>62444059
i think that if the design is good then the coding is just like fill in color
>>
File: ss-2017-09-15-16-39-55.png (65KB, 854x436px) Image search: [Google]
ss-2017-09-15-16-39-55.png
65KB, 854x436px
>>62444040
seems to work fine on my machine apart from that extra space before the second string that you need to remove
btw I run Arch Linux
>>
>>62443882
https://en.m.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B
>>
why does java declare an integer array as int[] A; and C as int A[];

i thought java was supposed to have C-like syntax
>>
>>62444040
>>62444101
works on ideone as well https://ideone.com/A6eUU2
>>
>>62444020
Empty for loops and all that just rub me the wrong way, a while loop would have been more readable. But sure, it's not obfuscated or anything.
>>
>>62444074
was more uncertain about the evaluation order of the juxtaposed boolean ops
>>
>>62444161
it does, but that doesn't mean it can't fix some retarded decisions (the type is clearly an array of ints - int[])
>>
>>62443906

Some more while loops and comments and it would be great code.


>>62443993

I haven't written a single line C# in my entire life.
I thought about doing it with post-increment, but I wasn't sure about the implementation.
No need to be a salty cunt, my code worked perfectly fine, there is a difference between finding an obvious solution and optimizing code.


>>62444020

This reminds me of the shit we had to do at university..

I'll save this and do it later for fun, BNF to the rescue!
>>
>>62444074
I can tell at a glance what that does, the other one takes a few seconds. Much better.
>>
>>62444162
>>62444101
Okay it had something to do with me not using printf. I'm a newb so that sort of output formatting goes over my head. thank for the help anon.
>>
>>62444223
>I can tell at a glance what that does, the other one takes a few seconds.
What if I told you it's the other way around for me (and for most competent programmers, I suspect)? The only difference is that
*out = *s, ++out, ++s, --n
isn't spread over multiple lines with extra visual noise.
>>
>>62444161

Both way work in Java and C:

int[] array
int array[]


By the way, think about that one:

int a, b, *c, *d;

It's clearly superior to write the pointer to the variable.
>>
>>62444231
how were you printing it then? try to do it like before but with
System.out.flush() at the end
>>
>>62444249
That part isn't the problem, the problem is the opaque usage of for loops for what should be done with a while loop.
>>
>>62444270
DESU it'd make more sense to have this:
char var1, var2, var3;
char* pointer_1, pointer_2, pointer_3;

A char is a byte but a pointer to a char could be 8 bytes.
>>
>>62444094
Depends on how you design. You can end up in very poor situations with too much upfront design and especially too much reliance on it.
Exploratory programming is pretty important to feel out the needs of the software.

Naturally I'm talking about non-trivial software.
>>
>>62444270
[] on type doesn't work in C.

>>62444161
C has garbage declaration syntax and Java fixed it.
>>
>>62444270
No, you have an int*, not *a. *a dereferences a. You shouldn't use multiple declarations on one line like that.
>>
>>62444284
>>
>>62441570
Not him, but you're still a brainlet if you don't know at least one assembly language. It can even be something simple like MIPS
>>
>>62444189
>Some more while loops and comments and it would be great code.
It doesn't need any comments. Just better argument names. I just slapped that crap together yesterday in response to another guy's attempt and using his argument names.

>I haven't written a single line C# in my entire life.
But it works the same in C, C++, Java, javascript and probably every other curly brace language.

>there is a difference between finding an obvious solution and optimizing code.
It's not an "optimization". It just directly expresses the intent (as opposed to incrementing and then subtracting).

>BNF to the rescue!
Eh? Just run the preprocessor to see what it boils down to after the macro expanasion.
>>
File: 1464831498592.jpg (77KB, 750x682px) Image search: [Google]
1464831498592.jpg
77KB, 750x682px
>python will never have do;while constructs because "muh visual code aesthetics"
>>
>>62444290
>opaque usage of for loops
Nobody who understands how for loops work would find it "opaque". The problem is that you've never seen it used any other way besides for(int i; i < n; ++i) so that's the only pattern you recognize.
>>
>>62444016
wow finally a gnu phone
>>
Is it a good idea to write "shell scripts" in perl? Bash always turns into a clusterfuck of grep, return codes, half baked string escaping, pipes, etc.
>>
>>62444319
>you're still a brainlet if you don't know at least one assembly language
I know x86 and 6502 assembly and literally never have to use this knowledge unless I'm fucking around with esoteric/hobbyist/pointless stuff. It's only valuable insofar as being able to understand how the machine works, and (extremely rarely) if you want to decompile and hand-tune performance-critical sections of code.
>>
>>62444357
Yes, absolutely.
>>
>>62444292

I don't agree with you..

If you actually use pointers in code, you write *var and &var. Therefor I think it's more consistent and readable also declare them like that:

  int i, *j;
i = 12;
j = &i;
i = *j;

int *k = j;
*k = *j + *j + 1;
>>
why does anyone use classes and inheritance

structs full of function pointers are so much better
>>
>>62444357
>clusterfucks of pipes
christ i hate when people try to make bash scripts fancy
>>
>>62444371
Have you never built a JIT?
>>
>>62444357
Yes, if you're a 50yo breaded "Unix veteran" in a sweater. Otherwise, use Python.
>>
>>62444298

>[] on type doesn't work in C.

Arragh, you're actually right.
To many things at the same time messed in my head..
>>
File: fPazBTMsDF-2.png (27KB, 300x250px) Image search: [Google]
fPazBTMsDF-2.png
27KB, 300x250px
>>62444433
>breaded
>>
>>62444415
Wrong
>>
>>62444413
>it's more consistent and readable also declare them like that:
In what way is it consistent?
int* i;
makes more sense because it implies that the * is part of the type description, whereas
int *i;
uses *i which usually means "dereference i", which is definitely not what goes on.
>>
>>62444322

>It's not an "optimization". It just directly expresses the intent (as opposed to incrementing and then subtracting).

It's the same in the result and also logically.
Either you take item 1 and then go to item 2.
Or you go to item 2 and take item 1.
Same same.


>Eh? Just run the preprocessor to see what it boils down to after the macro expanasion.

That would be cheating.


>>62444305

See:
>>62444413
>>
>>62444475
int is what you get when you dereference i. All of C's declarations follow a convention like that.
>>
>>62444305
No, you have an int *a.
Also, *a dereferences a.
But what you have is indeed an int *a, not an int* a.
It's still a declaration; read it right to left, it declares "a should be such that [a] dereferencing it [*] gives you an int [int]."
>>
>>62444413
Yeah but * and & could be considered functions that convert a type to another. Especially since * doesn't mean the same thing when it's in a declaration and when it's in an expression.
>>
>>62444415
mostly it's a constract to ease thing. you can either receive stuff from your father when he pass away directly, no paper, nothing or receive a inheritance paper saying that these thing is now your. the later is just to ease the legal process.
>>
>>62444420
>Have you never built a JIT?
Yes, but it just uses indirect threading instead of generating asm. Either way, 99.9% of programmers don't work on anything JIT-related and you probably have never built one either.
>>
>>62444504
>int is what you get when you dereference i
Do you deny that the * in "int *i;" is part of the type description of i?
>>
>>62444528
Actually I did Anon. It was for a shitty esolang but I still like to think it counts.
>>
>>62444545
It is, I agree. It was a garbage idea to have this inside out definition style.
>>
>>62444503
>It's the same in the result and also logically.
Okay, but the intent is "increment i but use the old i" which "i++" expresses directly while your code doesn't. It's not an optimization. It's just a clearer and more direct expression of the actual intent of the programmer.
>>
>>62444568
any chance that we can have a look at that esolang anon
>>
>>62444475

>In what way is it consistent?

int i, *k, **j;
*k = 2;
*j = k;

We have only two principles here:
int --> a type
*k --> a pointer (declaration and "usage").
**j == *(*j) --> it's the same as the one before

int i;
int* k;
int** j;
*k = 2;
*j = k;

We have multiple types, that are all basically pipes for our integer at end.
>>
>>62444471
but it's true though

if you have to have a lot of different subclasses of a common abstract base class then give me one good reason not to just do this:

/* base.h */
struct base {
int (*method_a)(struct base *self);
void (*method_b)(struct base *self, int);
};

/* impl1.h */
struct base;
struct base impl1;

/* impl1.c */
#include "base.h"
#include "impl1.h"
static int impl_a(struct base *self) {
/* ... */
}
static void impl_b(struct base *self, int n) {
/* ... */
}
struct base impl1 = {impl_a, impl_b};
>>
File: linux_and_windows.jpg (99KB, 1200x794px) Image search: [Google]
linux_and_windows.jpg
99KB, 1200x794px
I want to get into programming as a hobby. The only language I have experience with is Pascal.

Is Pascal still a good language to learn? Or should I use something more common like Python?
>>
>>62444593
>struct base;
>struct base impl1;
lol you can't do this faggot
lrn 2 c
>>
>>62444578

>It's just a clearer and more direct expression of the actual intent of the programmer.

That great comming from someone who doesn't "need" comments.. :^)
>>
>>62444584
>We have only two principles here:
>int --> a type
>*k --> a pointer (declaration and "usage").

Except those two principles make no sense, because the type is int*, not int.
The actual two principles should be:
type* -> a type
*var -> dereference a variable.
>>
>>62444607
python is very good for a hobby. simple syntax, good community and a wide range of library for most simple task you can just pick the part you need and glue them together.
>>
>>62444581
The esolang was Piet ( http://www.dangermouse.net/esoteric/piet.html ). The JIT was written in Rust with dynASM.
I can't show you the code because I'm ashamed of it, it was the first time that I wrote anything in Rust. And the generated code wasn't pretty either (lots and lots of dead code).
>>
>>62444584
>*k --> a pointer (declaration and "usage").
Never in your code would you write
*k = malloc(sizeof *k)
. This logic fell apart as soon as variable initialization was introduced.
>>
File: 1497413214258.png (41KB, 1073x640px) Image search: [Google]
1497413214258.png
41KB, 1073x640px
>>62444292
>>62444305
>>
>>62444611
You're the kind of "programmer" who does this:
i++; // increment i

Aren't you? I'm sorry, but your low level of competence doesn't mean that every simple loop should be commented and that full usage of the capabilities of for should be avoided.
>>
>>62444657
I think you're misunderstanding what we're talking about. We're not talking about C works, but what would make more sense if we were allowed to change C's syntax regarding declarations.
>>
>>62444675
>We're not talking about C works, but what would make more sense if we were allowed to change C's syntax regarding declarations
This. Repeating the reasoning behind the original design decision doesn't mean it was the best design decision.
>>
>>62444413
>>62444657
>an int pointer named i holds the value of <address>
>an int is received by dereferencing i which has the value of <address>
Gee, I sure wonder which one is clearer!
>>62444522
This.
>>
>>62441874
I don't see why not. All the normal rules for forward declarations apply.
>>
>>62444648
>Never in your code would you write *k = malloc(sizeof *k)
no actually you could do that
void **k;
k = malloc(sizeof k);
*k = malloc(sizeof *k);
>>
>>62444722
>Gee, I sure wonder which one is clearer!
how exactly is the latter not clearer
the prior presupposes the concept of a pointer whereas the latter seamlessly inlines the meaning of that concept without having to have a word for it
>>
In SQL and VHDL, keywords are generally written in caps and variables/data in lowercase letters. What are your thoughts on extending this to other languages? Obviously, some are case sensitive, then you have to use uppercase variables, but the theory still applies. It helps readability a ton to know that in the statement
SELECT id, date, body FROM generic_table ORDER BY date DESC LIMIT 50;

id, date, body, generic_table, 50 are "data"/var names and the rest are keywords.
Thoughts?
>>
>>62444834
more implicit is the opposite of clearer
>>
>>62444862
syntax highlighting
>>
>>62444862
I really don't like it. I don't want my pinkie to die because I need to write a ton of keywords.
>>
>>62441186
You implement a memory arena system that allocates an arena for each trie. When you are done with the trie you free the entire arena. Ensures locality, and thus performance, and an easy and efficient clean up. All node pointer-based data structures should use them.
>>
>>62444862
It doesn't matter. In C all caps implies macros, which is useful. Also what language has more than a couple dozen keywords? If you use the language for more than 50 hours I'm sure you'll remember keywords.
>>
>>62444834
>the latter seamlessly inlines the meaning of that concept without having to have a word for it
It's abusing a type declaration to say "if you dereference this, you will get an int". You can argue about the subjective merits of doing so day in and day out, but what's objectively true is that it breaks the established pattern of having the type type description come first, and then the name last (by attaching part of the type description to the name).
>>
>>62444990
You could just prefix them with m_ or something though.
>>
>>62444664

And there is no difference between
for(; *s && *s != delim && n > 1; *out = *s, ++out, ++s, --n);


and
i++;


?

gr8 b8 m8.

I could read what you programm is doing, but it is far from obvious (unless somone is so 1337 like you, I guess?).


>>62444999

Hard to argue with double trips..

Nevertheless I think it's easier to miss the asterisk when it's glues with the type definition.

[char* a = "bla";] almost looks like [char a = "bla";] while [char *a = "bla";] immediately emphasises the *.


Yes, I know 12 is not a char.
>>
>>62445304

Oops, ingore the last dentence.
>>
>>62441175
I'm trying to work through K&R 2e but I'm currently stumped on one of the problems in the tutorial section.
It is Exercise 1-20:
"Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a variable of a symbolic parameter?"
Here is what I have
https://hastebin.com/ovirixubaw.cpp
The program behaves very strangely. I think part of my problem is residual junk in the character array each time they are printed. Any advice would be most appreciated
>>
>>62445304
>for(; *s && *s != delim && n > 1; *out = *s, ++out, ++s, --n);
Let's just read it and see what it says:
>while the end up of the input string has not been reached, and the current character is not a delimiter, and n is greater than 1:
>copy current character to current output string position
>advance output string position
>advance input string position
>decrease n
Why do you need comments to spell out information you can gain by literally just reading the code?
>>
>>62445304
that's a pretty simple loop though, you should be able to easily see what it does by looking at it.
>>
>>62443166
haha
>>
File: 1501786569141.jpg (143KB, 833x696px) Image search: [Google]
1501786569141.jpg
143KB, 833x696px
>>62445304
>>62444664
Leave her alone
>>
File: 1447644436968.jpg (314KB, 1000x1000px) Image search: [Google]
1447644436968.jpg
314KB, 1000x1000px
>>62445727
>>
>>62444475
>it implies that the * is part of the type description
>wanting to imply something wrong
int* i, j;
>>
>>62444572
meh, it works great in practice
>>
>>62445785
>defending a misleading design decision
>demonstrating exactly why it's a bad
>thinking you're doing anything other than illustrating my point
int* i, j;

Should be equivalent to:
int* i;
int* j;

Because that's what it implies.
>>
>>62445865
I'm not defending it, I'm simply acknowledging it.
>>
Would learning assembly be a good way to learn about computer hardware? Where would be a good place to start?
>>
>>62445896
Have you already determined that you need to or want to learn about computer hardware?
>>
>>62445886
>I'm simply acknowledging it
Literally no one was denying it at any point. The discussion was about what it should have been like, not about how it currently is.
>>
>>62445910
Yes
>>
This general would be 10x better if people showed some restraint and purposefully ignored retard-tier chapter 1 tutorial questions and homework help.
>>
>>62445571
>>62445624

1) Let's start with the fact that you are basically abusing the for-loop when a while construct would be more appropriate

2) The visual difference between ";" and "," is tiny. It's difficult to see at the first glace where the condition snds and where the execution part starts

3) Comments are zero cost. They donÄt slow down the programm, they take a few seconds to write and will speed up any future reading of the code. Doesn't this help?
// copy (at most) n chars to "out" until you reach the delimiter
for(; *s && *s != delim && n > 1; *out = *s, ++out, ++s, --n);


4) Just because you can doesn't mean it's a good idea.


>>62445727

Thanks, anon, I..
wait, what?
>>
>>62445530
Update:
After looking around I found C has a nifty function called memset() that i can use to "flush" each array before being passed to getLine() and detab() (or whatever I called them).
The program still isn't functioning properly, however. Anyone mind taking a peek? Here is the updated code
https://hastebin.com/hejuxadoda.cpp
>>
>>62445896
It won't help you learn electrical engineering, but it'll help you understand how a computer ... well ... computes.
>>
>>62443291
just meant to say that powers of two are comfy
>>
>>62446130
The same goes for powers of any x > 1.
>>
>>62446130
and integers and rational numbers are comfier than irrational numbers
>>
>>62446035
>you are basically abusing the for-loop when a while construct would be more appropriate
That's your purely subjective opinion.

> The visual difference between ";" and "," is tiny
You can make the same retarded complaint about any usage of for that isn't for(int x; condition; ++x), including something as simple as for(i = 0, j = 0; condition; ...). Not a realistic issue.

>Comments are zero cost.
Except your comment is misleading because it omits the side-effects of that loop, perfectly demonstrating the problem with pathological commenting.
>>
>>62446141
powers of two are way comfier. powers of x>2 usually don't have better properties than plain numbers
>>
>>62446035
Also, funnily enough, your comment is outright wrong because it copies at most n-1 characters.
>>
What are you fags even bikeshedding over
>>
>>62446118
How would one go about learning electrical engineering (aside from enrolling in a university program)? Perhaps looking up what courses several are required for the degree on some uni webpage?
>>
>>62445896
More than learning ASM I'd recommend writing your own bootloader/OS. It taught me a shitton about what the computer really does while ASM on its own didn't bring much to the table.
>>
File: 1441077227649.png (76KB, 224x173px) Image search: [Google]
1441077227649.png
76KB, 224x173px
>>62446176
What is base 16?
>>
>>62446225
What did you think /dpt/ was for?

Discussion about things that are better discussed elsewhere?
>>
>>62446226
Not him but I recommend reading " The Elements of Computing Systems - Building a modern computer from first principles" by Noam Nisan and Shocken.
>>
>>62446244
powers of 16 are also powers of 2 retard
>>
>>62446238
lol I've only taken two semesters of java and I'm just now working through K&R to learn C. How much coding experience would I need to embark on such an endeavor? I really don't know much at all about computer architecture or operating systems; I'm a pleb and have only ever really used Windows. I do have quite a bit of math under my belt, thats probably the only thing I have going for me.
>>
New thread:
>>62446298
>>62446298
>>62446298
>>
>>62444607
You will be quickly much more happy with Python than with Pascal. It is very easy to make even pretty advanced stuff with Python.
>>
>>62446226
Don't know, but >>62446274 sounds solid.
>>
>>62446287
Keep on learning C without trying to learn ASM then. Once you perfectly understand how it works you can start writing your own OS.
In order to make sure you really understand how C works you should try implementing several programming language features that aren't obviously present in C, e.g. struct inheritance, currying, allocating memory without malloc, saving and restoring a function's stack and probably others that I can't think about yet.
>>
>>62446274
Most appreciated, I will check this out
>>
>>62446383
The true goto is H&P. Hennesy and Patterson's Computer Organization and Design. Get the most recent MIPS edition. I had a chance to read the ARM edition and it blows dicks.
>>
>>62446378
That makes sense, though part of the reason I was wanting to learn assembly was because there were some nuances of C that left me feeling at best dissatisfied and even completely befuddled. Text I/O being one example off the top of my head. I had to search around and then I realized that every time a program is executed three files are automatically created (an input, output, and then some othr icr).
I have this terrible tendency to, whenever I get stuck or don't understand something inside and out, I will dwell on it and won't be able to move forward. Differential equations were a nightmare for me lol I was off reading about spectral theory and duality because questions regarding notation led me astray. I ended up not practiving actually solving them until a day or two before the exams, and ended up with a C in the course. I do want to break this habit, so I think I will try your advice, and if I get stuck and a couple minutes of research doesn't remedy the issue, I wil just move on
>>
>>62446438
Awesome, I'll will look into this. Thanks!
>>
>>62446146

I always thought this "my code is self-documenting" was a meme..

I just hope nobody has to work with your code.

I bet you also don't write tests because you code is perfect, right?


>>62446192

WHOA, TOTALLY BTFO ! !!!
IT'S N-1 TROLOLOLOL!!!
>>
>>62446829
>I just hope nobody has to work with your code.
People work with my code routinely and no one is complaining about the lack of comments on trivial loops. I hope nobody has to work with dense motherfuckers like you who need every line of the code spelled out for them. But then again, who would hire you?
Thread posts: 325
Thread images: 35


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.