[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: 344
Thread images: 35

File: prog.jpg (105KB, 473x496px) Image search: [Google]
prog.jpg
105KB, 473x496px
Old thread: >>61500040
What are you working on, /g/?
>>
im learning c++
>>
Reposting question
>What's the idea place to discard fragments in OpenGL? I'm assuming it's at the end of the fragment shader even if it's not going to be used since at least it doesn't fuck with SIMD.
>>
Learning Rust. So far, so good.
>>
>dumb fuckers prefix their shit with _ to avoid name collision.
>everybody starts doing it and now the prefixed names are colliding.
>>
>>61504965
>we don't need namespaces btw
>>
Which programming language should I, a cute Jewish girl, use?
>>
>>61504980
>>>/pol/
>>
>>61504912
Going through Land of Lisp now. Fun little book.

I did get sidetracked downloading and configuring Emacs + Slime though.

Lisp is cool.
>>
File: happy.jpg (41KB, 394x353px) Image search: [Google]
happy.jpg
41KB, 394x353px
>>61504912
Thank you for anime picture. Ruby is the /comfiest/ language ever.
>>
>>61504965
>>61504968
Namespaces don't avoid collisions either and lead to unreadable name wrangling in object code. If you're going to write a library or an API you should prefix with your project's name, see for example the OpenGL specification.
>>
>>61504980
https://en.wikipedia.org/wiki/Z3_(computer)
>>
>>61504981
Are you telling me to go to /pol/ because I'm Jewish? I'm sure I'm not the only Jew here. Thanks for the concern, sweetie, but non-Jews need to be less triggered on our behalf. It's embarrassing.
>>
>>61505037
>I'm sure I'm not the only Jew here
Stop LARPing.
>>
>Make the true modern successor to C++
>Good language design, good compiler and everything
>Make shitty GC
>Stick to shitty GC

I'm dropping D for good, seems like (((Rust))) is the only sane option left.
>>
>>61504912
I want her to massage my prostate with her tongue.

>>61504965
In C starting things with _Uppercase and __ is UB.
>>
>>61505047
>There are no Jews in /g/
>>
>>61505058
>the true modern successor to C++
C++
>>
>>61505070
There is nothing modern about C++
Enjoy writing 37 header files and all those C preprocessor autism
>>
>>61505068
>I'm a cute Jewish girl
>>
im working on something
I cannot tell you
>>
>>61505082
>I'm gay
>>
>be 35 and stuck in shitty paper-pusher assistant-type job
>degree in accounting but absolutely no interest in it
>hobby programming all my life; mostly personal projects to simplify life on my server with bash, c, perl, python
>need a job that involves programming

is it too late for me to change paths or am i doomed to life of shit? what is the best way to get started and what languages to pick up? i've tried so many different languages that it wouldn't be difficult to learn anything at this point.
>>
Daily reminder that if you can't program in asm and C you should leave because you're not a real programmer, just a chimpy bashing rocks together in the hopes of something good happening
>>
>>61505121
What is a "real programmer"?
>>
>>61505058
I never understood the point of D. To be it seems like a rebranded C++ with a garbage collector. At least Rust has some unique features.
>>
>>61505121
Real programmers write LISP.
>>
>>61505124
the one that programs in low level languages only
>>
>>61505124
A programmer with an IQ over 130, i.e. not subhuman and capable of writing substantial efficient and correct programs
>>
>>61505155
>capable of writing substantial efficient and correct programs
So only Coq programmers?
>>
>>61505061
>In C starting things with _Uppercase and __ is UB.
No it's not but _Uppercase is reserved for the standard so you might somewhere in the future have no collision with them.
>>
>>61505136
It's C++ with cleaner syntax and a garbage collector nobody asked for.
C++ with cleaner syntax is definitely something I could go for thouggh.
>>
File: baka.jpg (7KB, 225x225px) Image search: [Google]
baka.jpg
7KB, 225x225px
who drunk programming here?
>>
>>61504980
>Jewish
>Cute
Back into the oven
>>
programming languages are supposed to make programmers' lives easier, so why stick with C over Rust when C makes it harder to write safe and sane code?
>>
>>61504924
Where are you up to now anon?
>>
>>61505192
>so why stick with C over Rust
Why stick to Rust over Idris?
Checkmate mozdrones.
>>
>>61505192
Why use C over Java when C makes it harder to write safe and sane code?
>>
>>61505192
Rust makes it harder to produce just about anything.
t. don't like C/C++ myself
>>
>>61505201
>Idris
Good way to go on vacation each time you need to rebuild anything.
>>
>>61505201
Academic bullcrap, not meant to be used
>>61505205
Rust is not a VM language
>>61505211
This
>>
>>61505166
No, he's actually right. They specifically call it UB.
>>
>>61505211
this desu
>>
>>61505201
>>61505205
>>61505211
samefag
>>
>>61505169
I'm not sure if you'd like Rust. Its syntax isn't exactly clean. Personally I don't care about that.
>>
>>61505239
Rust seems more sanely designed at the very least.
>>
>>61505149
>the one that programs in low level languages only
Can you tell me your favourite low level language?
>>
>>61505149
Reminder every programming language, even assembly languages, are pure abstraction.
>>
>>61505201
programming languages are supposed to make programmers' lives easier, so why use complicated languages like Haskell or Idris?
>>61505205
>>61505211
there is a time and a place for any language, Rust and Java have their own
>>61505239
example? the only weird syntax feature of Rust I can think of is the closure syntax copied from Ruby but fucked about for some reason
>>
>>61505166
Wrong, see ISO 9899:2011 or 9899:1999 at 7.1.3.1
>>
>>61505275
>complicated languages like Haskell or Idris
This merely confirms that Rustlets = brainlets.
>>
>>61505275
::<<shit> |_|>mut & shit
>>
>>61505284
Both languages are autistic
>>
>>61505293
absolutely beatiful and sane usage of different symbols to create readable code.
>>
>>61505149
>I took one community college course in C
>Look at me everyone, I'm hot shit
>>
>>61505254
It does, that's why I'm learning it right now. Some cool features are:
-immutability by default
-Result/Some type
>>61505275
>example? the only weird syntax feature of Rust I can think of is the closure syntax copied from Ruby but fucked about for some reason
https://doc.rust-lang.org/std/io/trait.Read.html#examples
It's not bad, but it doesn't look very sexy to me.
>>
>>61505303
|_|
absolutely disgusting
>>
>>61505293
none of those combinations appear in Rust. I think perhaps you are confused about the generics syntax, which is the same as C++, C# and Java, and the closure syntax I mentioned
>>61505311
looks no worse than Python to me, although that is just a bare code segment
>>61505317
in Rust the bare underscore is the empty pattern, throwing away anything that is assigned to it. you can use patterns in a closure or functions arguments, which is where that is used:
let _ = 1 // throw away the rvalue
let f = |_| -> { "gone" } // throw away the first argument
>>
>>61505362
>looks no worse than Python to me, although that is just a bare code segment
Rust has more 'noise' like :: {} ; &
Python is on the extreme levels of comfy
>>
File: 1423636424856.gif (1MB, 460x460px) Image search: [Google]
1423636424856.gif
1MB, 460x460px
I'm slowly learning C++ from stroustrup's book, is there any rizon channel if i want to ask some really stupid and basic questions?
>>
>>61505403
here?
>>
>>61505403
what algo is that
>>
>>61505429
I just assumed this thread was for super advanced stuff
>>
File: Screen 2017-07-22 15-07-55.png (65KB, 1720x1074px) Image search: [Google]
Screen 2017-07-22 15-07-55.png
65KB, 1720x1074px
Set up ELK stack in a VM to manage my finances

Good for a quick overview, but lacks some crucial features like plotting the cumulative sum or grouping items into custom categories (or maybe it doas, but i havent found them yet).

any recommendations for a similar software? Otherwise i go back to my custom python script that does the same for practical purposes but in <1k lines of code
>>
>>61505446
>super advanced stuff
...
...
AHAHAHAHAHAHAHAHAHAHAHAHAH
>>
>>61505403
there is a #c on rizon, i believe there might be a #cplusplus iirc
/list is your friend. also, of course, look on freenode
>>61505446
nah it's just the haskell posters
>>
>>61505446
no one programs here
>>
>>61505446
Most of the posters here are fucking stupid. But as a sepplesfags, you're just going to be lowering that bar further.
>>
>>61505446
helping newbies with basic c++ questions is more interesting to me than language war #2324
>>
>>61505463
>C++
Don't encourage people to post that garbage here.
>>
>>61505434
Fettuccine's algorithm
>>
>>61505169
It's a shame there's no C-like language with the sane modern features and with as little changes and additions to syntax as possible. Everything out there just ads 100 "modern features", each with it's own unique syntax.
>>
>>61505478
this
>>
>>61505495
Alfredo?
>>
>>61505478
>>61505507
>>>/v/
>>
>>61505500
D was perfectly poised to do that, but they fumbled it.
>>
>>61505275

>programming languages are supposed to make programmers' lives easier

Easier, but not so easy.
Easy languages = More pajeets and SJW
>>
>>61505517
>>>/mlp/
>>
>>61505495
I can't find anything about the algorithm, it's all macaroni
>>
What'st he difference between threads and processes apart from sharing the same address space?
>>
>>61505463
I just laughed and choked on my drink because your post made me realise that literally every thread--and there have been hundreds of threads--is 90% people insulting each other's languages without any justification whatsoever and ay least 2% anime posting
>>
>>61505545
that's it
>>
>>61505545
4chan is a process, you're in a 4chan thread
>>
>>61505547
Choke to death, rustfag
>>
>>61505556
I thought so, thanks.
>>
>>61505537
thanks for your highly constructive contribution to this thread
>>
File: 1425676060381.png (24KB, 399x480px) Image search: [Google]
1425676060381.png
24KB, 399x480px
>>61505463
Okay, so im just confused with something here

 for (int i = 0;i < words.size();++i)
if (i == 0 || words[i - 1] != words[i])


It reads vector.words and doesn't display repeat words. What does [i-1] specifically do? And how would i go about modifying this if i wanted to censor another word, making it announce it like "***"?
>>
>>61505561
the thread never blocks?
>>
Notice how Rustposters mostly shill their languages without showing anything they've built?
>>
>>61505563
[spoiler]I'm a Pythonfag[/spoiler]
>>
c or c++?

I want to start my first language with the most useful one i guess
>>
>>61505545
Threads share pid, open file descriptors, and maybe some other things.
>>
>>61505586
Starting with C++ will be painful because you'll probably get confused and mess things up.
>>
>>61505577
they also appear around midnight in Europe
>>
>>61505586
neither
>>
>>61505601
full moon in Germany, Mozzilla HQ
>>
>>61505577
I'm still learning...
>>
>>61505586
a scripting language like Python will be most useful to you, but learn C before C++
>>61505601
yank posting hours on /dpt/ are insufferable
>>
>>61505606
so its better to learn a easy language such as java , git gud at it and then lean c/c++?
>>
>>61505569
That for loop repeatedly executes the next statement, setting i to be 0, 1, 2... all the way up to words.size() - 1.
words[i] gets the ith word from words. words[i-1] gets the (i-1)th word. AKA, it gets the previous word.
So it's checking if the previous word is different to the current word.
>>
>>61505577
Notice how Rustposter's only justification for using the language is >muh safety
>>
File: Sexy phoenix green.jpg (138KB, 1440x810px) Image search: [Google]
Sexy phoenix green.jpg
138KB, 1440x810px
>>61504912
programming an ILC
>>
>>61505630
yes
Java > C > C++ is a good path
>>
>>61505186
hila is cute :3
>>
>>61505586
Start with C. Not because it is more useful (I'll avoid THAT argument), but because C++ is like a Nazi with jewish ancestors, who desperately wants hide all the jewishness that's inside, but keeps failing. C is simple and consistent language, if you'll then want to learn C++, knowing C will make it much easier for you.
>>
Anyone Hacking/Android experience willing to help me out?
>>61505590
Much appreciated
>>
>>61505630
This could work. Java is quite complex though. Some imperative language like Pascal would be best.
>>
>>61505661
Java is the bare minimum you need to understand OOP, which like it or not is expected off any programmer today
>>
>>61505658
post a pic of her
>>
>>61505658
Ik zou je kunnen helpen...
Ik wil eerst zien of zij mijn tijd waard is.
>>
>>61505682
dutch is such a pretty language
>>
>>61505687
dat zei je moeder ook tegen mij :^)
>>
what version of visual c++ express should i install for learning c++? is 2015 good?
>>
>>61505586
x86 Assembly -> C -> Scheme -> C++ -> Haskell -> Whatever poo-poo language you need for a given job (if that's your objective; I'm more inclined to NEETdom, personally, but I know that isn't an option for most neurotypicals), e.g. Java, Python, C#

Also make sure you read 'Structure and Interpretation of Computer Programs', 'The Art of Computer Programming' and 'Introduction to Algorithms' or you'll be doomed to Pajeethood forever. If you struggle with those books, then you know you're too much of a brainlet to program.
>>
>>61505638
Thanks, i get it now more or less,ill go and play around with it a bit
>>
>>61504912
>Python
>Most recommended language when asked about scraping and scripting

Why?
>>
>>61505678
>>61505682

I don't trust random internet strangers with pictures of girls I actually care for. But I want your guys help so fucking much. Can give you a random of my room, dick or whatever.
Please I have programming experience, I don't expect you guys to do everything just show me where to look.
>>
>>61505748
Blur haar gezicht dan, pannekoek.
>>
>>61505718
>Introduction to Algorithms
First 100 or more pages are about fucking sorting algorithms
>>
>>61505630
no. a good first programming language is a pl that is both simple and powerful at abstraction. such PLs are lisp, python, ring, ...
>>
>>61505718
>Structure and Interpretation of Computer Programs', 'The Art of Computer Programming' and 'Introduction to Algorithms'

So as a prerequisite, i should go through these 3 books before i even touch a language? or read these as i learn a language?
>>
>>61505590
Have you tried killing yourself?
>>
>>61505718
>x86 Assembly
kek. k tard.
>>
File: kodewithkhar.png (15KB, 432x274px) Image search: [Google]
kodewithkhar.png
15KB, 432x274px
I'm working on my first distributed C application, which uses UNIX servers and Windows clients.

I'm using utf-8 characters for the communication strings between client and server. I was wondering: is it better to use the standard C char type, or to explicitly use the uint8_t so that I'm sure it's the same length on both Windows and L00nix? Cause I'm afraid that char on Windows may be defined as 16-bit instead of 8.
>>
>>61505783
Those books are for becoming a good programmer, not beginning programming.
>>
>>61505687
Ik heb je moeder geneukt flikker
>>
>>61505657
I'm also looking to learn C, and then C++. My perspective is that of somebody who's been programming in python, c# and some javascript for roughly the past 15 years. Do you have any recommendations on books, articles or other resources that either stood the test of time or are just "modern" ? I'm looking for resources that not only explain how stuff works, but also give some insight into when it's a good idea to use language feature x and when not (for the more advanced C++ stuff).
>>
>>61505783
He's memeing. Sicp teaches you Lisp, The Art of Computer Programming uses assembly and Introduction to computer programming only uses pseudo code. Just learn Python and call it a day.
Also this >>61505799
>>
>>61505814

well thanks /g/ guess i'll get started with python
>>
>>61505795
I don't think you're supposed to be setting errno yourself.
>>
>>61505721
>Shit-tier state universities and CCs use Python to teach programming to Zuckerberg wannabes
>"Alumni" of these institutions ('alumni' literally means 'nourished' but these plebs haven't been nourished intellectually so it's a misnomer) never learn superior languages and believe they're qualified to recommend languages even though most are incapable of fizz buzz and work for close to minimum wage writing janky web apps
>>
>>61505657
loving your posts so far mate
>>61505716
2017 Community
>>
>>61505838
kek
So what should I use for scraping and scripting? Mostly a noob know a few things here and there
>>
>>61505832
If you want to start writing cool stuff, give the book 'Automate The Boring Stuff' a try.
>>
>>61505860
still Python, but don't stop learning
>>
>>61505860
I meant that post as a joke and am myself unqualified to answer that question. I don't want to mislead you if you're a newb, so please ignore me.
>>
>>61505650
Why the AK amerifat?
>>
>>61505887
Thanks senpai
>>61505891
O
well thanks for the kek
>>
File: ILC.png (395KB, 1004x916px) Image search: [Google]
ILC.png
395KB, 1004x916px
>>61505894
/K/ Posting on the side my bad
>>
Is there a program that will visually illustrate the evaluation of simple snippets of Scheme?
Just stepping through the evaluation process one action at a time.
>>
>>61505935
Are tou a terrorist? Only terrorists can buy AK-47s.
>>
File: Photo Blur_Jul222017_162815.jpg (247KB, 740x740px) Image search: [Google]
Photo Blur_Jul222017_162815.jpg
247KB, 740x740px
>>61505774
Sorry dat het zo lang duurde, guess welke van de twee ze is?
>>
>>61505976
Helaas geen EXIF data. Slimme jongen...
Push messages liker Amber alert are baked into the OS. You don't have access to it.
Assuming you have access to her phone, you can make an app that isn't listed in her app drawer. My take on it: make a background service that listens to a web API using web sockets or long polling. You can send messages to connected clients using the web API.
>>
>>61505835
Why not? If you're making a library that can return some error it's actually a pretty standard way to return errors. I may implement a custom error variable in the future though.
>>
Anyone here who
>Doesn't have a bachelor's in math or physics or a PhD in some other STEM subject
>Isn't familar with asm, C, Lisp and Haskell and hasn't undertaken substantial projects in these languages
>Hasn't read SICP and The Art of Computer Programming
should leave. /dpt/ is for gifted programmers, not for babysitting idiots who shit up threads talking about flavour of the month languages like Go, D and Rust or brainlet languages like Java and Python. I'm honestly surprised that these people can operate a web browser if they struggle to write programs in assembly.
>>
File: Koka Kola Wünderbar.jpg (61KB, 540x960px) Image search: [Google]
Koka Kola Wünderbar.jpg
61KB, 540x960px
>>61505974
Maybe in third world countries
>>
>>61506051
If you'd like to, I can help you out with the app and the web API. I'm a near senior Android developer after all.
I'll be gone in 30 minutes, so respond quickly.
>>
File: Magic_the_gathering-card_back.jpg (52KB, 300x416px) Image search: [Google]
Magic_the_gathering-card_back.jpg
52KB, 300x416px
>>61506134
Ooow yeeess, the universe is with me today. Please do I will be forever grateful. Also post with source, I'm not gonna trust random exploitive code.
>>
>>61505804
I took a uni course, so I would know about books (though people still keep recommending K&R). Looking at source of existing C programs can also help to learn some standard practices, if you avoid shittily written stuff. But having someone who can always look at your code and point out what you're doing wrong is always best. ##c on freenode is pretty chill channel, I'd definitely head there. Also I hope you plan to learn C on some unix.
>>
>scala brainlet thinks FP is too complicated because Scala FP is abysmal
>unironically praises exceptions

/dpt/ be thankful you never ended up like these sub-humans.
>>
>>61506167
Contact me at: [email protected].
I'm not asking any money for it, but a shitty anime figurine would be nice.
I can get you a POC upcoming tuesday.
>>
>>61506223
I'm off, just send me mail (in Dutch).
>>
>>61506192
What's the context behind this?
>>
>>61506512
https://youtu.be/qBU7u1Qa1fo?t=1m30s
>>
>>61506544
>scala
>>
>>61506544
30s in and I already dislike this talk
>>
>>61506577
I doubt ill finish it desu, hes pretty obnoxious and whiny, the exceptions point is in another minute though.
>>
>>61506597
>"I have no patience for this!"
>proceeds to show a much lengthier and convoluted sample of code
>all because apparently Option is hard
what the fuck man
>>
>>61506631
I'm hoping this is just an elaborate troll
>>
>>61506631
Scala people are truly demented.
If you havent seen it already, https://www.youtube.com/watch?v=4jh94gowim0 is a nice rant about all the bullshit of scala and its core team.
>>
>>61506659
Poor Paul. I've seen what years of working on the compiler did to him.

But it's all gonna get cleaned up in Scala 3, especially with proposals like this: https://github.com/lampepfl/dotty/issues/2491
>>
>In computational complexity theory, a numeric algorithm runs in pseudo-polynomial time if its running time is polynomial in the numeric value of the input, but is exponential in the length of the input – the number of bits required to represent it.

Is this still a fast algorithm? For instance, printing numbers from 1 to N is technically exponential when considering runtime as a function of the length of the input in bits, but it only takes 5 bits to represent the integer 16. In that sense, it may be exponential but is practically linear as far as we are concerned as pragmatically-minded problem solvers.
>>
>>61506697
>Consider syntax with significant indentation
fucking hell
>>
>>61505795
bump
>>
>>61506715
Posting anything non-FizzBuzz related is outside of most of /dpt/'s knowledge, you'll have to wait some more. Same for >>61504937
>>
>>61506766
>>>/vg/agdg might be a better place for those questions
>>
>>61506766
Are there any decent, relatively busy programming chatrooms you know of? Most of the ones I know are very beginner-oriented, or as you noted about this general, filled with posturing.
>>
>>61506790
My question >>61505795 is not about a fucking videogame
>>
>>61506832
I was hinting that there is more programming knowledge in that thread than in this thread
>>
>>61504937
It can make a difference? What the fuck? I've always put mine at the top because I assumed it would be better.
>SIMD
Are you suggesting that several fragments are computed at the same time on the same GPU core? Interesting...

I wonder how branching would work though.
>>
>>61505795
>I'm afraid that char on Windows may be defined as 16-bit

That's why wchar types exist in the first place.
You don't just change the base unit size because of wanting to use different encoding methods for characters.

An example of this would be java, where chars are 16-bit unicode codepoints, but you still have 8-bit bytes for buffers etc.

Generally in C you use the char type because you want 2 things:
1) A type that is big enough to contain AT LEAST 8 bits of information (actually any type will do this, unless you use bit fields)
2) A type that isn't oversized for it's purpose, or has stupid alignment causing things to slow down for large arrays

