[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: 388
Thread images: 41

File: dpt.png (389KB, 934x1000px) Image search: [Google]
dpt.png
389KB, 934x1000px
What are you working on, /g/?
>>
>>52553087
first for hitler used java
>>
>>52553087
Trying to stop being a disorganized fuck and writing proper tests.
>>
>>52553087
hitler was right
>>
>>52553087
Put a damn link to the old thread in the OPs: >>52549242
At least you didn't post degenerate shit and waited till after the bump limit.
>>
What's the best data library in python? Pandas?
>>
File: Screenshot.png (3MB, 3280x1920px) Image search: [Google]
Screenshot.png
3MB, 3280x1920px
Just installed Linux.
>>
first for fourth
>>
>>52553203
>data library
Is there any possible way you could make your post more vague?
>>
File: stallman1.jpg (124KB, 480x320px) Image search: [Google]
stallman1.jpg
124KB, 480x320px
>>52553230
>nooboontoo
Install trisquel GNU plus linux-libre
>>
>>52553230
You're supposed to installed one of the autistic distros, e.g., Arch, Gentoo, etc.
>>
>>52553279
>>52553289
b-but it has m8 in the name.
>>
>https://github.com/arnetheduck/nlvm
neat
maybe Araq will finally move to LLVM IR instead of just "transpile it to C lol :^)"
>>
>>52553249
> what's the best library for the language I use
>>
>>52553203
Yes. Or just use hdf5 for everything and use pytables.
>>
I thought the "vb is the worst language ever" meme was a meme
It was not.
I wasn't expecting it to be good, but jesus
>>
>>52553502
try Objective-C
I literally wrote 200 lines of code to make a calculator using best practice
meme language
>>
>>52553502

The nice thing is that you can easily convert between C# and VB .NET. So if you need something ""written"" in VB, just write it in C#.
>>
>spend the last 10 years of my life programming
>sorry anon but your skills as a C Programmer are outdated
>you're not a javascript ninja
>we don't need low level stuff anymore
>we only need frontend programmers

Theres no money to be made programming desktop applications, its all about apps and web programming which isn't programming its just spamming worthless meaningless shit for pennies

Remember kids if you're going to make programming into a career always keep in mind what you learnt will be comepletely useless in 5 years.
>>
I'm thinking of giving Clang a shot, but I'm not sure if I should. I've read that it works better than gcc. I've always used gcc, so should I give it a shot??

What are /g/'s thoughts??
>>
>>52553550
C programming has been deprecated for quite some time

move on to C++ or someshit
>>
>>52553550
>your skills as a C Programmer are outdated

Tbh, they might be. Do you even use C11?
>>
>>52553564
it's gcc but faster but I doubt you'll notice if you're making small ass programs.
>>
import java.util.ArrayList; 
import java.util.List;

public class Lel {

public static Lel topLel = new Lel();
public static Lel lel = topLel.topLel;
public static Lel bottomLel = topLel.lel;

public static void main(String[] args) {
List lels = new ArrayList();

while (true) {
lels.add(new Lel());
}
}

}
>>
>>52553543
Ya I'm a c# guy. Had to use vb for a bullshit "we had nothing better to give you this term" class.
>>
>>52553609

Thanks!
>>
>>52553502
What dont you like about VB?
>>
>>52553670
The syntax is just incredibly unintuitive and it uses the whole "english keywords" thing in the worst way I've ever seen.
if/elseif/endif, who does that
>>
File: gopher.gif (148KB, 400x470px) Image search: [Google]
gopher.gif
148KB, 400x470px
Why is Go a meme?
>>
>>52553699
all the worst features of C, none of erlang's features beside channels.
>>
>>52553699
Why wouldn't it?
>>
>>52553699
>the people who design it have a bizarre ideological opposition to generics
>D already exists
>>
File: intense sexual preparation.png (294KB, 444x434px) Image search: [Google]
intense sexual preparation.png
294KB, 444x434px
>>52553697
>endif
>>
>>52553564
gcc is better
>>
Why is my timestep being ran about half as frequently as I want it to?

>My timestep is 16ms, so 1,000ms/16ms = ~60 timesteps per second.
>10,000ms/16ms = 625 timesteps in 10 seconds

>In reality if I let it run for 10s, I get 312~ elapsed timesteps
>>
>>52553699
>even the mascot straight up shills ethnical diversity and multiculturalism
>>
File: dgre.png (35KB, 563x426px) Image search: [Google]
dgre.png
35KB, 563x426px
>>52553790
>>
>>52553790
post code you dickbutt

are you getting vsync'd to 60 fps?
>>
>>52553795
what
>>
>>52553832
>gopher.gif
>the color of its skin/fur
>>
File: l.png (60KB, 1200x1892px) Image search: [Google]
l.png
60KB, 1200x1892px
What websites should I block senpai?
>>
>>52553850
4chan
>>
>>52553842
fucking animals with their brown fur
animal holocaust when
>>
>>52553850
http://someonewhocares.org/hosts/
>>
>>52553850
it's the only rational answer >>52553872
>>
>get web dev job editing and maintaining shitty old ASP.NET

did i make it?
>>
>>52553842
>4chan hate me because my skin is brown
just fuck you m8.

It's not my fucking fault.

fuck you
>>
File: selfie.jpg (93KB, 640x640px) Image search: [Google]
selfie.jpg
93KB, 640x640px
Is this a good way to do property binding in C#?
public class ConfigContainer_Bool
{
public delegate void EventHandler_Void();
public event EventHandler_Void onValueChanged;


public string Name { get; private set; }
bool _Value; public bool Value
{
get { return _Value; }
set { if (_Value != value) { _Value = value; if (onValueChanged != null) { onValueChanged.Invoke(); } } }
}


public ConfigContainer_Bool(string name, bool value)
{
this.Name = name;
this._Value = value;
}
}

I don't really like it because I have to write "showTabBar.Value" rather than just "showTabBar" that way
But I don't know how to do this any better
>>
>>52553939

hnnnnng this code is hot
>>
>>52553923
>4chan hates drawings of animals with brown fur
how does it even cross your mind to care what they think about you
>>
>>52553947
Hey, my code is down there!
>>
>>52553939
>prefix underscores instead of postfix
degenerate
>>
>>52553939
>deleting your post
>twice
>>
>>52553923
calm down m8 i don't hate you specifically it's just the SJW agenda that the jews are pushing

>inb4 you're a jew
>>
>>52553939
N O G F
O
G
F
>>
>>52553947
99% boiler plate

na mane
>>
>>52553939
>that classname
other than that yeah
>>
>>52553988
I think that's a resharper convention
>>
>>52554157
Yes, I'll probably rename it soon

>>52554169
>>52553988
I'm prefixing so it doesn't show up in the auto-completion window when typing the first letter from within the class
>>
hey senpai
Does nim have anything like python's range?
>https://docs.python.org/3/library/functions.html#func-range
>range(start, stop[, step])
I'm interested in the [, step] part.
Can you do every nth step in nim?
>>> for i in range(0, 23, 5):
... print i
...
0
5
10
15
20

I don't see any way to do it in nim.
I know I could use 1..23 but I'm not sure how step could be used with it
>>
>>52554052
You can have a girlfriend in VR in a few years
>>
I just bought Prata's C++ Primer Plus to start learning programming.

I was afraid to open it for a while but now I've read the first chapter.

I only cried a little bit, am I a programmer now?
>>
>>52554265
it'll be many years before VR is good and you still won't be able to touch her irl
>>
>>52554249
for x in countdown(10,0,3): echo(x)


output
10
7
4
1
>>
>>52554443
Why would it be many years?
The upcoming consumer VR headsets have pretty decent resolution
Touch is possible right now by full-body tracking a silicone doll

All that's missing are good waifu sims and silicone dolls that can actually move
This will likely happen in the next 5 years
>>
File: LLVM-3-0-Officially-Released.png (184KB, 728x399px) Image search: [Google]
LLVM-3-0-Officially-Released.png
184KB, 728x399px
What's so revolutionary about LLVM?
>>
>>52554536
thanks senpai, sorry I missed that
>>
>>52554544
Nothing, really.
>>
>>52554539
* actually move by themselves I mean
>>
>>52554544
There wasn't any good cross-platform low-level VM before. For example, jvm is slow, very restrictive, large, and GC-enabled, and MSIL is additionally locked. Inherently, though, it's not very good.
>>
File: optimized.png (47KB, 728x399px) Image search: [Google]
optimized.png
47KB, 728x399px
>>52554544
your PNG is now optimized.
>>
>>52554539
have you even touched a real woman, silicone doesn't feel as good as a healthy woman's soft, smooth and supple skin
>>
File: gay (1).png (41KB, 728x399px) Image search: [Google]
gay (1).png
41KB, 728x399px
>>52554580

your optimized PNG is now compressed.
>>
>>52554544
It's a cool logo
>>
>>52554621
lo/g/os
>>
>>52553550
Stop applying for hipster startup companies then you faggot.
Jesus I've not even finished my CSE course and I'm already walking into a software job (working with bespoke hardware).

You know what I had to do to get it? Not be a sperg, and not be afraid of low level languages like C. I don't even have to know it that well, but just be willing to fucking LEARN.
Any and every fucking graduate can work with python and java, nobody gives a fuck about that, might as well put on your CV that you have two arms and know how to flip burgers.

There is money to be made in desktop applications, you just have to be actually good at your job, rather than cog #232/1000 in the meme development machine.
Nobody cares what you already know, they care about what are are willing to find out.
>>
>>52554599

Nothing compares to the touch of a real woman.

>>52554633

What kind of experience did that job you landed require? Just curious.
>>
>>52554633
>C
>desktop applications
Is this 1973 again?
>>
>>52554599
True, but with clothes on it should feel pretty much the same way
And it's not like you want a girlfriend to touch her super-realistic skin
>>
>>52554536
I don't understand this.
import sequtils
let x = toSeq(1..50)
proc chunks(l, n): auto =
for i in countup(0, len(l), 0):
yield l[i..i+n]
echo chunks(x, 5)

>c:\users\faggot\nim\l.nim(6, 5) Error: 'yield' only allowed in an iterator
Isn't it in an iterator, for?
Why isn't it allowed?
>>
>>52554544
Clang
>>
>>52554674
>(0, len(l), 0)
that might be it
I should re-read my shit before posting
sorry
>>
>>52554633

>didnt go to uni
>learned javascript and made tons and tons of shit with it at home
>called company and told them i live and breath code
>yes i actually said that

got job. Feels goodman.
>>
>>52554702
things_that_never_happened.jpg
>>
>>52554665
>What kind of experience did that job you landed require? Just curious.
None, really. I worked for them last summer (full pay, none of that $2/hour intern shit) as a sort of trial period, they're happy with my workstyle and I get on with the rest of the software department (literally 3 other guys).

>>52554670
Not every company has the time and resources to redo over 20 years worth of code in the meme language of day. You know COBOL is still going right? It might not be much fun to work with, but anyone who can gets paid better than any javamonkey could dream of.
>>
>tfw you spend 3 hours debugging your program because of inexplicable behavior

>there's a semicolon on one of your nested loops
FUCK
>>
>>52554742

of course i had to pass the interview but its actually true

stay jelly
>>
>>52554702
>javascript
prove it pajeet
>>
>>52554775
use braces you dip
>>
>>52554832
i did
it looked like
for (j = 0; j < y; j++);
{
>>
>>52554665
>Nothing compares to the touch of a real woman.

I don't know about that, Ruby. The feel of finely stained wood and cold steel on a new gun is pretty good.
>>
>>52554775
what horrible language are you working in
>>
>>52554827

i made a little paint program, a mouse click 2d shooter, and just basic bootstrapped web site layouts. That's literally it. During the interview they had me fizz buzz and program tic tac toe with html/css/javascript.
>>
>>52554845
wtf

also, that is why this format
 for(int i=0; i<69; ++i){
cunt();
}


is superior
>>
>>52554773
>maintaining 30 years old shitware
>desktop applications
Choose one.
>>
How can I view all my GET requests, /dpt/?
>>
>>52554889
this is a horribly general question and should probably go in /wdg/
>>
>>52554906
/dpt/ is like a chatroom, you can ask whatever you want here.

stop promoting other generals, anon.
>>
>>52554889
http://requestb.in/
https://github.com/Runscope/requestbin
>>
>>52554879
But that's exactly what I'm going to be doing. Just because niche products are small business, doesn't mean they don't exist.
>>
>>52554970
My fucking sides! Is that how people who end up in dead-end job like codemonkeying or burger flipping always end up like?
>>
>>52554985
Low quality shitpost, please modify before reposting.
>>
>>52554970

can you tip your fedora any harder? its 2016. Javascript is taking over and web applications are running the world now.
>>
>>52554970
maintenance can be fun if the original software was written really well. if not, probably sucks hard to maintain that crap
>>
>>52555071
Eitherway, using a dead language is really shit.
>>
>>52555065
>It runs in The Cloud™ :^)

High level meme languages come and go every 5 years, but low level shit is here to stay.
Even if one of the many maymays actually lasts, how much are you willing you gamble that it'll be the one you're using?

I'll take solid employment over starbucks enterprises, thanks.

>>52555071
The people who wrote the original software are still there.
It's being improved upon all the time, but they don't currently have enough manpower to maintain the existing codebase and add all the new features that they would like.
I'm going to be doing more of the latter, but some maintenance too if the others are held up and some serious bug appears or whatever.
>>
>>52555065
that's just a stupid meme. web apps have severe drawbacks. just try running any webgl app for instance. unless you lucked out with your graphics drivers or something you will not have a great experience with it.
>>
>>52555221
Unlike C am i rite?
>>
>Javafags will never know the fun of pointers
>>
>>52555274
But all nonprimitives in Java is are pointers, anon.
>>
>>52555274
>ctards will never know the fun of no buffer overruns, no use after free, no double free.
>>
>>52555287
Those are the result of bad programming though
>>
>>52555310
>literally everything is bad programming except using a high-level language
Thanks.
>>
File: fuck.png (24KB, 825x1013px) Image search: [Google]
fuck.png
24KB, 825x1013px
so I got it to work, but I feel like there has to be a better way to do this
import sequtils

let x = toSeq(0..53)

iterator chunks(s, n): auto =
for i in countup(1, len(s), n):
yield s[i..i+n-1]

for i in chunks(x, 5):
echo i

this, when run, gives
Traceback (most recent call last)
l.nim(7) l
system.nim(3202) []
system.nim(2527) sysFatal
Error: unhandled exception: index out of bounds [IndexError]

which can be fixed by changing it to
iterator chunks(s, n): auto =
for i in countup(1, len(s), n):
if i+n < len(s):
yield s[i..i+n-1]
else:
yield s[i..len(s)-1]

this looks ugly to me though, is there a better way?
>>
>>52555357
>he fell for the self-perpetrated nimeme
>>
>>52555328
Not my fault if you can't check your inputs
>>
>>52555380
>I'm the only person in the world who can check my inputs!
>therefore C is a good language!1
>>
>>52555391
>I'm the only person in the world who can check my inputs!
When did I say that
>>
File: 12.png (16KB, 314x138px) Image search: [Google]
12.png
16KB, 314x138px
>>52555391
d
e
l
u
s
i
o
n
>>
>>52553087
I'm programming a robotic snowplow in a last ditch effort to get it working for the ION competition in 5 days.

Also VHDL... lots of VHDL
>>
>>52555405
Are you backpedaling now? Are you admitting that you aren't better than the sum of all the best C developers to ever grace this Earth?
>>
File: gay_3.png (14KB, 728x399px) Image search: [Google]
gay_3.png
14KB, 728x399px
>>52554610
fuck you
>>
>>52555430
>Are you admitting that you aren't better than the sum of all the best C developers to ever grace this Earth?
When did I ever insinuate that I was? Are you okay anon?
>>
>>52555447
Backpedaling at the speed of light I see.
Typical ctards.
>>
>>52555454
Whatever you say anon
If you don't check your inputs, then it's your own fault if your program suffers any kind of overflow
>>
I just came to say that after learning basic html and css I'm having so much fucking unbelieable fun.

I don't get why you guys hate webdev.

It's so fun and easy.

:)
>>
File: no thanks.png (186KB, 1271x975px) Image search: [Google]
no thanks.png
186KB, 1271x975px
No thanks, /g/.
Figured out transforms and projections on my own.
Wasn't even that difficult. Jesus.
>>
>>52555494
>C is the best language
>it lets hacker get all my user's credentials
>it lets my kernel be vulnerable to remote execution
>it kills every application that relies on time information in 2000
>I love C
>>
>>52555531
nice 1998 meme
>>
>>52555511
Fuck off back to your containment thread pajeet.
>>
>>52555511
what language did you learn first and if it's a low level one then I agree because web dev languages are easy as fuck.
>>
>>52555540
who?

