[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 37
File: K&R himegoto waifux2.png (1 MB, 1000x1400) Image search: [Google]
K&R himegoto waifux2.png
1 MB, 1000x1400
old thread: >>52356915

What are you working on, /g/?
>>
I'm working on code reading after finishing K&R C.
>>
>>52361824

import Data.Numbers.Primes

fizzbuzz x =
case (isPrime x, x `rem` 3, x `rem` 5) of
(true, 0, 0) -> "fizzbuzz"
(true, 0, _) -> "fizz"
(true, _, 0) -> "buzz"
otherwise -> show x

main = mapM_ (putStrLn . fizzbuzz) [1..100]
>>
I'm working on you all being weeb trash.

You should probably commit sudoku.
>>
>>52361933
What is code reading?
>>
>/dpt/ can't even do the fizzbuzz sieve

Write a program that takes every number 1-100
If it's a prime and a multiple of 3 and 5, output fizzbuzz
If it's a prime and a multiple of 3 but not 5, output fizz
If it's a prime and a multiple of 5 but not 3, output buzz
>>
>>52361956
Reading the programs of people you admire. In my case, reading FreeBSD source code.
>>
>>52361969
(otherwise output the number)
>>
>>52361969
Why is it called sieve?
>>
>>52361980
Filtering for primes is called prime sieving
>>
nth for nim
http://nim-lang.org/
really happy with it, it's a lot like python, but compiled & statically typed
could use more libraries tho
>>
File: 1355901816582.jpg (33 KB, 423x474) Image search: [Google]
1355901816582.jpg
33 KB, 423x474
>>52361991
But the condition must be tantamount, not iterative and in a loop...

What gives, anon? I trusted you..
>>
>>52361933
This guy. First useful C program.
#include <stdio.h>

int main()
{
int x;
printf("1\n2\nfizz\n4\nbuzz\n");
for (x = 4; x < 101; x++) printf("%d\n",x);
}
>>
>>52362036
looks sweet senpai

>>52362044
explain to me how /dpt/ had only a 50% success rate at that fucking prime fizzbuzz challenge
>>
>>52362060
The question was in ebonics
>>
>>52362056
congratulations

btw you can declare the int inside the first statement (within the brackets) of the for loop

for (int x = 4; x < 101; x++)
>>
>>52362056
Shit, it repeated 4. Otherwise all good.
My apologies, anons.
>>
>>52362080
i forgive you
>>
>>52362073
Interesting. What's the scope of that?
I don't really see a problem with creating all variables at the beginning of my program. Are there any benefits?
>>
Nim looks even better than I thought.


>>52362100
The scope is within the loop
>>
>>52361951
since haskell does matching from left to right, you can optimize this greatly by putting the isPrime check last.
you can optimize it even more by realizing the only primes that have 3 and 5 as factors are 3 and 5 themselves.
>>
>>52362036
Glad to see another nimfriend in our midst.
>>
File: 1440878618134.jpg (185 KB, 468x500) Image search: [Google]
1440878618134.jpg
185 KB, 468x500
I have a few questions regarding Python conventions.

If you declared some functions to be used by some other functions, do you put them before or after the functions which will use them? That is, which is correct:

1 -
def mainmethod():
function1()
function2()

def function1():
#...
pass


or

def function1():
#...
pass

def mainmethod():
function1()
function2()

Also, what about variables? Do the same rules apply?

And what commenting and naming practices do you recommend?
>>
Nobody helped me with my chem problem


ughhhhhh


lucky it's just the first day. I will compile a list tomorrow after calculus
>>
>>52362073
>not supporting C89
>>
>>52362206
If it's a single pass read like in a regular .cpp file then build your variables and functions and then call them in a later function, otherwise if you are using a class you can build them in whatever order you'd like as the processor will fetch from a mapped class.
>>
>>52362206
I prefer to put the main function at the bottom

don't think there's conventions for the rest. would be impossible to determine the order in tightly coupled code anyway
>>
>>52362215
There is no reason to use C89 in 2016.
>>
>>52362254
It's almost as if you don't want compatibility with the only relevant C compiler in 2016, MSVC.
>>
>>52362260
I know that you're just baiting, but they actually support most of C99 now.
>>
But is there an actual advantage to not declaring variables at the beginning of main?
>>
>>52362277
it might save memory
>>
>>52362277
int some_long_function()
{
int i,j,k,l,ii,iii,ij,i2,i3,k2,x,y,xz; // loop counters

/// (code)
}
>>
>>52362277
Reduced scope, real const variables, nicer to look at code.
>>
help me, I got addicted to playing vidyagames, specifically minecraft with computercraft and programmable turtles :/

my addiction is keeping me away from developing my system management and monitoring software. I feel defeated :C

I wanted to learn lua anyways tho, so I guess this is a fun way to learn the basics
>>
i'm only 10 minutes into learning javascript and I already hate it.
/* bool */ function isblank(/* char * */ s)
{
/* int */ var i;
for (i = 0; i < s.length; i++)
{
/* char */ var c = s.charAt(i);
if ((c != ' ') && (c != '\n') && (c != '\t'))
return false;
}
return true;
}
>>
Working on lifegame, python.
>>
>>52362313
holy shit, why are you ruining beautiful code with those horrible in-line comments?
>>
>>52362295
I see.
You could probably reuse a few counters though.
>>
>>52362326
Yes, you could

int some_other_function()
{
for (unsigned int i = 0; i < 500; i++)
/*do something*/ ;

for (unsigned int i = 0; i < 500; i++)
/*do something*/ ;

for (float i = 0.5f; i < 5.f; i+=0.3f) //never do this
/*do something*/ ;

for (int i = 0; i < 500; i++)
/*do something*/ ;
}
>>
>>52362344
why would anyone use floats in loop counters?
>>
File: Untitled.png (27 KB, 459x1425) Image search: [Google]
Untitled.png
27 KB, 459x1425
https://github.com/logicchains/LPATHBench/blob/master/writeup.md
>>
>>52362325
It's an art thing. The code is lost in negative space. You wouldn't understand.
>>
>>52362350
cartesian grid mapping

saving cycles on an inner loop that will run differently at particular times.
>>
>>52362350
to fuck with autists and people who suffer from OCD
>>
>>52362363
cant you just do that with normal integers?
>>
>>52362353
Conclusion:
Use nim
>>
>>52362384
This
>>
>>52362353
(The top two use a different algorithm and aren't meant for comparing /language/ performance)
>>
>>52362378
while(average(x,y,x) != 1) {

/* do shit */
}
>>
>>52362416
But anon, /dpt/ keeps telling me that averages are meant to return integers
>>
>>52362447
does /dpt/'s definition of average mean integer division or floating point?
>>
>>52362447
No one has ever said this
>>
Reposting because haven't received any valid criticism:
I'm not an F# shill, but I'm learning it and I don't get why so many people claim it is poorly designer...
Surely it has a lot of flaws, mainly because of interoperability with .NET, which sometimes makes it less appealing than both functional or imperative alternatives, but most of the time the compromises in it seem worthy to me...
>>
>>52362350
To loop over floats.
>>
>>52362463
>sure it has a lot of flaws
that's why

fuck off F# shill
>>
>>52362463
Saying "I'm not an F# shill" doesn't make you not an F# shill.
>>
>>52362473
>valid criticism
>>
>>52362473
>>52362479
>>52362485

>/dpt/'s ongoing prejudice against F#
The future will either be F# or Nim
>>
>>52362479
I like it, I spent the last two week reading an F# book, I hope it is't a meme, but I wouldn't defend it in an argument...
>>
how is luajit so good
>>
>>52362534
cuck
>>
File: ama.webm (2 MB, 1280x720) Image search: [Google]
ama.webm
2 MB, 1280x720
Ask your favorite programming literate anything.
>>
>>52362573
What's the time?
>>
>>52362581
I feel like the longer you take the less useful the answer becomes
>>
>>52362581
python -c "import time;print(time.asctime())"


Mon Jan 11 20:05:47 2016
>>
>>52362633
>importing the whole time module just for one function
>>
What is time?
>>
>>52362645
a function of entropy in euclidean space
>>
>>52362633
>function to print the current time
>written in god damn python

What's the precision on that? Nearest hour?
>>
>>52362645
What is love?
>>
>>52362153
I'm not very bright

>tfw dropped out of high school
>>
>>52362657
the precision is to the nearest second in asctime

if you mean the accuracy then the answer is that it depends on how long it takes to run
>>
File: milk.webm (3 MB, 1280x720) Image search: [Google]
milk.webm
3 MB, 1280x720
>>52362642
cpython imports the whole module anyway and
import asctime from time;print(asctime())
is longer

>>52362657
https://docs.python.org/3/library/time.html#time.time
>>
>Gets a pull request
>Looks at it
>Commit message is "update"
>No description
>Looks at person's profile
>Hundreds of PRs exactly the same
>>
File: python.jpg (435 KB, 2000x1334) Image search: [Google]
python.jpg
435 KB, 2000x1334
>>52362679
>that depends on how long it takes to run
that'sthejoke
>>
import Love;
>>
File: snek.jpg (980 KB, 2432x4320) Image search: [Google]
snek.jpg
980 KB, 2432x4320
>reading alexandrescu's book on D
>Array accesses are bounds checked; code that enjoys risking buffer overruns can scare the pointer out of the array
what did he mean by this?
>>
>>52362690
Did you accept their pull request?
>>
>>52362710
probably *(&arr[0] + k) in C
>>
>>52362706
Error: module Love is in file 'Love.d' which cannot be read
>>
>>52362719
>implying Love.d could be found
>>
>>52362718
>&arr[0]
>&*(arr + 0)

why.jpg
>>
File: monkey.webm (3 MB, 640x480) Image search: [Google]
monkey.webm
3 MB, 640x480
>>52362710
the [] operator also work on pointers like with c and c++

int[100] foo;
int *p = &foo[0];
p[99] = 44; // no checking done.
>>
>>52362733
in some languages you can't just dereference an array or dereferencing an array doesn't do what you want

if it's contiguous memory and [] is a proper access operator and 0 is the first element, mine will work

e.g. std::vector
>>
>>52362693
which you managed to screw up by referring to precision rather than accuracy. You continue to look stupid by not having realised this.
>>
>>52362744
>in C
>>
File: Screenshot - 110116 - 21:19:48.png (10 KB, 562x47) Image search: [Google]
Screenshot - 110116 - 21:19:48.png
10 KB, 562x47
>>52362729
>>
>>52362746
It wasn't a very precise joke
>>
>>52362756
i've been D. Trumped
i will commit son goku immediately
>>
>>52362757
redeemed
>>
How do you commit sudoku to github?
>>
>>52362787
git commit -m 'sudoku'
git push
>>
>>52362798
>5232798
You're a thousand posts too late
>>
Whatever happened to Valutron or Pipes or whatever the fuck that retarded shit was called?
>>
>>52362827
Valutron got dereferenced while pipes | out
>>
>>52362711
I've requested they fix the message. No response yet.

It's bullshit though. How hard is to say "hey, here's what I've done".
>>
has anyone here ever actually finished a project
>>
>>52362875
>has anyone here ever actually finished a project
I finished the project where I banged your mum lol
>>
>>52362855

I got a similar one with these stats:


Commits 25  Files changed 107
+4,707 −9,205 13,912 lines changed
>>
>>52362882
:/
>>
>>52362875
yes
>>
>>52362904
it doesn't count if you were paid or required to do it

teach me how to not get bored
>>
>mfw reading statically typed cancer
>>
>>52362933
type inference
>>
Daily reminder that ocaml is shit compared to nim which is

>more efficient
>more expressive
>more extensive
>more powerful
>more performant
>not shit
>>
>>52362952
Daily reminder that both are obscure as fuck.
>>
>>52362933
>dynamic typing
>not cancer
>significant whitespace
>not cancer
>slow as fuck interpreted langs
>not cancer
I want python babbies out
>>
>>52362875
finished my mum shagging project by banging the piss out of your mum

also, yes I have. it was in thousands of lines complete with unittests. great feeling tbqh.
>>
>>52362983
nim is only 8 years old
ocaml is nearing 20
>>
>>52362875
Yes
>>
>>52362952
Daiy reminder that everything is shit compared to D which is

>literally perfect
>>
>>52362996
>worse performance than nim
>less feature complete than nim
>less powerful than nim
>less extensive than nim
>worse at systems programming, its goal, than nim
>>
>>52362985
>muh compile time errors
Get out
>>
>>52362985
>python babbies
>implying all the oldschool c/c++/java programmers haven't switched to python
>implying anyone other than hipsters still use compiled, statically typed languages
>>
>>52362991
>8 years old
>no traction at all

Go is 7 years old
Rust is 7 years old
Swift is 18 months old

They're all considerably more used than both nim and OCaml
>>
>>52363004
>>52363001
>I would rather have errors cause complicated problems at runtime than show up plainly at compile time with line numbers to show what went wrong an where
okay m8
>>
>>52363000
>>worse performance than nim
need sources
>>
>>52363019
Typo, Rust is 5 years old.
>>
>>52363027
>my code contains errors 'cause I'm a dumbass but at least the compiler will hold my hand
GTFO
>>
>>52363000
>[citation needed]: the post
>>
File: 1451757804978.jpg (44 KB, 312x322) Image search: [Google]
1451757804978.jpg
44 KB, 312x322
>>52362573
wat animu is that? is it good?
>>
>>52363029
see thread

>>52363043
>i'm a slow programmer
>>
>>52363043
>my code never contains errors
translation:
>I have never written more than 1000 LoC in my entire life
>>
>>52363027
>I have no idea what unit tests, regression tests, system tests are automated use case tests
>I would rather delay a project by several months hunting down some memory leak problem that was introduced a gazillion versions ago but wasn't significant until our user base suddenly jumped from 200 to 20000

inb4 hurr durr higher level programming languages such as C# and Java
These are meme languages used by poo in loos and in ENTERPRISE QUALITY software, and you know it.
>>
http://forum.dlang.org/thread/[email protected]
>>
>>52361969
>If it's a prime and a multiple of 3 and 5
i'm not sure you know what a prime is
>>
File: dpt fails again.png (37 KB, 743x610) Image search: [Google]
dpt fails again.png
37 KB, 743x610
>>52363069
I'm not sure you understand the point of the exercise
>>
>>52363066
there no benchmark in dat thread.
>>
>>52361969
>prime
>multiple of 3 and/or 5
lolwut
>>
>>52361969
System.out.println(1);
System.out.println(2);
System.out.println("fizz");
System.out.println(4);
System.out.println("buzz");
for(int i = 6; i <= 100; ++i) {
System.out.println(i);
}
>>
>>52363073
3 is a prime and a multiple of 3, it should output "fizz" not "3"
5 is a prime and a multiple of 5, it shoud output "buzz" not "5"

That implementation is wrong.
>>
>>52363073
nicely done assburger, nicely done
>>
>>52363063
C# and Java are both fine languages for things other than ENTERPRISE. I regularly write simple apps in C#, with and without GUI to fix small problems or to show proof of concepts of data access/manipulation from APIs and databases.

Get off your high horse, you're comparing apples to oranges.
>>
#include <stdio.h>

main(){
int i;

for(i=1;i<=100;i++){
if(i%15==0) printf("FizzBuzz\n");
else if(i%5==0) printf("Buzz\n");
else if(i%3==0) printf("Fizz\n");
else printf("%d\n",i);
}
}


I did right?
>>
>>52363094
>hurr durr only compile languages!!!!
>herp derp only static typing!!!!
>"Get off your high horse, you're comparing apples to oranges."
No fucking shit, sherlock
>>
File: 1452374356242.png (390 KB, 850x720) Image search: [Google]
1452374356242.png
390 KB, 850x720
>>52363080
Is this the start of an ebin new maymay?
>>
>>52363089
oh yeah when i said "nicely done" i was thinking that it was a play on words, that every number is divisible by itself and 1, but there is no requirement that it shouldn't be divisible by 1. so >>52363080 should be correct

i'll blame a lack of sleep and not really giving much of a shit
>>
>>52363101
I don't know what you think I'm advocating for, but that was my first post in this thread.

There's a time and place for scripting languages, just as sometimes you might want to use something functional, or something super concise for a quick-and-dirty.
>>
>>52363103
fun fact: i typed out all those System.out.println's by hand
>>
>>52363123
>I don't know what you think I'm advocating for, but that was my first post in this thread.
Follow the chain of posts.
>>
>>52362353
>D uses LDC, an incomplete, buggy LLVM compiler
D remains unstumped
They could not have gimped D harder if they'd tried
In my experience, DMD with optimisations can stand right up there with g++, and if you can get GDC not to statically link the entire fucking standard library, it would probably be faster
>>
>>52363117
wait it says "and a multiple of only 3" so it is an asplurgian play of words after all, since 3 is also a multiple of 1.
>>
stop wasting time on meme languages and embrace Python
>>
>>52363228
python considered harmful
>>
>>52363228
shame on you
>>
>>52363237
memes considered harmful
>>
>tfw you write a minimax with a more than 2000 possible branches per node in the search
>tfw you have to write in python
>tfw optimising it
fugg :D:D:D:D
>>
>finally learnt what tail call optimisation is
it's a fucking miracle, it turns out
>>
>>52363286
There isn't a machine code compiler for it?
a lot of interpreted languages have one
>>
>>52363254
memes considered python
>>
>>52363286
switching to anything java or lower level will give you a 50-100x performance increase
>>
>>52363347
python considered memes
>>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char *lines[] = {
"let () =",
" let rec loop oc = function",
" | 101 -> ()",
" | n ->",
" let s =",
" match n mod 5, n mod 3 with",
" | 0, 0 -> \"fizzbuzz\"",
" | _, 0 -> \"fizz\"",
" | 0, _ -> \"buzz\"",
" | _, _ -> string_of_int n in",
" Printf.fprintf oc \"print ('%s')\\n\" s;",
" loop oc (succ n) in",
" let oc = open_out \"fizz.py\" in",
" loop oc 1;",
" close_out oc;",
" ignore (Sys.command \"python fizz.py\");",
" Sys.remove \"fizz.py\"",
";;",
NULL
};

int main (void) {
FILE *file;
char **line;
file = fopen ("fizz.ml", "w");
for (line = lines; *line != NULL; line++) {
fprintf (file, "%s\n", *line);
}
fclose (file);
system ("ocaml fizz.ml");
remove ("fizz.ml");
return 0;
}
>>
>>52363803
why an array of strings ?

char *source =
"let () =\n"
" let rec loop oc = function\n"
" | 101 -> ()\n"
" | n ->\n"
" let s =\n"
" match n mod 5, n mod 3 with\n"
" | 0, 0 -> \"fizzbuzz\"\n"
" | _, 0 -> \"fizz\"\n"
" | 0, _ -> \"buzz\"\n"
" | _, _ -> string_of_int n in\n"
" Printf.fprintf oc \"print ('%s')\\n\" s;\n"
" loop oc (succ n) in\n"
" let oc = open_out \"fizz.py\" in\n"
" loop oc 1;\n"
" close_out oc;\n"
" ignore (Sys.command \"python fizz.py\");\n"
" Sys.remove \"fizz.py\\n",
";;";

int main (void) {
FILE *file;
char **line;
file = fopen ("fizz.ml", "w");
fprintf (file, "%s\n", source);
fclose (file);
system ("ocaml fizz.ml");
remove ("fizz.ml");
return 0;
}
>>
>>52362985
This is the kind of shit that's driving me away from /g/, subjective opinions, baiting, and silly flamewars instead of valid, and constructive criticism.
Instead of helping each other, /g/ simply wishes to be vindictive and bring one another down.
I rarely come here anymore, it's just full of cynical pessimism and unnecessary hate.
>>
>>52362313
Embrace javascript and stop programming so imperatively.

function isblank(s) {
return Array.from(s).some(c => c != ' ' && c != '\n' && c != '\t');
}
>>
>>52362933
what makes static typing cancer?
>>
>>52363877
It has become a very strange place.

Lets say I know nothing about a particular language.

Option A:
Hey anon, can you tell me about Python?
>fuck off retard

Option B:
Yo anons, Python is shit because it's dynamically types, and the variables lose data in every usage, and it doesn't have brackets.
>20 Python advocates respond with lots of interesting facts about Python, allowing me to learn

Bait is the only way to get information from channers these days.
>>
File: interested-frog.jpg (7 KB, 225x225) Image search: [Google]
interested-frog.jpg
7 KB, 225x225
>exam period
>tutoring normies for money
we finally rise
>>
File: godsofprogramming.jpg (100 KB, 600x600) Image search: [Google]
godsofprogramming.jpg
100 KB, 600x600
>>52363922
less expressive, more complicated, static typing handcuffs the programmer.
>>
>>52363938
how is it less expressive and more complicated?

surely passing around all kinds of type data at runtime is significantly more complicated
>>
>>52363933
Jesus Christ how horrifying.
But I'm just getting tired of the language wars. Just fucking program, the language doesn't matter. Sure certain programming languages would be better for the task at hand, but most people in this thread are not knowledgeable enough to optimize their code, we're just here to learn about the fundamentals and that can apply to any language.
>>
>>52363850
I wanted to use char **, but gcc forbid it.
>>
>>52364022

working on my masters thesis
>>
I hope this isn't too bad of me asking but I have a want to better my self and start learning to programming for game development.

Inb4 > 'indie dev'

So I ask if anyone wouldn't mind parting with some advice to help keep me on track and not have everything so oberwhelming. I'm thinking I should start writing small programs to get comfortable with the code I'm using. (I've even thought of making mods for memecraft as a start).

Thank you for your time /dpt/.
>>
>>52363934
just sell adderall.
>>
>>52364176
>>>/vg/agdg
>>
>>52364176
Just go and use unity with the rest of the gamedevbabbies >>>/vg/agdg
>>
>>52364203
>>52364210
Somehow /agdg/ is even worse than /dpt/, which is already a feat itself
>>
>>52364176
that pussy attitude is why people fail at programming and end up in >>>/g/wdg

don't be a faggot, I learned C when I was 14 so unless you're dumber than a 14 year old you should be able to learn it properly.
>>
>>52364176
>game development
pff
>>
I know I know, I figured I'd be able to get some good advice from here as well. I think people here have a better grasp of good coding principles here than at /agdg/
>>52364203
>>52364210
>>
>>52364241
Not really, we just write ASCII meme programs and shit on each others' language of choice.
>>
>>52364241
>quoting with the post number under your message
>>
>>52364231
>implying web development is easier than classic programming
You clearly don't know what you're talking about.
>>
>>52364268
Web development is piss easy.
>>
>>52364268
Fuck off back to /wdg/, web-babby
>>
>>52364268
>web development is as hard as classic programming
nice bait faggot
>>
>>52364253
Using Clover on le smart phone senpai. Not used to posting with it. Mainly just lurk.

[Spoiler]sorry[/spoiler]
>>
>>52364268
>he thinks HTML is hard

HAhahahaH!
>>
File: Owl takes a bath.gif (999 KB, 241x135) Image search: [Google]
Owl takes a bath.gif
999 KB, 241x135
 for i in range(1,101):
if i%3==0 and i%5!=0:
print('Fizz')
elif i%5==0 and i%3!=0:
print('Buzz')
elif i%3==0 and i%5==0:
print('FizzBuzz')
else:
print(i)



D-did I do good, senpai?
>>
>>52364298
you sure didn't.
>>
>>52364295
>[spoiler][/spoiler]'ing parts of your post
>(you)
>>
>>52364295
Stupid newfags shouldn't post at all.
>>
>>52364176
learn opengl

read the opengl superbible

use C++

build your games from scratch, don't use any engine or framework
>>
>>52364325
>how to never finish a project
>>
>>52364277
>>52364280
>>52364288
>>52364297
I've been lurking here for quite a long time, and I never understood that baseless hate against web dev. I'm not talking about making a fucking page in HTML of course. Modern web applications need a good amount of knowledge and problem solving.
>>
>>52364307
>>52364307

This is why I enjoy 4chan, no beating around the bush here.

But desu senpai I'm not a newfag, maybe to /dpt/ but not the chin
>>
>>52364353
>he thinks Angular is hard

HAhahahaH!
>>
>>52364353
Re-read your posts.
If you still don't understand why no one likes uppity web devs, you never will.
>>
>>52364304
Why? Genuine question

Did I do it wrong?
>>
>>52364373
That owl is 100% shit.
>>
>>52364353
bet it doesn't need any of the following:
*complicated algorithms and data structures
*algorithm optimisation
*knowledge of computer architechture
*knowledge of operating systems
*understanding of concurrency
*mathematics
>>
>>52364386
>hating the cleanest owl in the business

Spotted the pleb
>>
>>52364345
it's not as hard as it may seem

just start with a simple arcade game

using an engine/framework also takes effort to learn to use properly and the result will be much worse than a proper custom solution
>>
>>52364203
>>52364210
>>52364231
>>52364239
>>52364325
Holy shit, >>52363933 demonstrated in action.
>>
>>52364389
Not the guy you're responding to, but I worked as a web dev in an earlier job. It was a web-based image and video organising software (so-called DAM system), and as a back-end developer I worked on their back-end system which not only had to do image and video processing, heavy file operations, full-text search in image metadata (see IPTC/XMP), it also had to this while supporting several hundred users doing it simultaneously. The indexing service that allowed faceted search was implemented in C++, so was most of the heavy file operations and image and video processing. The more simple tasks, such as querying the config database and stuff like that was implemented in Python.
>>
>>52364439
Wow!
You noticed a pattern!
You cracked the code!
Genius!
Please senpai teach me how to be as smart as you are!
>>
>>52363877
if you want that shit go to SO I'm here to banter with a computer science theme
>>
File: OyjLSS5.png (87 KB, 636x766) Image search: [Google]
OyjLSS5.png
87 KB, 636x766
>>52364520
Just got to analyze the data, mate.

Today's shit thread in image.
>>
>>52364591

> the day fizzbuzz becomes new meme
>>
>>52364367
>Using that piece of shit out of all the frameworks available
>Implying web dev only means frontend work

>>52364368
>Doesn't state any arguments
>Better use ad hominem
Get off your fucking high horse.
You must be such a special snowflake for being able to make a fizzbuzz one liner in haskell.

>>52364389
>complicated algorithms and data structures
>algorithm optimisation
>mathematics
Sure, if you don't know what you're doing and just blindly follow a library guideline.
There are interesting cases emerging in today's web dev such as dom diffing and immutability optimisations that require at least a medium understanding of algorithms and data structures.

>knowledge of computer architechture
>knowledge of operating systems
>understanding of concurrency
I'll have to agree, mainly because those are abstracted away by the javascript vm & jit compiler. Still funny that they had to add typed native arrays because some computation-heavy applications faced performance issues
>>
>>52364619
>new
>>
can someone tell me why this won't work? it stalls on my laptop and when i run it from pythonanywhere it throws the error "simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

https://spit.mixtape.moe/view/c73f63a2
>>
>>52364630
>Sure, if you don't know what you're doing and just blindly follow a library guideline.
but that's exactly what happens

hence the billion JS frameworks
>>
I still can't program.

What am I doing wrong?
>>
>>52364660
wrong thinking

acquire systems thinking and then use it to break down you problem into loops, function calls, decisions and variables
>>
help me /g/uardians,
>C#
>get a string of words
>get the number of ASCII of every char in the string
>now get the last digit of every char when you convert it to int (I've done it with %10 when converting and put it in a list)

My problem is I think I am missing something, Is there shorter/better way to do this ?

Otherwise the problem is easy peasy and I got 100 points, but still..
>>
File: 1373662916812.jpg (171 KB, 600x400) Image search: [Google]
1373662916812.jpg
171 KB, 600x400
>>52364591
it's me or python is always in the top 3 ?
>>
>>52364717
shit is also in the top 3
>>
>>52364660
if you understand logic chains, then you can program.

you just think you can't either because you dont know syntax or the thing youre trying to program is too complex for your current level.
>>
>>52364427
I'm not the game dev retard, but I know opengl and shaders and telling a wannabe indie dev who can barely write "Hello, World." to learn raw opengl and c++ is just terrible advice.
>>
File: laughing whores.gif (2 MB, 500x281) Image search: [Google]
laughing whores.gif
2 MB, 500x281
>>52364630
You don't even realize why you suck so much dick.
>>
I think the migrant crisis is starting to turn me right wing. I visit left leaning forums and when I see someone post something like "I hope the people can understand the cultural differences" in relation to rapes and murders in Germany I start to fucking lose it. Are these people for fucking real? How does that excuse anything? Next I'll be browsing /pol/
>>
>>52364758
what's the alternative? if he uses unity he will forever be limited to (a subset of) what the unity engine can do. if he uses libgdx, love2d, or pygame he'll waste a huge amount of time and either make a turd of a game or move on to raw opengl. opengl and glsl isn't even hard at all if taught properly. it's actually very simple.
>>
>>52364784
The only logical conclusion that can be drawn from current events and statistics is that mass immigration causes lots of violent crime.

See Sweden for a great example that's a bit older than the new migrant crisis.

>>52364683
What have you tried? Post your code.
>>
>>52364797
Learning high level game dev concepts is infinitely more important than what tool you use to actually make the game.
>>
>>52364830
no it isn't. you need high level concepts too but you'll be crippled by whatever tool you're using.
>>
>>52361970
gayest thing I have ever heard, and I've sucked cock
>>
>>52364797
Wannabe dev fag here, You've got my curiosity about unity. Would I miss out on anything by using that platform? I don't want to make some poorly unoptimised buggy trash mobile game, I want to learn a strong foundation. I'm not planning my entire life career on games, I'd love to be able to have useful code knowledge that can be brought from one project to the next, wether it be a game or some other program.
>>
>>52364780
>can't construct a decent argument
>continues to ad hominem
/dpt/ everyone.
>>
>>52364797
>(a subset of) what the unity engine can do
No.
If he goes the C# route in Unity, then he'll know how to program in C#, especially if he starts making complex games and doing heavy optimizations.

Just the same as if you use Unreal engine, you'll probably learn a good deal of C++(Only if you don't use blueprints). I mean you're basically saying he won't learn a language because of an API/library.
>>
Can someone who still uses archaic languages like C and Java please explain to me why you cling to the past instead of using a modern language like Python in which one line of readable code translates to 30+ lines of unreadable code in "traditional" languages?

I'm not baiting or trying to start a senseless flame war, I really just don't understand it.
>>
>>52364809
        var strInput = Console.ReadLine();
var direction = Console.ReadLine();

var inputChar = strInput.ToCharArray();
var numList = new List<int>();
var numList2 = new List<int>();
var newNumber = new int[numList2.Count];

for (int i = 0; i < inputChar.Length; i++)
{
var lastDigit = Convert.ToChar(inputChar[i] % 10);

numList.Add(lastDigit);
}



Its really long code, and I do some other stuff with it, but this is the part I am talking about.
>>
>>52364638
please respond
>>
>>52364867
>I don't want to make some poorly unoptimised buggy trash mobile game
that's literally what you'll get with unity
>>
>>52364876
C and Java are much faster (especially C)

Strong typing is less prone to bugs, and some would say it makes your code more readable

Scripting languages are best for small programs and quick prototypes, but they aren't ideal if you have a large team working on the same code base.
>>
>>52364871
Most languages have opengl bindings.
Knowing C# has nothing do with understanding opengl or the stuff game engine does under the hood.
>>
>>52364867
>I don't want to make some poorly unoptimised buggy trash mobile game
Do unit testing, isolate slow code, always refactor, google best practices for C#, google best practices for game algos(especially A* path finding).

the engine you use is almost never the reason for bad performance. its just shitty programmers. getting something to work is only half the job.
>>
File: 1413762937354.gif (3 MB, 445x247) Image search: [Google]
1413762937354.gif
3 MB, 445x247
>>52364870
>he still can't figure it out
>>
>>52364902
>Knowing C# has nothing do with understanding opengl or the stuff game engine does under the hood.
You don't need to know about low level 3D rendering unless you plan to write your own graphics library, which you shouldn't be doing if you just want to make game or learn general programming.
>>
>>52364896

> what is FromTheDepths
> what is StarCrawlers

Are you just hating to hate senpai?
>>
>>52364902
i'm not talking about opengl at all. you can still use opengl to make shaders in unity. its incredibly easy.

>or the stuff game engine does under the hood
it depends on the engine. some engines abstract a lot of what happens away from the user, some engines expose it.
>>
File: laughing whore6.jpg (112 KB, 1280x720) Image search: [Google]
laughing whore6.jpg
112 KB, 1280x720
>>52364908
This wasn't even me, but have some laughing whore since you're so good at baiting
>>
>>52364908
I figured out that you suck cocks :^)
>>
>>52364896
its a popular engine.
a lot of people who can't program use it,thus giving that impression.