You don't NEED a type that is exactly 8 bits, you just want one that's at least 8 bits, so char fits your requirement perfectly.
Also, if char is 16-bit or higher for whatever reason, you still probably want to use that and NOT use uint8_t because of reason (2) above.
If char (the base unit) isn't 8 bits, then forcing the compiler to work with 8 bits is not going to be free. You're better off wasting a bit of memory for the sake of avoiding the speed and complexity penalty.
>>
Came up with an idea like 5 minutes ago -- would it be possible to create a mesh network where only socket connections are allowed? For example, joining the network requires you to establish a persistent connection with your peer(s), and so on.

I understand this would be horrible inefficient, and I'm not sure how a socket relay mechanism would work (so it might be everybody <--> everybody), just curious.
>>
Lets say I want to learn Java, how good my machinations has to be?

My current machine is a laptop that is more like a glorified toaster

Intel celeron 2.16ghz

4gb ram

Win10

Can I properly learn Java in this machine? I've read that Java is very resource hungry and I don't know if I can do it on my machine
>>
>>61506927
You should be good to go, as long as you stick with 60-bit Java instead of 64-bit
>>
>>61506867
You presented very good points, problem is: apart from the fact that MSDN states both char and wchar are utf-16 in Windows, while using generic chars may be faster on the client, when it sends them to the Loonix server, the server will have to work with the Windows definition of chars and then lose performances, losing the point of using that. Plus, since Windows chars are UTF-16, and L00nix chars are ASCII, what if the client sent for some reason something outside the ASCII range?