I don't browse the web development general.
I just started to learn html and css.

>>52555573
[spoiler]C# then Java[/spoiler]
the most low level shit was making breakout in SDL.
>>
Firefox or Chrome?
>>
>>52555601
whichever one you prefer better, anon
>>
>>52555531
http://securityaffairs.co/wordpress/32743/security/java-poses-security-risks-us.html
Stay delusional
>>
>>52555531
>Complains that C is insecure
>Still uses operating system with the vast majority of components written in C

Just because you're unable to program secure code, doesn't mean others can't manage just fine :^)

Stick to meme languages, we don't want you causing any real harm.
>>
>>52555618
>software written in C is the largest security risk
Thanks for proving my point.
>>
>>52555625
>points out the OS is written in C
>implies that this means some C programs aren't chockfull of bugs
>when the OS is known to have pages upon pages' worth of security vuln which were all due exclusively to the use of C rather than a sane language
Cmen logic.
>>
File: shitposting.gif (31KB, 250x250px) Image search: [Google]
shitposting.gif
31KB, 250x250px
>>52555658
Nobody ever claimed C code is bug-free.
You just seem to be under the impression that nobody is capable of writing secure software in C.
If you truly believe this to be the case, then you wouldn't willing run any program written in C, or that uses components written in C.

But you do, because you're a hypocritical shitposting faggot.
>>
File: BUNBUUU.jpg (107KB, 932x651px) Image search: [Google]
BUNBUUU.jpg
107KB, 932x651px
Some challenge website asked me to simulate falling tetris blocks after a 4-line tetris and I solved it by sorting the game grid vertically with qsort...