like i know some people who build their entire games around scripts they bought from the asset store, then mash it together expecting things to work.
>>
File: laughing whore.gif (3 MB, 355x201) Image search: [Google]
laughing whore.gif
3 MB, 355x201
>>52364908
This one isn't free senpai, you owe me one.
>>
>>52364867
>>52364896
Have you perhaps heard of a little game called "Hearthstone" made by Blizzard?
They use the unity engine.
>>
>>52365014
>shitty card game with assets recycled from their other game
>good example
>>
>>52364298
print("\n".join(["fizzbuzz" if x%15==0 else "fizz" if x%3==0 else "buzz" if x%5==0 else str(x) for x in range(1,101)]))
[\code]
>>
File: 1445657514408.png (183 KB, 700x500) Image search: [Google]
1445657514408.png
183 KB, 700x500
>>52365025
Ori and the blind forest.
>>
>>52365036
Got me there.
>>
>>52365049
Faggot
>>
>>52365025
I'm sure there are better examples, but this notion that unity is used by plebs who can't write code is bullshit, was my point.
I don't like Unity myself, but that's for personal preference reasons.
>>
File: 1.png (38 KB, 1106x810) Image search: [Google]
1.png
38 KB, 1106x810
>>52364896
you're telling me my optimized implementation of verlet integration is shit because its in unity, even though it runs insanely fast and has been stress tested under high loads?