And why should uint8_t be oversized if it's the minimum size possible for a char? Or, if that was what you meant, why should it have worse alignment than a generic char?
>>
File: 1497234238855.jpg (54KB, 900x421px) Image search: [Google]
1497234238855.jpg
54KB, 900x421px
How does one create an app in linux?
>>
>>61506927
You can do Java just fine if it's not Android development.
>>
>>61507083
gcc main.c
>>
This is why you should use Python:

https://www.youtube.com/watch?v=uqsZa36Io2M
>>
>>61507188
I got one better
https://www.youtube.com/watch?v=i6Fr65PFqfk
>>
>>61507083
make
make install
>>
Anyone has any experience here in integrating CEF with an existing OpenGL program? Any must-read material for it?
>>
I only feel comfortable programming in C and Perl.

Am I dumb?
>>
>>61506927
Java itself is not resource hungry, but the IDEs most people use are (Eclipse, NetBeans, IntelliJ). But you don't need an IDE to learn Java, in fact I'd recommend against using an IDE while learning a language.
>>
>>61507330
No.

Yer a wizard, Harry
>>
File: Captura.png (14KB, 578x328px) Image search: [Google]
Captura.png
14KB, 578x328px
>>61507007
>apart from the fact that MSDN states both char and wchar are utf-16 in Windows
They aren't, I don't know where have you read that. char is 8 bits in Windows too (and everywhere I'd say).
>>
Okay, g.
 for (type i = beg; i != end; expression) 

OR
 for (type i = beg; i < end; expression) 
>>
>>61507423
for (type i = beg; expression)
>>
>>61507423
For loops are deprecated.
Please don't use them in real code.
>>
>>61507423
< for number based ranges
!= for stl iterators
>>
>>61507423
for (auto &&x : container)
>>
>>61507358
I use NetBeans on an old Dell Inspiron with a Pentium dual core and 4gb ram and I get by just fine. Initial startup is a bit choppy but no slowdowns during actual work.

While I'm on the subject: how's Eclipse compare to Netbeans? I'm trying to get familiar with as many IDEs as I can.
>>
>>61507423
Why would you ever use the more general case when you have a more specific one?

Suppose you unrolled your loop and forgot you used != due to some retarded fancy instead of <. Now your program fucking hangs because you used != like a supreme dumb fuck.
>>
before: https://github.com/chiru-no/cloveros/blob/ac1ea0298e66f4e363b2a6f3323c5f93527c9136/home/user/stats.sh

after: https://github.com/chiru-no/cloveros/blob/master/home/user/stats.sh

im ready to port my slow piece of shit to a language that isnt bash now
>>
>>61505795
>I was wondering: is it better to use the standard C char type, or to explicitly use the uint8_t so that I'm sure it's the same length on both Windows and L00nix?
If you're passing strings, use char if you don't want a bunch of annoying casts.
>>
>>61507423
foreach(t; thing)
>>
>>61507375
cringe

>>61507408
char is (was?) 16 bit on windows for embedded systems or whatever it was called.>>61507007
>and L00nix chars are ASCII
utf8 is not ascii

>what if the client sent for some reason something outside the ASCII range?
It would be handled incorrectly as two chars

>And why should uint8_t be oversized if it's the minimum size possible for a char? Or, if that was what you meant, why should it have worse alignment than a generic char?
If CHAR_BIT != 8 then [u]int8_t does not exist at all.
>>
>>61506813
##c on freenode, #c on rizon
>>
>>61507801
>char is (was?) 16 bit on windows for embedded systems or whatever it was called
again, it isn't.
>>
>>61507801
>L00nix
I don't understand why you keep typing it like this, the correct spelling is shorter.
>>
File: tfw.jpg (68KB, 700x700px) Image search: [Google]
tfw.jpg
68KB, 700x700px
>fell for project euler meme
>get """addicted""" to solving those problems
>not even past the first 50 problems
>struggle to solve some of them without pure bruteforce
>tfw you're a brainlet
>>
>>61507836
Surely they're useless? Why not do something more practical?
>>
>>61507836
Euler is just interview problems.
They dont really test programming skills, just math.
>>
>>61505795
>>61507007
>>61507801
char has always been a signed 8-bit int, but you should still use uint8_t because it's good practice and reduces ambiguity. while you're at it read this: http://utf8everywhere.org/
tl;dr: for windows, use utf-8 everywhere, define UNICODE, use W variants of windows API calls and convert from utf-8 to utf-16 and back (and use L"" string literals)
>>
>>61507855
>They dont really test programming skills, just math.
But math is awesome. I like math. It teaches you a lot imo.
>>61507848
But they are fun? People flurish when they excercise virtue, right?

https://www.youtube.com/watch?v=94zscdXX7CA
>>
>>61507897
>People flurish when they excercise virtue
what
>>
>>61507817
https://stackoverflow.com/a/5516161/8248969 seems to disagree with you

>>61507834
Why the hell are you replying to me? I am just quoting someone.
What's with all the braindead people in /g/ lately?

>>61507869
>char has always been a signed 8-bit int
I see two things that do not agree with the standard here.

>but you should still use uint8_t
uint8_t is unportable and it is not guaranteed to exist on every system.
In most cases you do not need to use a type of an exact size, only a type that is at least of a size.

>tl;dr: for windows, use utf-8 everywhere
For windows, kill yourself.
>>
File: 1478721921073.png (618KB, 1024x576px) Image search: [Google]
1478721921073.png
618KB, 1024x576px
>>61507836
Always do them with brute force first unless a clean/elegant solution pops into your mind. Anything else is premature optimization.

The best development cycle is
>get it done
>get it done right
>get it done well

If you go out of order, you're in for a rough time.
>>
>>61507897
>It teaches you a lot imo.
Euler isnt even interesting math though. Its just a dull tedium of just chaining together functions anyone would dread implementing themselves.
>>
Should you charge more for Windows builds of your programs?
>>
>>61507908
>what
flourish******* LOL XD

((( sorry english is not my mother tongue )))
>>
>>61507920
>>get it done
>>get it done right
These are the same thing, if it's wrong then it's not done

>>61507934
Wasn't talking about the typo.

There are many virtuous people who do not flourish.
>>
>>61507928
Yes

GNU/Linux builds should be free as in freedom however.
>>
>>61507911
>uint8_t is unportable
inttypes.h and stdint.h is C99. if your platform doesn't support C99 or even just those headers then you should consider not bothering. there are also types defined for the case you mentioned i.e uint_least8 and uint_fastest8
>>
>>61507934
me turk, me no speak well, me pee in your doorstep
>>
>>61507953
What about a license for GNU/Linux builds that allows you to modify the source code for your own use, but not to share it?
>>
>>61507920
Well I do this.
I am currently at problem pic related.
Wrote some code and it is running for a few minutes now. Apperently trying 10^9 numbers if they are pandigital takes quite some time.
I know that there are LOTS of numbers which I could skip, but I dont know how.

here is my kode. pls don laff:
#include <stdio.h>
#include <math.h>
#include "util.c"

#define START 1000000000
#define END 10000000000

int is_pandigital(uint64_t num);
int get_digits(uint64_t num, uint64_t n, uint64_t m);
int check(uint64_t num);

int divisors[] = {2, 3, 5, 7, 11, 13, 17};

int main()
{
uint64_t number = 1406357289;

printf("is_pandigital(1406357289): %d\n", is_pandigital(number));
printf("%d\n", check(number));

uint64_t sum = 0;

for(uint64_t n = START; n < END; n++) {
if(is_pandigital(n)) {
if(check(n)) {
sum += n;
}
}
}

printf("sum: %lu\n", sum);
return 0;
}


int is_pandigital(uint64_t num)
{
int len = log10(num)+1;
uint64_t* has_num = new_arr(len);

while(num > 0) {
int rem = num%10;
if(has_num[rem] == 0)
has_num[rem] = 1;
else {
free(has_num);
return 0;
}
num /= 10;
}
for(int i=0; i < len; i++) {
if(has_num[i] == 0) {
free(has_num);
return 0;
}
}
free(has_num);
return 1;
}

int get_digits(uint64_t num, uint64_t n, uint64_t count)
{
n = log10(num)+2 - n;
return (num / pow_10(n-count+1)) % pow_10(count+1);
}

int check(uint64_t num)
{
for(int i=2; i <= 8; i++) {
uint64_t tmp = get_digits(num, i, 3);
if(tmp%divisors[i-2] != 0)
return 0;
}
return 1;
}

>>
>>61507946
I look at the difference between "done" and "done right" as the difference between something that's hacky and will probably explode if you look at it wrong versus something that's reasonably robust and can handle edge cases.

"Get it done" is a rough proof of concept. "Get it done right" is deliverable. "Get it done well" is maintainable.
>>
>>61507955
>inttypes.h
Irrelevant to the discussion.

>stdint.h
Also irrelevant to the discussion. We are only talking about the exact width integer types defined in stdint.h, these are considered optional by the standard both in C99 and in C11.

>uint_least8
uint_least8_t (not optional)
Sadly this is not the same as uint8_t (which was what you were suggesting, in fact this could probably be replaced with unsigned char for most uses)

>uint_fastest8
uint_fast8_t
Same as above
>>
>>61504912
Neet-ing with C++. Today I learn about constexpr constructors!

#include <array>

struct Base {
constexpr Base(int a, char b) : a(a), b(b) {}
int a;
char b;
};

struct Der : Base {
constexpr Der(int a, char b) : Base(a, b) {}
};

int main()
{
std::array<int, Der(42,'x').a> arr; //
return arr.size();
}
>>
>>61507969
Cancer and not practically enforceable.

>that allows you to modify the source code for your own use
Most countries already allow that, no matter what your EULA says.
>>
>>61508011
Seems cancerous
>>
>>61508011
>Second template argument of a std::array is an object
I don't get it
>>
>>61507985
Are you sure that's going to terminate? Just glancing at it, you might have an infinite loop. If you're just dividing num by 10, then it will never be less than 0 in that while loop, right? Or am I missing something?
>>
>>61508077
What part of .a did you not get?
>>
>>61508081
Won't it become 0 someday? I mean it is an integer.
>>
What are the best languages in their respective fields, anons?

>robust backends
Haskell, Java

>quick and dirty prototyping
Lisps

>gotta go fast
C++
>>
>>61508101
Oh shit, that went over my head. Sorry senpai.
>>
>>61506867
>if char is 16-bit or higher for whatever reason, you still probably want to use that and NOT use uint8_t
uint8_t wouldn't even exist
>>
>>61508081
That does work. Used it on a few prior problems with pandigitals.
No it just takes hell a lot of time. Added a few printfs and it seems to work, BUT I am a retarded monkey nigger and forgot that it is pretty niggerlicious to check EVERY number between 10^9 an 10^10. I just have to check every permutation of 0123456789.
So just gotta write a function to get the next permutation. If I am not mistaken I already have one in a previous problem.
>>
#define class struct
#define private public
#define protected public

Give me one good reason not to do this.
>>
>>61508110
>>quick and dirty prototyping
Haskell
>>
>>61508106
I dunno, I don't feel like thinking that hard, and you have the code. Put some print statements in there to see if it is terminating. I could totally be wrong.
>>
>>61508022
>Cancer and not practically enforceable.
Most of the copyleft in GPL is not practically enforceable either.

>>61507985
Which euler problem is this? I'm not exactly sure what get_digits is supposed to do.
>>
>>61508130
Maybe it's time to stop using C++.
>>
>>61507801
>>61507408

I was confused as I saw the page for the System Chars, that are UTF-16 for kernel's internal usage, now it's clear.

Anyway, what's the point of values like uint8_t if it's not defined unless char is already an 8 bit character?
>>
>>61508144
>Most of the copyleft in GPL is not practically enforceable either.
In china maybe.
>>
>>61508130
undefined behavior
>>
>>61508164
why
>>
>>61508125
Look up sprintf and use https://en.wikipedia.org/wiki/Heap%27s_algorithm
>>
>>61508154
it's for muh ocd
>>
File: asd.png (51KB, 1027x402px) Image search: [Google]
asd.png
51KB, 1027x402px
>>61508144
>Which euler problem is this? I'm not exactly sure what get_digits is supposed to do.
oh lel, forgot to post the pic, obviously.
>>
>>61508156
Yeah, good fucking like finding stolen gpl code in a 1M LOC application that has been compiled and is only sold to the government.

I'm sure you can find all that stolen gpl in lockheed martin's f35 firmware.
>>
>>61508132
>(define (dyel) (display "Do you even Lisp?"))
>(dyel)
Do you even Lisp?
>>
>>61508180
thanks.
>>
>>61508125
Ah, so there you go! Once you have a shitty barely functional solution, turning it into a proper solution is much easier than it would be if you tried for a proper solution on the first try, isn't it?

One of the most important lessons for software engineers to learn is when to write shitty code. Not everything worth doing is worth doing well.
>>
>>61508178
because the standard says so
>>
>>61508220
>the standard says you can't write #defines

what
>>
>>61508122
If you have millions of values in the range 0-255, uint8_t makes sense to save space.

If you are running arithmetic or otherwise modifying the values of a relatively small set of numbers, and the top-limit doesn't really matter (i.e. you don't rely on defined overflow) then it's usually (but not always) faster to use the base unit type rather than fixed size types, because the compiler will probably have to unpack your smaller type from a larger block size.