Am I doing it right?
>>
What's the Notepad++ of Linux, /dpt/?
>>
>>52555859
gedit
>>
>>52555859
Kate
>>
>>52555781
Strictly speaking the solution is correct, you only had to simulate the results. But if you weren't a faggot you'd just count the number of blocks in each row and spit it out in sorted order, since all blocks are equal.
>>
>>52555902
*although it's only correct in the case the game has just started.
Correct solution is to parse all four columns for the first instance of a block it finds.
It chooses the maximum (or minimum depending on how it's set up) and then teleports it above that row.

In the case of a vertical 4-line tetris block then all you have to do is drop it above the first block, or at the bottom if there is none.
>>
>>52555859
atom
>>
File: 1.8468080.jpg (354KB, 2400x1649px) Image search: [Google]
1.8468080.jpg
354KB, 2400x1649px
>mfw I realize negation is just xoring with all 1s
>>
>>52555993
I guess you could do that.
Intellectually it's a far more intensive task than two's complement.
>>
>>52555993
>using one's-complement
>>
>>52555993
No it's not you fuck.
It's NOT X + 1
>>
Which is easier to make a compiler for? RISC or CISC?
>>
I'm working on a new block cipher algorithm. I have the proof of concept code done for the alphabet(lower and upper case) and a few symbols. Now I'm working on having it handle all ASCII and Unicode characters.
>>
hard ass niggas write oop
>>
>>52556201
It depends on the actual CPU architecture.
>>
>>52556295
Okay, may i ask another question?
Which is more efficient for a VM architecture? RISC or CISC?
Is that even applicable to bytecode? how different is bytecode to actual machine code anyway?
>>
C program to get the determinant of any matrix. Having some infinite loop issues.
>>
>>52556385
It's very concise though
>>
>>52556445
post code
>>
>>52556509
>>
>>52556523
>tfw no code
>>
>>52554569
>Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them. The name "LLVM" itself is not an acronym; it is the full name of the project.
>>
>>52555859
Am I autistic if I just like to use nano?
>>
>>52553564
Why not? I usually switch around, they work exactly the same. Clang gives really nice colored error messages so if I'm struggling through template errors or some C++ bullshit I might use clang. I think clang compiles faster, but I haven't made anything substantial enough for any "performance" differences to matter. I have however had problems with code only compiling on clang and not on gcc, but it was something kind of un-standard so I just rewrote it to be compatible.
>>
File: GentooEmacs.png (5KB, 720x400px) Image search: [Google]
GentooEmacs.png
5KB, 720x400px
>installing unnecessary bloat like a WM in order to program
>he can't do it all from the command line
Shiggy
>>
$ ed -p'> '
> a
Hello world
Why can't we all get along?
No one needs to die!
vim, emacs, nano, we can all live in unison.
.
> 1,2d
> 1,s/.\{7\}n/n/
> 1,s/ds/d/
> 2,s/o,.*/o /g
> 1m2
> 1,2j
> ,p
>>
>>52556593
Maybe.
>>
>>52556633
How did you screenshot?
>>
>>52556593
>>52556593
nano is good for reading large files but not for writing them. Use sublime text for a semifledged but very competent text editor. It won't look as 1337 as a terminal though.
>>
File: bear.webm (3MB, 852x356px) Image search: [Google]
bear.webm
3MB, 852x356px
Ask your much beloved programming literate anything.

>>52555859
kate
gedit
lime text (http://limetext.org/)
neovim
brackets (http://brackets.io/)
zed (http://zedapp.org/)
light table
atom
liclipse (http://www.liclipse.com/)
emacs/aquamacs/spacemacs (https://github.com/syl20bnr/spacemacs)

>>52556670
not him but i wrote a script to take screenshot of the linux frame buffer

http://neetco.de/CodeArtisan/FBSnap
>>
Ask your beloved programming illiterate anything
>>
>>52556695
Why not? It feels pretty comfy.

The only thing I hate is that CTRL+X isn't cut, but I suppose that is easy fix.
>>
>>52556695
I'm either in IDEA or vi, mostly vi. I stopped using sublime once they went proprietary.
>>
>>52556670
I have it running in a VM, but I don't actually use it for programming.
>>52556695
I like using nano for quick edits like config files and whatnot. Anything more involved I usually go to Emacs
>>
File: GentooSF.png (9KB, 720x400px) Image search: [Google]
GentooSF.png
9KB, 720x400px
>>52556754
Forgot pic
>>
>>52556723
I don't think bears do that
>>
I have a class that's partially in C this semester, so I wrote an emulator for the educational processor architecture we're going to write ASM for in order to refresh my memory of the language.

https://github.com/AnthonySuper/lc3-simulator
>>
>>52556844
>539 contributions in one year

fuck that's pretty good m8. What year are you in university?
>>
File: 4966441.jpg (11KB, 312x312px) Image search: [Google]
4966441.jpg
11KB, 312x312px
>>52556844
Looks cool Anthony
>>
>>52556844
>including c files

y u do dis
>>
>tfw no qt haskell gf
>>
>>52556723
Good film tbqh.
>>
>>52556989
They are too pure for this world.
>>
File: Practical_Language_Comparison.jpg (2MB, 2100x1400px) Image search: [Google]
Practical_Language_Comparison.jpg
2MB, 2100x1400px
>>
>>52556885
Freshman. I'm in first-semester sophomore level CS classes, though.

A lot of the stuff I've done in class has, so far, been pretty easy, which is a bit disappointing. Guess that's what I get for doing a shitload of programming work on my own before college. Hopefully things get older soon.


By the way, that number doesn't include all the work I've done on my website, since that's in a private repo. Here's the real number.
>>52556902
The code or the profile picture?

Because, in all honesty, that's probably the funniest picture of me ever taken.

>>52556940
Honestly? Laziness. I didn't want to write Make rules for tests.

I don't think I get much out of incremental builds of tests anyway.
>>
File: uvnPZhm.png (266KB, 1116x751px) Image search: [Google]
uvnPZhm.png
266KB, 1116x751px
can /dpt/ program "Does it have legs?"
>>
Editors? Spacemacs is the future everyone
>>
File: image.png (832KB, 1280x720px) Image search: [Google]
image.png
832KB, 1280x720px
Are lines of code usually directly proportional to the resulting instruction count?
>>
>>52557076
same here except a level up. The class is ridiculously easy and all I have to do is go to the tests. One less 4 credit class I have to worry about I guess.
>>
>>52557167
I'm still going to the classes, mostly to try and get to know the instructor/people in the class a bit better.

Both of my instructors in CS this semester seem super cool.
>>
>>52557085
Probably. I was trying to write a learning Tic-Tac-Toe game a few years ago, but I got bored.
>>
What gui framework in c++ feels the most familiar coming from a Swing background?
>>
>>52557189
>printf("the only winning move is not to play\n");

good choice
>>
>>52557240
http://www.cplusplus.com/forum/lounge/140601/

Also, swing is a horrible GUI framework.
>>
>>52557240
None of them. Swing is garbage.
Swing looks nothing like contemporary GUI frameworks, and message passing between the GUI and the underlying data is completely different.
>>
File: anime thumbs up.jpg (24KB, 301x267px) Image search: [Google]
anime thumbs up.jpg
24KB, 301x267px
>>52556844
Pretty nice. Your code looks good. Pretty far ahead of where I was freshman year.
>>
>>52557189

I actually had to do a learning tic tac toe game in one of my undergraduate classes. The tic tac toe was played by a robot controlled by an NXT brick. It moved a marker around and scanned a physical board on paper with a light sensor. It had to play randomly for the first 9 rounds, and then start playing all further games only with the training data. Given that mine went for the center as the first move on its 10th game, followed by going for corners, I'd say it did a good job.
>>
>>52556633
since you decided it was necessary to reveal your gender, I'm a girl and can program exclusively from the command line
>>
Question: If I wanted to do audio FFT analysis with a raspberry pi, would all I need is an ADC to convert the analog signal into a digital one then let the GPIO pins do the rest of the work?
>>
File: 1389974919976.png (5KB, 160x166px) Image search: [Google]
1389974919976.png
5KB, 160x166px
>>52553939
    public class Config
{
public event Action ValueChanged;

bool value;
public bool Value
{
get { return value; }
set
{
if (_.Update(ref this.value, value))
ValueChanged?.Invoke();
}
}
}

public static class _
{
public static bool Update<T>(ref T value, T newValue)
{
if (value.Equals(newValue)) return false;
value = newValue;
return true;
}
}
>>
>>52557591
There is probably an ADC on the board, but it's been a while since I've looked into it. What do you mean by 'let the GPIO pins do the rest"?
>>
>>52553803
>C++
>not using sfml
>>
>>52557629
I'm thinking of doing realtime fft analysis so it'd go

audio interface line out->ADC->GPIO->program

The audio has to be coming from an external source, hence the need for an external adc. I'm just making sure I don't need anything else in between.
>>
I want to learn python (please no h8) and I have a VERY VERY BASIC programming foundation. What would be a decent free IDE? Free as in free beer, I don't mind free as in freedom either though. Should I ever bother with an IDE? What's a good text editor if not?
>>
>>52557683
Note that I'm using xubuntu. So I'd need it to be compatible with debian/ubuntu based linux distros.
>>
>>52557683
with python a software ide will really only slow you down. I recommend trying this out as it has code completion and the works without the bloatiness of desktop ides. http://pythonfiddle.com/
>>
>>52557696
I'm really not a fan of cloud services. Anything that I can download and use without an internet connection?
>>
>>52553939
>>52557604
Oh sorry, didn't see your real question.
    public class Config
{
public event Action ValueChanged;

bool value;
public bool Value
{
get { return value; }
set
{
if (_.Update(ref this.value, value))
ValueChanged?.Invoke();
}
}

public static implicit operator bool(Config con)
=> con.Value;
}

public static class Foo
{
static Foo()
{
var con = new Config();
if (con) // do something
}
}

public static class _
{
public static bool Update<T>(ref T value, T newValue)
{
if (value.Equals(newValue)) return false;
value = newValue;
return true;
}
}
>>
>>52557701
Also I've heard good things about Sublime Text 2. Anyone have some experience with it? Would it work fine for learning python and still be useful in the future? (IE more complex stuff)
>>
>>52557729
it's good for just text highlighting but not code completion if that's what you're looking for. For beginners I would recommend this feature. Try this http://komodoide.com/komodo-edit/
>>
>>52557745
Shouldn't it be the opposite? Having the program complete the code for you wouldn't it make your learning slower? Once you have it ingrained then you can let it take care of it for you?
>>
>>52557750
So by that logic, as a beginner it's faster to go look up every detail about the language every time you want to write something?
>>
>>52557750
I would consider myself an intermediate programmer and I switch between so many languages at work, things like function names never truly get ingrained. It's easier to have the IDE tell me if it's insert, append, push, +, etc. since each language does it differently.
>>
>>52557750
I wouldn't say so. Code completion is not very intrusive, making you hit tab to complete a word and it doesn't just template out lines of code for you, you have to give it input for it to respond. It can allow you to explore the language more in depth while giving you a good sense of how the language should be structured.
>>
>>52557677
How are you going to interface the adc -> gpio? Depending on the chip it might be non-trivial to bit bash it through.. That's why I suggested looking into a peripheral ADC built into the SoC, but I'm not sure it actually exists.
>>
>>52557770
That's what I would tend to believe. Yes. Sorry if I'm being retarded here. Bear with me.
>>52557774
>>52557789
Alright then so the conclusion is that I should look for a text editor with code completion for python?
Would this be my best bet? http://komodoide.com/komodo-edit/
>>
>>52557683
What kind of functionality would you expect from an IDE? Python is dynamically-typed and late-bound, so most of the code-browsing features you'd get in C/C++ aren't an option.

The standard Python distribution includes Idle, which includes a text editor and interactive debugger, but it's fairly primitive.
>>
>>52557128
Depends on your definition of "line of code".
Depends on your definition of "instruction".
>>
>>52557836
>What kind of functionality would you expect from an IDE?
I have no clue.
>>
>>52557796
Try it and see if you like it. That's the best way you can tell.
>>
>>52557876
Alright, I'll do that. Thanks for the responses everyone.
>>
>>52557790
Ha, one look at the raspberry pi site and it gives me that exact answer. Not often that happens.

"The Pi does not include a hardware analog-to-digital converter, but an external ADC (such as the MCP3008) can be used, along with some bit banged SPI code in Python to read external analog devices."
>>
File: kid-flying-robots.png (153KB, 475x474px) Image search: [Google]
kid-flying-robots.png
153KB, 475x474px
>>52557914
There you go :) In my experience the spi device is easy to use. it just shows up as a file in /dev/spi. Have fun, sounds like a good project.
>>
>>52557914
The rev.2 boards have I2S, which might be more appropriate (SPI is probably easier to find information for, though).
>>
>>52557944
Thank you! I'll make sure to post it here once I'm done.
>>
>>52555531
>>52555658

Anon, you claim than the existence of bugs in operating systems is due to the choice of C. Name one language suitable for operating system development which would not have the same faults as C. Remember: Because one of the major roles of an operating system is to manage memory for all applications, no language which uses any form of garbage collection, or makes any assumption about how memory is laid out can be usable. It is also mandatory that any language used in kernel development be able to convert an integer into a raw pointer and deference it for DMA I/O operations.

Let's see what our viable non-C languages are:

C++ : So we're basically just using C with some extra abstraction. Bugs due to, say, buffer overflows are still going to occur.

Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.

Ada : Possibly viable. It's still possible to get the same bugs as in C if you're stupid, however.

D : See C++... except you're going to want to kill yourself because this language was designed to be used with a garbage collector.

Forth : If you want to gouge your eyeballs out.
>>
Why haven't you got a job, /dpt/?
>>
>>52558037
because welfare pays enough for me to live comfortably
>>
does anyone have a book or something for transitioning from outdated c++ to c++14?
>>
>>52558066
Why haven't you made a website or program that generates you millions a year?
>>
>>52557971
>Ada: Possibly viable
It's absolutely viable and commonly used in RTOS development.

http://www.ghs.com/AerospaceDefense.html
>>
>>52558081
I don't know how ;_;
>>
>>52558076
No.
Watch CppCon keynote videos. Years 2014 and 2015 are what you want.
>>
>>52557971
ada is shit, definitely the most annoying programming language.
>>
What resources do you guys use to make sure you're keeping up to date with progress in your fields? I'm in my final year of Uni right now and I'm worried about stagnating once I hit the workforce.

Is it mainly just about working on side projects?
>>
>>52557971
Your comments about the "OS" only apply to the kernel, and that doesn't actually have to include things such as the network stack, or any device drivers beyond those for the CPU/MMU/DMA (although obviously you need to avoid things like swapping out the SATA driver for the device hosting the swap file ...).
>>
>>52557971
>Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.
unsafe or not you still have abstraction techniques that are not possible with c.
>>
> that glorious feeling when you write a script that saves you at least a week of manual work for the first time

How did I ever live without doing this shit
>>
>>52558145
reddit
>>
>>52558369
>2008
>Why haven't you learnt Groovy? It's the next big thing
>2009
>Why haven't you learnt Haskell? It's the next big thing
>2010
>Why haven't you learnt Scala? It's the next big thing
>2011
>Why haven't you learnt Clojure? It's the next big thing
>2012
>Why haven't you learnt Scala? It's the next big thing
>Reddit

Repeat infinitum
>>
>>52557971
>Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.
I think you should look up Redox. It only has 108 unsafe blocks (which are mostly small) in 46KLOC of rust code.
>>
Has anyone here worked with Retrofit?
How do you guys pass an API Key to every request? Do you use interceptors?
>>
Would anyone care to try out my project? It's the first one I've done for fun on my own, and my first real attempt at using C++, and Qt.
https://github.com/rzumer/Webbum/

It's an interface to encode video to WebM with ffmpeg (VP8 or VP9). The default settings are pretty slow so make sure that you only encode a few seconds to a few minutes at a time if you do try it (trim function).

I have had issues trying to run it on one computer due to dynamic linking, and I haven't thoroughly tested all the options in the program, so just knowing what issues there are would help a lot. I've been using it myself for 4chins, but mostly with default settings.
>>
>>52559454
>no screenshot

nah
>>
A website to index ipfs hashes from a webpage, hopefully it will lead search engines crawlers to index more ipfs content.

http://ipfscraper.heliohost.org/
>>
Is there a point in using mono anymore?
>>
>>52557128
Depends how consistent you are.
If you keep switching between very long one liners, and then more verbose broken-out blocks then it's hard to find a constant.
But if it's relatively consistent, number of instructions ∝ LOC
>>
char* variable
or
char *variable

The first one can read as;
variable is of type 'char pointer'
The second one can read as;
variable is a pointer that points to type 'char'

In a type based language like C, wouldn't the first one make more sense?
>>
>>52559599
Always the second one.

char* foo, bar;


What are the types of foo and bar?
>>
>>52559622
well it would be of type char*, no?
>>
>>52559637
In that example foo is a char pointer and bar is a char.

char *foo, *bar;


If they were both pointers it would look like this.
>>
>>52559645
huh, they are different types.

char* foo, bar;
printf("%d\n%d\n", sizeof(foo), sizeof(bar));

this spits out different sizes
today i've learned, thanks
>>
>>52559552
Windows XP support.
>>
>>52559599
Well I'd read the first as: variable is a char pointer
And I'd read the second one as: dereferenced(*) variable is a char.

Using the first makes you think in terms of the pointers, whereas the second makes you think in terms of the actual data.

There is no specific "char pointer" really. Also, consider the implications of reading it as "declaring a pointer".
If you are only declaring a pointer for a string, what about memory allocation for the string itself?
>>
>tfw favorite language has the status of a meme in the local programming community
I really enjoy using it, but if I told an employer it's my main language, he'd probably roll his eyes because said language was chosen for high school computer class and shitty university programs.

I'll probably have to fill my portfolio with stuff written in another language just for the sake of employability.
>>
File: youcantstopliteracy.webm (3MB, 640x360px) Image search: [Google]
youcantstopliteracy.webm
3MB, 640x360px
>>52559599
char* as a whole is not a type but a type and a declarator.

char * foo
does mean that foo is declared as a pointer (*foo) and its type is char (so it's a pointer to char), not that the type of foo is char*

for example, with the const qualifier

char const * foo; // pointer to constant char
char * const foo; // constant pointer to char


which can be viewed as
[char const] [*] [foo]
[char] [* const] [foo]


* is not part of the type.

another reason to favor
char *foo
is that the type of the expression *foo is char: it's a common case in C where the declaration always (excepting a few cases) mimic how the variable might appears in an expression (that's the reason for the awkward syntax for a function returning an array pointer)
>>
File: xdress.png (1MB, 1702x2471px) Image search: [Google]
xdress.png
1MB, 1702x2471px
>>52553087
I implemented neural network backpropagation yesterday. RPROP really is way faster than using the gradients directly.

Going to start using autodiff for more complicated networks. I'm thinking of going with Theano.
>>
>>52559505
Screenshots at http://cyprienne.me/webbum/ Some values are messed up because it's the wrong build, but UI is the same otherwise.
>>
>>52560027
So basically read the declaration backwards
got it
>>
>>52560057
Also, I finally understand why people use Python so much in machine learning.
>>
>>52556573
>I'm retarded look at me!
>>
>>52554569
I hope you're trolling
>>
>>52560137
>mfw people this retarded are physically able to post on /g/
>no face when
>>
>>52557644
>using sfml
>no 3d
>one vertex type
>literally one vertex type

class Vertex
{
Vector2f position;
Color color;
Vector2f texCoords;
}


top kek
>>
File: dfdisk.png (3KB, 641x301px) Image search: [Google]
dfdisk.png
3KB, 641x301px
Working on a small fdisk like clone for virtual disk images. Eventually hope to get it work with real hard disks.
>>
>>52560271
neat.

I love low-level stuff like this. Unfortunately, I don't know where to even start with that stuff :(
>>
File: dfdisk2.png (3KB, 640x300px) Image search: [Google]
dfdisk2.png
3KB, 640x300px
>>52560289
Would you like me to share the repo? It's really quite simple once you know what data structures to create. Here's some links to help you.

http://blog.creativeitp.com/posts-and-articles/bios/analysing-the-master-boot-record-mbr-with-a-hex-editor-hex-workshop/

https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Boot_Sector
>>
>>52553939
Just use an observable. Specifically with reactivex.
var obvBool = new BehaviourSubject<bool>(true)
obvBool.subscribe((val) => Console.writeLine("The value is: " + val));
obvBool.onNext(false);

prints
The value is: true
The value is: false
>>
>>52560271
>>52560327
How many file systems do you recognise?
>>
>>52560472
At the moment, just FAT and NTFS, but I'll add more. There's so many labels it's fucking ridiculous...
>>
>>52560257
>packing vertex data

why.jpg
>>
>>52560637
Not sure if retarded or just pretending.
>>
I made this script in python for downloading imgur albums and save them in new folder in pictures dir (yeah I know you can just download a zip of the album I am just doing this for practice)
from getpass import getuser
from os import makedirs, chdir
from urllib.request import URLopener, urlopen
from re import finditer

link = input("Copy paste the link of the album: ") + "/layout/grid"


source_code = str((urlopen(link).read()))

title = source_code[source_code.find("<title>")+7:source_code.find("- Album")].replace("\\n", "").lstrip()


id_list = []
for m in finditer('//i.imgur.com/', source_code):
x = (source_code[m.end():m.end()+11])
if x[-1] == "p":
x = x+"g"
if x[-5] == "b" or x[-5] == "s":
x = x[:8]+x[9:]

if x not in id_list and x[-4:] == ".jpg":
id_list.append(x)

n_f = "C:\\Users\\"+getuser()+"\\pictures\\"+title
makedirs(n_f)
chdir(n_f)


for i,x in zip(["https://i.imgur.com/"+x for x in id_list],id_list):
URLopener().retrieve(i, x)



gimme some feedback fags
>>
>>52553087
I have one final interview for Facebook so Im just studying right now so I can pass and finally not live the shitty life of a college student

I hate being poor
>>
>>52560646
Instead of ad hominem why don't you explain why it's a good idea to pack vertex data? Unless, of course, you don't understand what you're talking about and resort to name calling.
>>
>>52560671
Your first feedback is to stop using a shitty language with enforced indentation

We have semicolons for a reason. It allows the developer to develop how he or she wants not how the language creator wants
>>
how the fuck do i make a search function in c where i return all positions if there is more than one occurrence?
>>
>>52560671
It's garbage, and you're assuming whoever uses it has their user folder in "C:\Users". Also stop using stupid 1/2 letter variable names if you want your code to be readable
>>
>>52560671
Why not use the official API?
>>
>>52560699
I don't have time to explain additions to someone with the brains of a 2 years old. Fuck off, tard.
>>>/reddit/
>>>/tumblr/
>>>/trash/
>>>/out/
>>
>>52560723
What data structure? Array?

How about you do a linear search and then save valid indicies in a buffer and then return the buffer
>>
>>52560742
yes, an array. should i use another array with positions and return it?
>>
>>52560741
I guess you really don't know what you're talking about then :^)
>>
>>52558076
>>52558119
>No.
Why? Effective Modern C++ has most of the basic shit for transitioning.
>>
>>52560759
Ya. Just allocate a new array the same length as the input array then only return the head pointer and only the length of used slots instead of the whole array
>>
>>52560773
I'm not a closet homo like you, I'm not aiming to become a woman.
>>
Noob desu.

How do I do this without giving timesCalled global scope?

//Write a function, called "multiply," that multiplies two
//numbers and returns the result
//inform the user how many times multiply() was called
#include <iostream>

static int timesCalled = 0;

double multiply( double x, double y )
{

double answer = x * y;

timesCalled++;

return answer;
};

int main( void )
{
using std::cout;
using std::cin;

double number1, number2;
char yesorno;

do
{
cout << "Please enter a number\n";
cin >> number1;
cout << "\nPlease enter another number\n";
cin >> number2;
cout << "\nThe two numbers multiplied equals "
<< multiply(number1, number2) << "\n";
cout << "\nContinue? (y/n)\n";
cin >> yesorno;
cout << "\n";
} while (yesorno == 'y');

cout << "You called the multiply() function "
<< "\n" << timesCalled << " times\n\n";

return 0;
}
>>
>>52560777
Thanks m8
>>
>>52560812
What language?
>>
>>52560796
declare it in the function?
>>
>>52560796
int timesCalled = 0;
do {
++timesCalled;
...
} while (yesorno == 'y');
>>
>>52560843
Make more exceptions?
>>
>>52560846
that has nothong to do with the problem
>>
>>52560843
main() can't see it if I declare it in multiply()
>>
>>52560730
I don't know how to do that
>>
>>52560875
What? It has everything to do with the problem.
>>
>>52560826
c
>>
>>52560777
>leaking memory unironically
Ctards everyone!
>>
>>52560908
It still runs in O(N) space. Its nomimal
>>
Guys, need C# book, I'm in collage but totally lost, can you give me good book to read?
>>
>>52560943
Dont waste time learning C#

Probablem solved
>>
>>52560796
It's sometimes ok to have a global variable, anon.
>>
>>52560956
what part of the >I'm in collage
didn't you understand?
>>
>>52560796
You could declare it in main, and pass it to the multiply() function, and have the multiply() function return it.
>>
>+300
We need a new thread now !
>>
new thread
>>52560989
>>
>>52560943
>collage
Murach's C# is bretty good.
>>
>>52560796
>>52560843
>>52560846
>>52560970
It really scares me that no one on this board knows C...

int get_times_called( )
{
static int timesCalled = 0;
return ++timesCalled;
};


Now how you retrieve times called in your case is up to you.
>>
>>52560993
See >>52561006
>>
>>52560796
can't you just use an if statement inside the function? if times is undefined create the variable else add 1.
>>
>>52561006
redeclaring it allocates new memory dumbass
>>
>>52561006
>>52561018
But then that function has global scope anyway, and defeats the purpose of making his variable not global.
>>
>>52553087

Working on a server fault that took down my project site:

http://www.raskie.com/#on-notice

Please stop by and spam some shit.
Skript kiddies are especially welcome.
>>
>>52561026
>redeclaring it allocates new memory dumbass
It's not being redeclared you fucking dumb-ass. It's declared as static.

Do you even know C?
>>
>>52553126

It's a bitch, isn't it? I also think 100% coverage is an unworthy goal.
>>
>>52560940
>leaking memory is good
>runtime is all that matters
C T A R D S
T
A
R
D
S

Proof that nobody on /g/ who advocates C has any experience with it whatsoever.
>>
>>52561035
>But then that function has global scope anyway, and defeats the purpose of making his variable not global.
I'm not saying he should copy my function. He should do something like this instead:

int multiply(double a, double b, double* answer)
{
static int called = 0;

*answer = a * b;

return ++called;
}
>>
>>52561049
and an impossible one. Tests should only be written when there is an extremely good reason for them.
>>
>>52561041
but the scope is inside the function. Upon returning, the scope is lost and now you have a memory leak
>>
>>52561062
If only there was a technology that 'collected' that 'garbage' piece of data.
>>
>>52561058
>critical bugs are good
t. /dpt/
>>
>>52561080
>c
>gc
choose one.
>>
>>52561080
if it's garbage collected then the variable would be reset to 0 every time lol
>>
>>52561062
>but the scope is inside the function. Upon returning, the scope is lost and now you have a memory leak

There is no memory leak you fucking retard. Lrn2 static variables.
>>
>>52561104
the next time its called it doesnt access the same variable as the last time
>>
>>52561135
>the next time its called it doesnt access the same variable as the last time
It does. lrn2 static
>>
>>52561135
It does!
That's exactly what declaring a variable as static does.
>>
>>52561053
>One person says something stupid about x
>PROOF NOBODY UNDERSTANDS X

Poor quality shitpost.
>>
>>52561135
#include <stdio.h>

int undefined_behaviour()
{
int a; // affects memory
return ++a;
}

int initialise_memory()
{
int a = 0; // affects memory
return a;
}

int corrupt_memory()
{
int a = 0xdeadbeee; // affects memory
return a;
}

int well_defined_behaviour()
{
static int a = 0; // this memory will not be affected
return ++a;
}

int main()
{
initialise_memory(); // maybe sets memory to 0
undefined_behaviour(); // maybe sets memory to 1
undefined_behaviour(); // maybe sets memory to 2
undefined_behaviour(); // maybe sets memory to 3
int a = undefined_behaviour(); // maybe sets a to 4
printf("%x\n", a); // will (maybe) print 4 or result in a demon flying out your nose

corrupt_memory(); // this messes with the same memory area
a = undefined_behaviour();
printf("%x\n", a); // will maybe print deadbeef

a = well_defined_behaviour(); // sets a to 1 because not affected
printf("%x\n", a);
a = well_defined_behaviour(); // sets a to 2 because not affected
printf("%x\n", a);

a = undefined_behaviour(); // sets a to some random value (most likely 1)
printf("%x\n", a);

a = well_defined_behaviour(); // sets a to 3 because not affected
printf("%x\n", a);

return 0;
}
>>
>>52561182
More like, every person who's ever advocated C in these threads has only ever been able to make a fool out of themselves whenever C programming was involved.
>>
>>52561231
>I'll take what is confirmation bias for 500

Yes, a lot of people don't understand C properly.
Just like a lot of people don't understand Java or C++ properly either.

Most people on /g/ don't understand ANY language properly, so if you're gonna project, at least try shining the light into the other corners of the room occasionally.
>>
>>52561292
Only ctards push the c meme everywhere constantly.
Only ctards on /dpt/ have time and again been unable to understand even the most basic of c programming constructs.
Coincidentally, ##c on freenode is the most ignorant channel on the entire network.
>what's the correct type to hold a pointer address?
>"int"
>"long"
>"do you mean a pointer to a pointer or a function pointer?"
>>
>>52561358
Oh, come on.
You have tons of post here with "I just wrote a reduce function in Haskell. It's the best language eva!!!111"
>>
>>52561358
>>I'll take what is confirmation bias for 2000
Just stop.
>>
>>52561373
Except that when that happens, people don't actually make the most basic of mistakes in their haskell code. They are also able to answer elementary questions accurately.
>>
>>52561389
Butthurt ctard detected.
>>
>>52561391
>people don't actually make the most basic of mistakes in their haskell code
You heard it here first, /g/

No one is ever new to Haskell. You either know no Haskell at all or you are an expert, there is no beginner's stage.
>>
>>52561402
I read the original problem, he can free the allocated memory later, or just use a VLA
Stop talking about things you clearly don't understand
>>
>>52561404
You either know no haskell, or you're able to write an elementary haskell program without any obvious mistake. The reason for this is obvious: haskell is a significantly higher-level language than c, so making obvious mistake in small programs is really hard. Consider reversing an array. In C, half of beginners would have off-by-1 errors. In haskell, it's a single function call. If you force the haskell programmer to write the function manually, they'll implement it using destructuring bind and recursion, which is natural and fault-proof.
>>
>>52561446
I literally laughed in real life at your desperate straw-grasping and reality shifting.
>>
>>52561402
Maybe if you stop using hyperbole, and stop blindly ignoring all the retarded questions and code provided by other language users you might not be so salty.

On a previous thread no javamonkey could come up with a clean solution to modify/return two values from a method without having to create a near empty class, or storing variables well above the scope they should be in.
They couldn't even understand why come people might appreciate the convenience of primitive type references.

You wouldn't expect any sepples fags to understand the entire language inside-out, why a different standard for C users?
>>
>>52561081


Enjoy fixing those alongside the contrived test cases that tell you absolutely fuck all about what's breaking.
>>
>>52561450
That doesn't mean advocates always understand it properly. I've seen guys raving about monads but then showing some fundamental misunderstandings about them.
>>
>>52561466
I'm not wrong
>>
>>52561476
Let's see you trying to explain >>52561479
Go on, I promise I won't laugh.
>>
>>52561487
True, but there's a difference between not understanding every aspect of a language, and not being able to understand the most elementary primitives of a language. For instance, it doesn't matter that a javatard knows the difference between pass-by-reference and pass-by-value where some values are references. It does matter if the pajeet knows the difference between int and Integer, though.
>>
>>52561495
Why would I waste my time explaining to a retard that doing retarded things is retarded?

>One person gave me a bad answer
>NOBODY CAN GIVE ME AN ANSWER

If you can't even see the flaw in your logic then there's no use replying to your shitposting anymore.
Projection, confirmation bias, what makes you think anyone is taking you seriously?
>>
>>52561514
>not understanding pass-by-value and pass-by-reference = it doesn't matter
>off-by-one error = OMG HOW CAN U MAKE SUCH A HORRIBLE SIMPLE MISTAKE???!!!!

Nice arbitrary distinctions, anon.

Off-by-one errors are extremely common in all languages, I've seen them even in Haskell causing programs to crash or infinite recursions...

Not knowing the difference between pass-by-value and pass-by-reference is critical.
>>
>>52561566
Your tears are my sustenance.
>>
>>52561514
I hope you're not the person who thinks integer (not a class, just the word) is always taken to mean the mathematical sense rather than just an int.
>>
>>52561585
There's nothing arbitrary here. One causes an entire slew of very hard to debug (because lolc) issues and causes a massive security risk. The other results in a gotcha that can only arise when someone believes java to be pass-by-reference, which nobody who learned java would believe as they're always told explicitly that primitives and objects are different. Thus, whether they think java is pass-by-reference except for primitives or that it's all pass-by-value and that some values are references doesn't change anything on their end: they'll have to program in the same way to avoid potential issues.

Then again, I wouldn't expect a ctard to see the difference between a year's worth of development and 10 seconds.
>>
>>52561642
>One causes an entire slew of very hard to debug (because lolc) issues and causes a massive security risk.

1) C isn't hard to debug, what kind of meme is this?
2) It is completely arbitrary
3) It isn't even limited to C

>The other results in a gotcha that can only arise when someone believes java to be pass-by-reference, which nobody who learned java would believe as they're always told explicitly that primitives and objects are different. Thus, whether they think java is pass-by-reference except for primitives or that it's all pass-by-value and that some values are references doesn't change anything on their end: they'll have to program in the same way to avoid potential issues.
And this is why not being able to understand references is a much more fundamental mistake than making an off-by-one error which even seasoned developers do.

>Then again, I wouldn't expect a ctard to see the difference between a year's worth of development and 10 seconds.
I'm not going to argue with you if you're going to act childish.
>>
>>52561642
>they're always told explicitly that primitives and objects are different.
I don't think I have been told that explicitly.
But I had a weird prof teaching me Java, who hated the fuck out of Java because it wasn't Scheme.
>>
>>52561686
>hated the fuck out of Java because it wasn't Scheme.
Why are functional programming fuccbois so arrogant and intolerant towards other languages?

It's not really like different languages compete against each other.
>>
>>52561726
>Why are functional programming fuccbois so arrogant and intolerant towards other languages?
Because you produced bugged softwares and are proud of it.
>>
File: mfw-dog.jpg (34KB, 575x465px) Image search: [Google]
mfw-dog.jpg
34KB, 575x465px
>>52561745
>mfw FP fuccbois are so delusional they think they write bug-free software
Well, I guess as long as you keep making fizzbuzzes you will never make mistakes...
>>
>>52561677
Stop it, anon, you're breaking my sides! Have you considered a career as a clown? You'd make a killing and a shilling!
>>
>>52561686
He was right of course. Based prof, too bad I didn't have him.
>>
Randomly popping in to say, all of you so-called programmers hating on Java or having a dislike at it. Each and every language has its weaknesses and strengths, as well as its proper use-case for the job/project at hand,
>>
>>52561845
This. For example, java's strengths are absolutely nothing and its weaknesses are too many to count!
Oh wait, that wasn't your point, was it?
>>
File: 1448569396439-g.jpg (214KB, 444x467px) Image search: [Google]
1448569396439-g.jpg
214KB, 444x467px
>>52561863
Nice reply, made me kek. Have a (You)
>>
File: 1452127171215.png (8KB, 398x293px) Image search: [Google]
1452127171215.png
8KB, 398x293px
>>52561863
>calling shit the most popular software
>calling shit a software that has decades of libraries ready to use
>le java is bad meme

I don't give a fuck about your memes, java is fine for certain situations, like doing android shit.

Also, it's more productive and faster to deploy than C or C++

Stay mad kid, keep trying to make interactive webshit with C/C++

>muh tool is perfect for all jobs
stay delusional faggot.
>>
>>52561827
You have no idea how ridiculous it was.
He taught Java the same way he taught us Scheme.
The first things we had to do was create our own Scheme-style linked list with Generics and make map and reduce (recursive of course) for it. He then later introduced loops at some point and presented them as Java's ugly workaround for not having a variable sized stack and no TCO.

I'm serious.
>>
I hate it when /dpt/ gets like this. There are really fulfilling arguments to be had, arguments with real assertions about complex topics, and also really unfulfilling ones. These ones are unfulfilling.

Pretty sure most of the idiotic statements coming out of this thread in both "debates" are the same person pretending to be retarded anyway.
>>
>>52561996
I don't get why Ctards want to force C on every situation when every language has it's own niche.

Java for doing android and web entreprise shit, and small 2D games.

Python for doing science and learning, among scripts.

C++ for serious work like graphical applications and game engines.

C for embeded work and drivers, kernels and low level stuff.

Ruby for webshit.

Lisp for academical stuff.

Haskell for I dunno, more practical academical shit I think.

Go for working at google.

Other languages are good at their niche.

It's fucking retarded.
>>
>>52561945
>I don't give a fuck about your memes, java is fine for certain situations, like doing android shit.
It's only "fine" for android because nobody has a fucking choice in the matter, it's Java or nothing.
At least Java isn't as infuriating as objective-c/swift, that is pretty much the only positive to using it for mobile development.

>Also, it's more productive and faster to deploy than C or C++
It's generally faster to not think things through much and not do them properly too, are you suggesting that's a good idea?

>Stay mad kid, keep trying to make interactive webshit with C/C++
You know, there are more than 3 options to choose from.
And really, nobody is suggesting you make anything interactive with C, but you can easily do the backend with it.
I'd recommend doing the frontend in Qt or freepascal.
>>
>>52562034
>Projecting
>This
>Hard

>I met one guy who only uses C, therefore everyone who so much as touches C once WILL ONLY EVER USE C FOR THE REST OF THEIR LIFE AYYLMAO
>>
>>52562062
>It's only
In the magical place of hypothetical situations we could still be working on bynary.

but even C was made as to make things easier, and was considered high level.

What's wrong with making higher and easier languages?

>to not think
sometimes you have a deadline and need to produce something quick and fast.

Everything depends on your goal, even Stroupsoup has said there's no perfect language.

C is fine for kernel shit and embeded systems, that's his current niche.
>>
>>52561959
That's hilarious. He's also right. Java is so shit it doesn't even have TCO so you have to use loops as a workaround. Likewise, it doesn't have first-class functions so you have to use classes as a workaround.
>>
>>52562096
then why you Cfags feel so insecure everytime I show java shit here?
>>
>>52562107
>pajeet is retarded
Wow, color me surprise.
No, please don't literally color me. Keep your hands to yourself, pajeet.
>>
>>52562143
at least indians are working on the industry and slowly taking all your jobs.
;)
>>
>>52562134
Java hating meme is really not limited to C fags.
>>
>>52562177
Nobody sane likes C for any work where any other language can be used.
Nobody sane likes java.
>>
>>52562177
It's like SJWs and the patriarchy, Javafags are always blaming people who use C
>>
>>52562208
but javafags are sucesfull people who have jobs on the industry and are minorities, not some white fatlord speaking for us.
>>
>>52562248
Rajesh is right! Kill the patriarchy!
>>
>>52562107
>What's wrong with making higher and easier languages?