nah, you wouldn't know bout that boi.
>>
>>52364638
pls
>>
How do you write a oneline FizzBuzz in Java?
>>
okay, here are my idea.

to have a webpage where you can read a magazine, like those anime magazines, one page each time, similar to how you read comics.

Of course this magazine will be made using html and css, that's easy.

But I want also to have some kind of basic interactivity, like a choose your own adventure book, maybe save a score or other variables that can affect the story path.

At the most advanced level there will be some minigames, like a basic roguelike.

Can this be done with html+css+javascript?

I don't want to use any library or any shit.
>>
>>52365145
You never heard about debugging?
Add a breakpoint, run it step by step, look at variables in the memory and identify the issue which probably comes from a malformed json string
>>
>>52365237
Any how much are you going to pay the artists for the custom content needed?
>>
>>52365237
>I don't want to use any library or any shit.
You've already failed before you've begun.

You're doing webdev; use libraries and frameworks.
>>
>>52365116
fuck off to >>>/vg/agdg kid
>>
>>52365263
I'm mostly an artist that made some games in java but is not longer interested into making games.

I still like the interactivity aspect of games and want to make something like an interactive magazine/comic.

Sound more interesting and less demanding that making a videogame.

>>52365274
what do you mean?
to use stuff like pharser?
I don't want to use complex stuff or set up a server.
I don't know if I should use flash instead.
>>
>>52365244
I've tried that, it fucks up on a perfectly valid line and I can't figure out why for the life of me
>>
File: 33b[1].jpg (63 KB, 640x480) Image search: [Google]
33b[1].jpg
63 KB, 640x480
>>52365237
>anime magazines

>>52365305
>flash
Thread replies: 255
Thread images: 37

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.