Since overusing memory only tends to slow things down when you exceed your physical RAM but inefficient ops will slow things down immediately, I generally prefer to save time at the expense of memory.
>>
>>61508236
you can't write #defines for language keywords, no
>>
>>61508250
it's undef behaviour but it works tho
>>
>>61508266
On your machine, maybe
>>
>>61508277
what machine doesn't allow #defines?
>>
>>61508250
Preprocessor switching one token for another is perfectly well defined.
It would only be difficult if you had chained macros, so if private maps to protected and protected mapped to public or something equally stupid.
>>
>>61508244
>I'm a fucking retard: the post
good to know
>>
>>61508304
not an argument, bucko
>>
>>61508299
>perfectly well defined
except for keywords
>>
>>61508321
It's a basic search and replace, no arguments involved.

Projects use keyword-swapping macros all the time to enable proper cross-platform support when exporting functions in libraries.
Undefined behaviour isn't undefined if it does what you want on every platform you are targeting.
>>
>>61508381
sure
>>
>>61508110
>>robust backends
>Haskel
stopped reading right there
>>
File: nice.png (42KB, 477x292px) Image search: [Google]
nice.png
42KB, 477x292px
I did it!
Thanks to everyone helping. I didnt even need the is_pandigital() function in the end, because I was obviously only testing pandigitals. Just needed to check all permutations.