How is taking away the option to use other things a good idea. If people want to write things in .NET or whatever because it just werks then great, just don't prevent them from using existing tools perfect for the job.

Even though the underlying system is linux, you can't even use stuff like libusb because of how the permissions work, and how the absolutely convoluted UsbDevice class "works".

>sometimes you have a deadline and need to produce something quick and fast
I'm not going to say that java is flat out slow, but when the syntax is verbose compared to most other languages, and simple features like passing by reference are missing, it's no longer a quick and fast solution

>Just do it the Java™ way :^)
When a 5 line total C function takes up 20 lines in Java because of needing to build wrapper classes, you have lost your development speed.

There are plenty of times when Java is appropriate, but every time I've used it has been because I was forced to due to lack of options, not because I was given a choice.
>>
>>52557501
Thanks!
>>
>>52561726
>>52561804
Because they don't know the history of the languages they use.

OCaml is as closely related to BCPL as C is, but it's derived from the higher-level CPL language. Haskell is also part of the CPL family. The '\n'-style escapes came from CPL too.

They don't like CPL because it shows that "functional programming" features were in "imperative languages" before they were in "functional languages."
>>
>>52562361
Are you a professional joker or is it just a hobby for you?
>>
>>52553087
if you're going to post anime traps at least post cute ones baka..
>>
File: plebs vs pats dpt.png (56KB, 839x777px) Image search: [Google]
plebs vs pats dpt.png
56KB, 839x777px
weekly reminder
>>
>>52562463
Fuck of newfag.
>>
>>52562478
>php
>>
>>52562482
are you upset?
>>
>>52562501
I am upset about how much of a nigger you are, stealing other people's F's.
>>
>>52562439
Telling the truth sometimes makes people laugh, I suppose.
>>
>>52562497
I didn't even notice it at first.
It was all going so well, too.
Thread posts: 388
Thread images: 41


[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.