#include <stdio.h>
#include <math.h>
#include "util.c"

int get_digits(uint64_t num, uint64_t n, uint64_t m);
int check(uint64_t num);
void next_perm();
void arr_to_number();

int divisors[] = {2, 3, 5, 7, 11, 13, 17};
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
uint64_t number = 0;

int main()
{
uint64_t sum = 0;
arr_to_number();
while(number < 9876543210) {
if(check(number)) {
printf("found new: %lu\n", number);
sum += number;
}
next_perm();
arr_to_number();
}
//check last
if(check(number)) {
sum += number;
}
printf("sum: %lu\n", sum);
return 0;
}


int get_digits(uint64_t num, uint64_t n, uint64_t count)
{
n = log10(num)+2 - n;
return (num / pow_10(n-count+1)) % pow_10(count+1);
}

int check(uint64_t num)
{
for(int i=2; i <= 8; i++) {
uint64_t tmp = get_digits(num, i, 3);
if(tmp%divisors[i-2] != 0)
return 0;
}
return 1;
}

void next_perm()
{
char n = 9;
char i, j, k, l, r, tmp;
j = n-1;
while(arr[j] >= arr[j+1]) j--;
if(j > -1)
{
k = n;
while(arr[j] >= arr[k]) k--;
tmp = arr[j];
arr[j] = arr[k];
arr[k] = tmp;
l = j+1;
r = n;
while(l < r)
{
tmp = arr[l];
arr[l] = arr[r];
arr[r] = tmp;
l++;
r--;
}
}
}

void arr_to_number()
{
number = 0;
for(int i=0; i < 10; i++) {
number += arr[i]*pow_10(10-i);
}
}

>>
In C
How do I return a value from a sub-function to another sub-function, I don't want it to go back to the main.
>>
>>61508558
are nested functions in C even allowed? Or are you just a retarded troll?
>>
What good languages have coroutines/continuations?
>>
>>61508592
i'm not sure what nested functions are but I have multiple functions and i'm trying to return a specific one back to another specific one instead of it going back to the main
>>
I am implementing a DFA attack on AES as a homework right now.
Having major problems because the identified partial key candidates fail when validating against a second trace. any ideas?
>>
>>61508631
What are the two functions?
>>
>>61508631
function1(function2())

Like that?
>>
File: Untitled.jpg (303KB, 1893x967px) Image search: [Google]
Untitled.jpg
303KB, 1893x967px
I understand boolean logic, and multiplexers, but not in the context of a memory organization problem. I loosely understand paging.
What would be a good book I could read that would help me to answer pic related?
>>
>>61506710
In many cases it's considered fast, but not always. For cryptographic concerns, for example, we care much much more about the size of the bits of the keys we use than the size of the numbers themselves.
>>
File: test.png (34KB, 796x1023px) Image search: [Google]
test.png
34KB, 796x1023px
>>61508678
>>
File: 78.png (169KB, 318x308px) Image search: [Google]
78.png
169KB, 318x308px
>>61504912
>he cant' do a fizzBuzz
>he cant' do a bubblesort
>he cant' implenet Conways' game of Life
laffinggirls.tif
>>
>>61508791
Go learn switches.
>>
I got an final exam for C in my intro engineering/programming class. It's just over the second half of the C language which is about Arrays, Pointers, Strings, Local vs Global variables and other functions.
The test comprises of like 20 easy MC questions and 3 short answer questions where you write your own program to do a task the professor assigns over the topics I named above. What is the best method within a 4 day time frame to practice everything I know about the course? Should I equally devote each day to write code for hard projects that would take me a long time or should I do back-of-the-book exersizes that require writing code that could be done in 30 minutes each problem? Also and online references (videos for pointers in C would be nice if anyone on this board has used any)
>>
File: semen demon question.png (40KB, 467x400px) Image search: [Google]
semen demon question.png
40KB, 467x400px
What's the difference between int a[1][2] and int a[5]?
>>
>>61508860
I have, I use switches for Subfunction 2 and 3.
Just felt like its easier to use if/else in subfunction 1
>>
>>61508913
int a is 2 boxes
a.1 can hold two objects
a.2 can hold 3

int a2 is one box that can hold 6 objects.
>>
A program for calculating the current and power dissipation of a resistor when connected into a DC voltage source.
PROGRAM voltage2
IMPLICIT NONE

REAL, DIMENSION(-20:20) :: current
REAL :: resistance
INTEGER :: voltage
REAL :: power

PRINT *, 'Enter the resistance in ohms'
READ *, resistance

PRINT *, ' '
PRINT *, ' ', 'voltage', ' ', 'current', ' ', 'power'

DO voltage = -20, 20
current(voltage) = voltage/resistance
power = current(voltage)**2 * resistance
PRINT *, voltage, ' ', current(voltage), ' ', power

END DO

END PROGRAM voltage2
>>
>>61508913
3
>>
>>61508913
They're completely different. Why would you come to this conclusion?
>>
>>61508913
ar[1][2] is a multidimensional (2d array) and ar[5] is one dimensional.
>>
>>61508887
Literally read the good book (K&R) my dude. also read the bible you frickin heathen
>>
>>61508938
Are you the guy making the twitch robot or whatever?
>>
File: Untitled.png (26KB, 1914x934px) Image search: [Google]
Untitled.png
26KB, 1914x934px
>>61508937
>>61508942
I thought it was like this.
>>
>>61508938
Example output
>>
>>61509009
the cells for the first should be [o][o] and [o][1]

the other is [0] to [4]
>>
>>61509009
Top is a[2][3] and bottom is a[6].
>>
Whats the difference between building a C derivative lang and making a compiler that translates a different syntax into C code then compiles that?
>>
File: why would you.jpg (18KB, 292x302px) Image search: [Google]
why would you.jpg
18KB, 292x302px
>>61509037
But you start counting at 0 in C

>>61509033
What the fuck?
>>
>>61509113
You do. An array containing integers at 0, 1, 2, 3, 4, 5 has six elements, so it is declared as
int a[6]
>>
>>61507911
>https://stackoverflow.com/a/5516161/8248969
Well, let's read.
>They do not, however, treat a char as 16 bits -- instead they take the (non-conforming) approach of simply not supporting a type named char at all.
>>
>>61509125
So what's the difference between [2][3] and [6]?
>>
>>61508913
>using arrays at all
 int a0, a1, a2, a3, a4 a5 
>>
>>61509164
Now give each number a random value and sort. them.
>>
>>61509203
int *a[6] = {&a0,&a1,&a2,&a3,&a4,&a5};
>>
>>61509161
[0],[1] , [0],[1],[2]
[0],[1],[2],[3],[4],[5]
>>
>>61509230
no no, without arrays.
>>
File: 1497946111800.png (19KB, 160x186px) Image search: [Google]
1497946111800.png
19KB, 160x186px
>>61509203
 assign(a0, a1, a2, a3, a4, a5);
sort(a0, a1, a2, a3, a4, a5);

Done
Arent libraries fun?
>>
File: sakura question.gif (62KB, 260x200px) Image search: [Google]
sakura question.gif
62KB, 260x200px
>>61509236
So [2][3] isn't 2 arrays of 3 elements but 2 arrays with 2 and 3 elements?
>>
>>61504912

Does C++ have a special variant of va_list?

can I use function pointers to a function with va_list args ?
>>
>>61509267
[2],[3] is a 2-dimensional array.
think of it like this.

int a[2][3] can look like this:
[0],[1] 
[1]
[2]

It has one dimension with 2 blocks and a second with three blocks.

Now int a[6] is a 1 dimensional array:
[0],[1],[2],[3],[4],[5]


Maybe when you learn associative arrays it will make more sense.
>>
>>61509322
Though after posting i realize that it might be more confusing because [0] in the first and second block are /not/ the same block or value.
>>
File: arrays.png (3KB, 789x442px) Image search: [Google]
arrays.png
3KB, 789x442px
>>61509161

It's all to do with the way it's declared and pointer arithmetic.
int a[2][3];
int b[6];

Using the subscript operator [n] on a will move the pointer up by n*sizeof(int[3]) and give you an expression of type int[3].
If you use the subscript operator [m] on an expression like a[n], you will move the pointer again by m*sizeof(int) and get an expression of type int.

If you were to do something like a[6] then you would shoot right past the end of the array, because the first [] operator is counting in units of int[3] instead of units of int. Furthermore, you wouldn't be able to do anything useful with the result because it thinks its dealing with an int[3].
>>
>>61509261
your moms pussy is fun, you ((((feminine)))) cock sucking gay shit nigger
>>
Wait, this discussion made me wonder
Lets say I have a[2][1] and b[5][5][5]
Can I change a[0] to point to b[0]
>>
>>61509267
>>61509322
but yes youre correct and i need to go to bed
>>
>>61509377
pointers
>>
File: 1498003690218.jpg (168KB, 778x1024px) Image search: [Google]
1498003690218.jpg
168KB, 778x1024px
>>61509374
No need to be mean
>>
>>61504993
>Namespaces don't avoid collisions
>>
>Scala literally has an "Any" keyword that says any type can be used here no matter what
>its not even for generics

>right after you bitch about having no distinct types
Scala programmers are actually insane.
>>
File: two_dimensional_arrays[1].jpg (12KB, 427x125px) Image search: [Google]
two_dimensional_arrays[1].jpg
12KB, 427x125px
>>61509009
>>
File: transcoder (1).png (78KB, 256x256px) Image search: [Google]
transcoder (1).png
78KB, 256x256px
Why does java use so many fucking words for the most simple actions?
>>
>>61509652
Example?
>>
>>61509652
The easiest way for you to make sure you said the right thing is to make you say it two or three times.
>>
>>61509652
何?
Never seen this outside of the standars OOP bloat in its libraries
>>
Playing with re-frame.

Can someone tell me what this notation means?
            [re-frame.core :as re-frame]{{#re-frisk?}}
[re-frisk.core :refer [enable-re-frisk!]]{{/re-frisk?}}


https://github.com/Day8/re-frame-template/blob/master/src/leiningen/new/re_frame/src/cljs/core.cljs
>>
>>61509701
Nevermind, I got it. It's just a mustache-like project template.
>>
>>61509267
In C it means array of 2 pointers to arrays of 3 ints.
>>
>>61509659
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world");
}
}


vs

print("Hello world")
>>
>>61509807
comparing languages by their hello worlds isn't exactly fair
>>
>>61509371
So if I have 10 units of memory with these addressess: 0,1,2,3,4,5,6,7,8,9.
And a variable of some type takes up 1 unit of memory

a[6] is like [0,1,2,3,4,5],6,7,8,9
and a[2][3] is [0,1,2][3,4,5],6,7,8,9
>>
File: CMAOk-AWwAEjxbH.jpg (33KB, 575x556px) Image search: [Google]
CMAOk-AWwAEjxbH.jpg
33KB, 575x556px
>>61509689
To print a simple "hello, world" you need to type:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}


In Python it's just:
print("hello, world")

It just works.
>>
>>61509807
Now write actual programs with it and not just Hello world.
>>
>>61509807
It is for females and transpeople to understand what the program is doing
>>
>>61509807
>>61509829
That's because Python is a scripting language, brainlet
>>
>>61509822
>comparing languages by their hello worlds isn't exactly fair
Name a language whos hello world is convoluted/verbose/or tedious but the rest of the language generally is not.
>>
>>61509824
Yes.
>>
>>61509807
>>61509829
Hello world in HQ9+ is just H
HQ9+ is 21 times more concise than bloated Python, right?
>>
>>61509856
Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum and first released in 1991. An interpreted language, Python has a design philosophy which emphasizes code readability (notably using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax which allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java.[22][23] The language provides constructs intended to enable writing clear programs on both a small and large scale.[24]
>>
>>61509873
Your point being?
>>
>>61509862
C#.
>>
>>61509856
In C it's just
#include <stdio.h>

void main() {
printf("Hello, world\n");

return 0;
}
>>
minor progress
>>
>>61509862
In Haskell/Purescript you have to declare module, import print function, Maybe declare type of main and only after it you can write actual hello world.
>>
>>61509882
Vanilla C# without LINQ, no.
>>
>>61509906
>void main
>return 0
uhh
>>
New thread

>>61509923
>>61509923
>>61509923
>>61509923
>>
>>61509906
>void main()
>return 0
>>
>>61509914
main = putStrLn "Hello, world"
>>
>>61509922
It compiled for me. :^)
>>
>>61509916
>C# is verbose and tedious if you just ignore C#'s anti-verbosity and anti-tedium features
>>
>>61509906
Now create a list that will dynamically grow in size

In C# it's just
var list = new List<int>();
>>
>>61509960
vector<int> list;

sepples wins again
>>
>>61509942
Oh, Haskell allows you to do it. Okay, but Purescript is more strict.
Thread posts: 344
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.