[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: 314
Thread images: 36

File: 1503857739957.gif (197KB, 462x326px) Image search: [Google]
1503857739957.gif
197KB, 462x326px
What are you working on, /g/?

Old thread: >>62135186
>>
File: 1503468473971.jpg (978KB, 1219x747px) Image search: [Google]
1503468473971.jpg
978KB, 1219x747px
First for comfy programming
>>
Looking for p2p libraries for C/C++. libp2p for C/C++ in other words, but I guess that doesn't exist. Is using a boost-based solution the only way?
>>
File: 1495321429263.jpg (31KB, 479x540px) Image search: [Google]
1495321429263.jpg
31KB, 479x540px
>>62140998
[public void]
>>
>>62140998
you would make a fine pair programming partner
>>
File: languagelevels.jpg (715KB, 642x1650px) Image search: [Google]
languagelevels.jpg
715KB, 642x1650px
You cannot dispute this.
>>
>>62141050
>MS Java is somehow different from Sun Java
>>
>>62141050
Where ma boi ALGOL 68
>>
File: 15006286503.jpg (163KB, 1024x768px) Image search: [Google]
15006286503.jpg
163KB, 1024x768px
PROGRAMMING CHALLENGE

Make a £sd calculator. It must be able to add, subtract in £sd, multiply and divide by decimal fractions. Lowest coin is farthing.
4 farthings make 1 penny, 12 pence make 1 shilling, 20 shillings make 1 pound.

So far, we have a solution in APL, J and C!
What other languages will present /g/ later?
>>
>>62141065
If you actually knew your Java 8, you would understand just how much better it can be when structured well.
>>
Have any of you written a program to solve General Lambert's Problem yet?
>>
File: 1484948620949.gif (1020KB, 500x373px) Image search: [Google]
1484948620949.gif
1020KB, 500x373px
I'm not smart enough to "get" programming
>>
>>62141472
what dont you get lad?
>>
Trying to learn lisp...

How do I use emacs to run a lisp file?

Currently, I'm trying to do
 C-x C-e
, as it says here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html#Lisp-Eval

But I'm getting the error in pic related.
When I run the same code in DrRacket, the code works, so I'm not really sure what to do
>>
I've been browsing some other boards. I have to say /dpt/, you're not dumb. We have disagreements and arguments but in other places people don't even speak at you, nevermind attempt to address arguments.
I had a guy describe an argument me and another anon was having over at /3/ and it's way inaccurate, and the guy I was discussing with somehow agreed with that description. Its like they're brain damaged.

Thanks for being good people /dpt/.
>>
Do I need to learn vanilla JS in order to learn how to use ext JS? I've done pretty much no frontend stuff my whole career (C/C++/python/ruby/Java) but my new project wants me to work on some frontend tickets. How hard is it to learn open source JS frameworks from a backend perspective?
>>
>>62141188
When's your homework deadline, anon?
>>
File: cat computer sailor moon.gif (929KB, 500x388px) Image search: [Google]
cat computer sailor moon.gif
929KB, 500x388px
>>62141497
the first chapter of sicp, 1.1.7
>>
>>62141525
try running racket as a child process (C-u M-x run-scheme racket)
my guess is it's assuming you're trying to evaluate it in emacsLisp, rather than racket
>>
>>62141050
java was expressly made for being easier to learn than C though
>>
>>62141612
no it was made as a portable language for niche systems
and its popularity on common, established platforms was as a result of being easier to learn than C++, not C
>>
anyone know a good resource for modern C, one that covers the GObject library
>>
>>62141638
that may be one of the reasons, but it made a lot of decisions to make itself easy to learn. english-like expressions instead of cryptic C abbreviation. method syntax and OOP makes it so code completion can remove any requirement of you to memorize libraries. it's a language for the lowest common denominator of being as easy to program in as possible
>>
hey /dpt/ can you recommened a linux IDE for developing in c#?
>>
>>62141677
Monodevelop
>>
>>62141677
atom i guess? if you're trying to be as hipster as possible you shouldn't be using an IDE though
>>
File: 1499206703034.png (103KB, 500x700px) Image search: [Google]
1499206703034.png
103KB, 500x700px
>>
>>62141686
thank you

>>62141701
I want to get work done not be ironic
>>
File: 1489491095718.png (740KB, 1834x1200px) Image search: [Google]
1489491095718.png
740KB, 1834x1200px
Reminder.
>>
File: 1499205812770.png (114KB, 500x700px) Image search: [Google]
1499205812770.png
114KB, 500x700px
>>62141544
>do i need to learn vanilla JS
yes
>>
why does no one realize the ancient prophecy of the golem is upon us?

statues formed from the stuff of the earth, given very literal orders by cryptic inscriptions derived from grimoires and written inside their bodies, and given life to carry out the orders by a raw force of divine might harnessed by learned men

it's all true

stuff of the earth -- copper and silicon

statues made from these materials -- computers and robots

literal orders -- programming

cryptic inscriptions -- source code in text files

derived from grimoires -- standards documents, tutorials

written inside their bodies -- typed in, to be precise, as source code files

raw force of divine might -- lightning

harnessed -- electricity

learned men -- programmers and electrical engineers

given life to carry out the orders -- AC adapters

we did it, we made the biblical golems

now we're all fucked

i see now that the precautionary tale of man's hubris refers to the impending technological singularity

how do we combat the robot takeover

pls
>>
>>62141835
lol
>>
How many of you are capable of manually writing your own machine code?
>>
Do you miss Dennis Ritchie?
>>
>>62141897
I miss John Lennon more.
>>
I made a break from improving my programming skills to learn about cryptography. I have a feeling it can be a source of inspiration for many interesting programming exercises.
>>
>>62141789
I too can compare multiple languages to a single one (or maybe not: "byte"). Also "Resizable arrays" is listed twice.
>>
>>62141835
Old news bro.
Old as in at least 9 years old.
http://boards.straightdope.com/sdmb/showpost.php?p=10436780
>>
>>62141789
You forgot static, const, volatile, restrict, case, break, continue, auto, struct, union, short, long, float, double, and the fact that C can do literally any of the things listed on the left with enough work, "enough work" being an amount of work that C programmers actually do regularly to realize these concepts in C from scratch.
>>
>>62142009
>>62142009
only the ELITE few can write boilerplate for every project
>>
>>62141188
Posting solution in two parts because I'm one verbose bitch

Wasn't really sure if I implemented multiplication/division as you intended, but hopefully I did decently enough.
Code in C++

#include <iostream>

#define FARTHING_TO_PENCE 4
#define PENCE_TO_SHILLING 12
#define SHILLINGS_TO_POUND 20

struct Money
{
int farthings;
int pence;
int shilling;
int pounds;

double equiv_value; /* Equivalent of all the above converted to decimals and added */

/* Helper function that makes constructor a bit prettier */
void
reduce(int& farth, int& pen, int& sh, int& pou)
{
if(abs(farth) > FARTHING_TO_PENCE)
pen += (farth / FARTHING_TO_PENCE), farth %= FARTHING_TO_PENCE;
if(abs(pen) > PENCE_TO_SHILLING)
sh += (pen / PENCE_TO_SHILLING), pen %= PENCE_TO_SHILLING;
if(abs(sh) > SHILLINGS_TO_POUND)
pou += (sh / SHILLINGS_TO_POUND), sh %= SHILLINGS_TO_POUND;
}

double
convert_to_decimal(int farth, int pence, int sh, int pound)
{
return (pound +
(double) (sh) / (SHILLINGS_TO_POUND) +
(double) (pence) / (SHILLINGS_TO_POUND * PENCE_TO_SHILLING) +
(double) (farth) / (FARTHING_TO_PENCE * SHILLINGS_TO_POUND * PENCE_TO_SHILLING));
}

/* Constructor... Takes in four values and, after reducing,
intializes the class variables (in terms of coins) of the "Money" structure*/
Money(int f = 0, int pe = 0, int sh = 0, int pou= 0)
{
/* Create four additional variables to be able to reduce (passing by reference) */
int temp_f = f, temp_pe = pe, temp_sh= sh, temp_pou = pou;
reduce(temp_f, temp_pe, temp_sh, temp_pou);

farthings = temp_f;
pence = temp_pe;
shilling = temp_sh;
pounds = temp_pou;

equiv_value = convert_to_decimal(farthings, pence, shilling, pounds);
}
/* To be continued */
>>
This is worth checking out for anyone interested in ancient programming:

http://freecode.com/projects/fortran-games
>>
>>62142009
>auto
Literally useless, since it is default behavior.
>>
>>62142018
Part II

   /* Define operations */
struct Money
operator+ (struct Money rhs)
{
return Money
((this->farthings+ rhs.farthings ),
(this->pence + rhs.pence ),
(this->shilling + rhs.shilling ),
(this->pounds + rhs.pounds)) ;
}

struct Money
operator-(struct Money rhs)
{
return Money
((this->farthings- rhs.farthings ),
(this->pence - rhs.pence ),
(this->shilling - rhs.shilling ),
(this->pounds - rhs.pounds ));
}

double
operator*(struct Money rhs)
{ return rhs.equiv_value * this->equiv_value; }


double /* Doesn't make much sense to return a "Money" structure if we're dealing
with nonexact coinage... But feel free to crucify me if you disagree with me */
operator/(struct Money rhs)
{ return this->equiv_value / rhs.equiv_value; }

friend std::ostream& operator<<(std::ostream& out, Money m)
{
out << "MONEY:\n\t";
out << "Farthings : " << m.farthings << "\n\t";
out << "Pence : " << m.pence << "\n\t";
out << "Shillings : " << m.shilling << "\n\t";
out << "Pounds : " << m.pounds << "\n\t";
out << "Equivalent to... " << m.equiv_value << "\n\t";
return out;
}
};


int main(int argc, const char * argv[])
{
std::cout << "Testing...\n\n";
Money m1(1, 2, 3, 4);
Money m2(17, 14, 25, 3); /* Showing that convertion works */
std::cout << m1 << std::endl;

std::cout << m1 + m2 << std::endl;
std::cout << m1 - m2 << std::endl;

std::cout << m1 * m2 << std::endl;
std::cout << m2 / m1 << std::endl;
return 0;
}


Output is pic attached
>>
>>62142045
>and the fact that C can do literally any of the things listed on the left with enough work, "enough work" being an amount of work that C programmers actually do regularly to realize these concepts in C from scratch.
also it's actually not useless, just redundant
you could declare ints as autos instead if you wanted
this would actually be more idiomatic to C because int is supposed to be the "default" type and everything is supposed to be an int unless indicated otherwise and unless there's a good reason to use a different type
>>
https://www.youtube.com/watch?v=3J-m3hMW2Fo
>>
>>62141595
What about 1.1.7 Don't you get?
>>
File: functional-vs-oop.jpg (134KB, 1200x488px) Image search: [Google]
functional-vs-oop.jpg
134KB, 1200x488px
>>
>>62142173
good idea, poor execution
>>
Is there a license I can put my library under that lets companies use it however they please but encourages contributions well?

Or is that generally not needed?
>>
>>62142229

BSD or MIT
>>
Why are OOP defenders so obnoxious? Watch this already:

https://www.youtube.com/watch?v=QM1iUe6IofM
>>
>>62142173
Why is being the left guy supposed to be bad?
Also why is being the guy on the right supposed to be good? He looks like a douchebag.
>>
>>62142173
>>62142328
It makes more sense when done properly.
>>
>>62142364
you don't understand the meme
>>
>>62142251
>eternal triphomo
>retarded and wrong with every post, just as always
Yawn.
>>
>>62142453
>Not correcting someone when they're wrong
Ooh boy
>>
>>62142283

Not an argument.
>>
>>62142508
>Not miscorrecting yourself when you're right so that you can correct the correction
>>
>>62142453

Not an argument.
>>
>>62142548
t. Haskell shill
>>
File: 1500226385787.png (200KB, 2154x2167px) Image search: [Google]
1500226385787.png
200KB, 2154x2167px
>>62142627
Why do trashkell girlmales think it auspicious and reasonable to publish "moan ads" in which they use kode komments to embed videos of themselves moaning in their trashkell source files, so that prospective l33t masc programmer BFs will be l33t enough to uncover them and get hard?

Surely there must be a more efficient way to accomplish the same thing?

It is almost as bad and stupid as their "lamb duhs" in which they use Kode Komments[TM](C)(R) to draw pictures of mentally retarded sheep so that there will be something for their counting algorithms to count before bed.
>>
public class timer {
private int hour;
private int minute;
private int second;

public tuna(){
this(0,0,0);
}
public tuna(int h){
this(h,0,0);
}
public tuna(int h, int m){
this(h,m,0);
}
public tuna(int h, int m, int s){
setTime(h,m,s);
}
public void setTime(int h, int m, int s){
setHour(h);
setMinute(m);
setSecond(s);
}
public void setHour(int h){
hour = ((h>=0 && h<24)?h:0);
}
public void setMinute(int m){
minute = ((m>=0 && m<60)?m:0);
}
public void setSecond(int s){
second = ((s>=0 && s<60)?s:0);
}
public int getHour(){
return hour;
}
public int getMinute(){
return minute;
}
public int getSecond(){
return second;
}
public String toMilitary(){
return String.format("%02d:%02d:%02d", getHour(), getMinute(), getSecond());
}
}
>>
>>62142655
>there is some alternate universe in which this post is considered humoorous
>>
>Define a function that when passed three boolean values, returns true if exactly one of them is true, and false otherwise.
>My solution:
static boolean one(boolean a, boolean b, boolean c) {
if acc = 0;

if (a) acc++;
if (b) acc++;
if (c) acc++;

return acc == 1;
}

>Got marked down for it.

What the fuck was wrong with this code? It compiles, works, and is simple. Why is my marker such a fucking retard?
>>
>>62142729
Woops, replace the if in the second line with int.
>>
File: yes.jpg (95KB, 5000x2000px) Image search: [Google]
yes.jpg
95KB, 5000x2000px
>>62142721
>humoorous
>>
>>62141677
JetBrains Rider.

If using .NET Core *and* you already know C# *and* don't wanna pay for Rider, you can use VSCode.
>>
>>62140954
After failing my Google interview 3 months ago, I am finally starting CTCI.

C++ seems to be used for way cooler projects than Java, but I have to learn Java first because it's easier and there are more jobs. Oh well.
>>
>>62142729
Because returning 1/0 for true/false is bad practice.
>>
>>62142855
Fucking idiot, try actually reading the code before embarrassing yourself.
>>
>>62142891
equating true/false to a number is not good practice, what don't you understand?
>>
>>62142729
You were supposed to do it with boolean logic. The question didn't say that but if you'd been paying attention in class you'd know that's what was expected. If you gave a technically correct answer that's not in line with that expectation, that's reason enough to believe you either weren't paying attention or are a smartass know-it-all, both of which are adequate reasons to mark you down.
>>
>>62142915
Stop posting forever. You're obviously too dumb to know how to read.
>>
>>62142915
yes that sure is a true thing you're saying
however it's irrelevant to the code the other guy actually posted which does not do that at any point
>>
>>62142915
Are you genuinely retarded?
>>
>>62142828
whoops

tumorous
>>
>>62140998
Oh hey I got those same socks in nylon today.
>>
>>62142918
>if you'd been paying attention in class you'd know that's what was expected
t. retarded TA
>>
>>62142729
Highly inefficient use of memory. How dare you allocate memory for a totally needless int!
>>
>>62142918
No where in the course did they hint that they wanted me to use Boolean logic, and yes, I was paying attention.
They asked for a solution, and I gave them one that I think is nice and simple (it was the first I thought of too). They have no fucking right to mark me down when they never even hinted they wanted it to be done with Boolean logic.
This is why I'm mad. There is nothing wrong my my solution whatsoever.
>>
File: yes2.jpg (38KB, 4000x1000px) Image search: [Google]
yes2.jpg
38KB, 4000x1000px
>>62142935
>tumorous
>>
>>62142974
Oh and right after the test, my prac/lecture went over the solutions to the questions, and my exact fucking method was used to solve the same question.
>>
Cleaning up, organizing, and adding a few enhancements to a reporting tcl script at work.
>>
Should I be mad if my grader marks me down on a test everywhere I put T const instead of const T for any type T?
>>
File: thinking.png (6KB, 225x225px) Image search: [Google]
thinking.png
6KB, 225x225px
>>62142982
https://www.merriam-webster.com/dictionary/tumorous
>>
>>62143006
Yes.
>>
How do you guys deal with anger and frustration when you are have a problem programming. I'm still new to programming, but not that new. I am so tired of ripping my hair out when I can't solve a simple exercise program designed for beginners.
>>
>>62143035
What's the problem? I want to laugh at u.
>>
File: djgf.jpg (34KB, 2000x167px) Image search: [Google]
djgf.jpg
34KB, 2000x167px
>>62143010
>it an meme the dip
>>
>>62142974
>There is nothing wrong my my solution whatsoever.
I already told u what the problem was, bro. >>62142963

You just assumed u had infinite memory lol and carelessly allocated it. Rookie mistake.
>>
>>62142051
What font is that?
>>
https://youtu.be/6yU9FjrR2Ig?t=20
/dpt/ approriate
>>
Do someone remember a gif of a japanese who modified his window's bar to put an anime girl sitting on top? actually i would also know how to add graphics to the gui
>>
>>62143035
is it c++ or brainfuck?
i would stop and try it later. its just werks idk why.
>>
Why don't this work?
int doSomething(int arr[][]
{
...
}
>>
>>62142251
I was kinda looking for a presentation of systems that make them contribute.
But I guess I'll just not be lazy and read.
>>
>>62143094
That's called a shimeji. They're actually usually implemented as windowed applications in their own right, but with transparent window backgrounds and borders. No modification to the target window is actually done; the shimeji just knows where to sit by querying the window system for the window's position and positioning the shimeji's window relative to there.
If you want to know more about how to actually make a shimeji, look it up, there are tons of tutorials and such. I'd link you some starter code I wrote for shimejis in Java, but I can't seem to find it.
>>
>>62143118
because you forgot a ')' :^)
>>
>>62143172
Why don't this work?
int doSomething(int arr[][])
{
...
}
>>
>>62143118
In C and C++, arrays are continuous blocks of memory. You can't really truly have an array of arrays, because it does not make physical sense in RAM to allocate a chunk of memory where each word literally *is* another allocated chunk of memory containing multiple words. You just can't fit a space into a space smaller than it. C and C++ can *simulate* this, by just allocating an array the size of the product of the two lengths and giving you syntactic sugar to access it as an array of arrays--or, alternatively, by allocating multiple arrays of one length, allocating an array of addresses of the other length, and storing the addresses of the other arrays in the one array. But the latter approach has a different syntax entirely--namely int *arr[]-- and since the prior approach (int arr[][]) is really just a single array, just a single contiguous undifferentiated block of memory--that's only split up into sub-arrays at compile time and not at runtime, and only in the scope in which it was defined--it's not meaningful to pass an "array of arrays" around without knowing at least the sub-array length.
>>
Hey guys, I am curious, in android/java programming, what alternative can I use to from getters, and setters? I am mostly using them outside of the class to be used in another class (app context, etcc...) but I am hearing two sides, its good practice/its bad practice, its good only when its needed etc..
>>
>>62143187
Ah, okay thanks.
>>
>>62143182
who knows
int thing(int[][] x )
{
return 0;
}

void main()
{
int[][] x;
x.thing;
}
>>
>>62143117
Its Java, and yeah I usually just walk away and figure it out the next day. Its still so frustrating to start a new exercise, spend forever trying to figure it out, give up and look up how to do it on google, copy and paste the solution from google, move on to the next exercise.

I just was to at least boarder line constantly be able to open up a programming problem/exercise and be able to do it without having to copy & paste code from google.
>>
>>62141050
Switch C and Java and I'll be inclined to agree with you.
>>
>>62143142
>as a window
Well in the windows DE everything is a window down to the root window. The desktop is just a window containing more windows.
I'd consider it a bit misleading to just say that they're transparent windows (assuming my idea of how they work is correct). They're just windows that sit closer to the root window than most other windows.

Because window click/command passthrough in windows is a mess. Last I tried at least.
>>
>>62143188
You could just make your member variables public. And access them like object.member. But that's against OOP practices. If you're the kind of loon that minds that.
What are you aiming for?
>>
>>62143188
use getters/setters outside the class. That way you don't break all your code when you change the class (like if u change the name of a variable).
>>
>>62143220
Its mainly just not have bad coding habits.

>>62143243
so I guess I am doing it correctly, since I am using it outside its class. Thanks!
>>
>>62143200
reread every shit again, makes sure you dont miss anything important now.
takes it slowly lad.
>>
>>62143243
There's refactoring tools virtually everywhere.
And if you've changed more than that you want your code to fail to compile.
>>
Hi, /dpt/. I would like to learn to make small applications for a daily driver Linux desktop. Nothing too heavy, just got desktop customization, listening to music, etc. Just to make day to day use more fun and simple for me.

I do not know any languages or how to code beyond a hello world tutorial or two. What language should I start with to accomplish these tasks? I'm assuming Python merely because it seems like a decent portion of the applications I would like to emulate seem to be written in it, but I would love your input.

Thank you, /dpt/.
>>
>>62140998
Let's pair program sometime. We'll refactor that unholy monstrosity of java code you're writing there.
>>
>>62143269
c'mon, bro. there are better excuses for tight coupling out there.
>>
Aren't binary operators inherently transphobic?
>>
>>62141666
Except it's extremely difficult to maintain and structure properly unless you are highly intelligent. People only bitch about OOP because they're not smart enough utilize it properly.
>>
>>62143309
yes, but binary is old and stupid. one day we will have enlightened quantum computers that can hold infinite genders in one quantum bit.
>>
>>62140954
How does this fizzbuzz look? This is my first time fucking around with Scheme and I'd like some criticism.
#lang scheme
(define (divisible-by-3 x)
(= 0 (modulo x 3))
)

(define (divisible-by-5 x)
(= 0 (modulo x 5))
)

(define (divisible-by-both x)
(and (divisible-by-3 x) (divisible-by-5 x))
)

(define (fizzbuzz x)
(cond ((divisible-by-both x) (print "FizzBuzz"))
((divisible-by-3 x) (print "Fizz"))
((divisible-by-5 x) (print "Buzz"))
(else (print x))
)
(display "\n")
(cond ((< x 100) (fizzbuzz (+ x 1))))

)

(fizzbuzz 1)
>>
Which languages must you attain complete mastery of to reach programming Nirvana?
>>
>>62143360
Crystal
>>
>>62143360
Python
Scheme
C
C++
Haskell
Fortran
x86/x64 Assembly
Machine Code

Start from the top and work your way down.
>>
>>62143340
Lisplets will REE because you're new-lining your closing )'s. But it looks fine.
>>
>Ask a question in thread
>Come back to check if I got any (You)s
>There have been two new threads since then.
Jesus this thread/board moves fast.
>>62133212
Please respond
>>
>>62143182
The second dimension needs to be declared. So
int doSomething(int arr[][10]){}
>>
>>62142990
Theres the lie.
>>
>>62143081
GohuFont if I remember correctly
http://font.gohu.org/

I'm currently trying to do follow "The Little Schemer" and am having trouble testing what's being presented.

What am I doing wrong in pic related? How can I not get the errors and still define l as a series of lists with quotations
>>
File: totor.gif (22KB, 398x298px) Image search: [Google]
totor.gif
22KB, 398x298px
I learned a bit of Python3 and FORTRAN. I can make
a simple cyoa game or calculator, etc. Where
do I go from here? I need some sort of intermediate project to do but i'm unsure what's
within my reach. A Tamagachi sorta thing might be cool but ai is confusing.
>>
I'm 26, is it too late to go back to college for programming? I'm thinking about just doing my local community colleges (though in CAnada they're just called colleges) 2-year program. They have a 98% placement rate and you have to do 2 co-ops during that time, which is basically a paid internship.

The next intake is for Winter/January 2018. I was thinking about taking it, and trying to self teach in the 3-4 months before hand. is it worth it or should I abandon all hope? And, what websites are good places to start learning C# or Java?
>>
>>62143580
no its absolutely not too late. caveofprogramming on youtube (lmao) is a pretty good java tutorial if you have never programmed before.
>>
Why does this work:

public class tuna {
private int hour;
private int minute;
private int second;

public tuna(){
this(0,0,0);
}
public tuna(int h){
this(h,0,0);
}
public tuna(int h, int m){
this(h,m,0);
}
public tuna(int h, int m, int s){
setTime(h,m,s);
}
public void setTime(int h, int m, int s){
setHour(h);
setMinute(m);
setSecond(s);
}
public void setHour(int h){
hour = ((h>=0 && h<24)?h:0);
}
public void setMinute(int m){
minute = ((m>=0 && m<60)?m:0);
}
public void setSecond(int s){
second = ((s>=0 && s<60)?s:0);
}
public int getHour(){
return hour;
}
public int getMinute(){
return minute;
}
public int getSecond(){
return second;
}
public String toMilitary(){
return String.format("%02d:%02d:%02d", getHour(), getMinute(), getSecond());
}
}


But this doesn't:
public class tuna {
private int hour;
private int minute;
private int second;

public tuna() {
this(0,0,0);
}
public tuna(int h) {
this(h,0,0);
}
public tuna(int h, int m) {
this(h,m,0);
}
public tuna(int h, int m, int s) {
setTime(h, m, s);
}
public void setTime(int h, int m, int s){
setHour(h);
setMinute(m);
setSecond(s);
}
public void setHour (int h){
hour = ((h >= 0 && h < 24) ? h : 0);
}
public void setMinute (int m){
minute = ((m >= 0 && m < 60) ? m : 0);
}
public void setSecond (int s){
hour = ((s >= 0 && s < 60) ? s : 0);
}
public int getHour(){
return hour;
}

public int getMinute(){
return minute;
}

public int getSecond(){
return second;
}
public String toMilitarytime(){
return String.format("%02d:%02d:%02d", getHour(), getMinute(), getSecond());
}
}
>>
>>62143564
>A Tamagachi sorta thing might be cool but ai is confusing.
You don't need a very complicated AI for a virtual pet. In my experience a Markov model -- not even a trained one, just a manually constructed probabilistic decision tree -- produces behavior that's plenty endearing, so long as you have cute assets
>>
File: file.png (296KB, 1000x1000px) Image search: [Google]
file.png
296KB, 1000x1000px
Just bought pic related with HRA funds that don't roll over. Anyone else going to blow all their cash as we get closer to the end of the year?
>>
>>62143278
C to add features not already available
Python to glue C programs together
>>
>>62143433
The usual way I do is
>run a VM with saved state
>change slight data and figure out what got altered in packets
>try to give meaning to bytes from that
Then I also have this friend who disassembles everything into its straight C translation (with registers and goto) and then builds higher level constructs from that until he somewhat sees what's happening, but I'm not sure it's applicable when REing protocols.
>>
>>62143302
>there are better excuses for tight coupling out there.
Yeah. I'm just going for the most shallow one. Bugs.
>>
>>62143681
how does that work exactly?
do you have to pretend like you have medical expenses in order to get that money?
>>
Guys...does google randomly just access your server too or am I getting paranoid?
IPs 66.102.9.26 and 66.102.9.22 just accessed my server that runs a simple page, however the server access name is long and random. How can they even do this without out knowing the name of it?
>>
>>62144082
>access name
Looks like someone has to learn 2 internet.
>>
>>62144082
>How can they even do this without out knowing the name of it?
because they know the ip address
>>
Anyone here able to write machine code?
>>
>>62144082
Google crawls the whole net to index sites and searches for robots.txt, so yeah, thats ok
>>
>>62144180
yes
which machine
>>
>>62143900
We get around $3000 a year to spend on medical expenses. All the expenses have to be approved by our insurance. I went to a doctor today and asked for a note for an ergonomic chair and she said sure. No pretending needed. Though I guess I could get the reimbursement then return the chair for about $800. Last year I submitted all my expenses to both my HRA and my insurance and basically got paid to go to the doctor
>>
>>62144256
audi
>>
>>62144145
That and english, I am bad at both.
What I meant was I got address:port/AccessName and the AccessName is something long and random. Just totally weird that they look at it now.
>>62144153
Interesting, it's been up and running for over a year and they suddenly just peeks at it.
>>62144252
So it will eventually end up in their search engine?
I wouldn't really like that.
>>
>>62143696

Thank you for the advice, anon. To my limited experience this sounds like a good idea.
>>
>>62143638
Anyone? It doesn't make sense. The main method is:

public class apples {
public static void main(String[] args){

tuna tunaObject = new tuna(5,13,43);

System.out.printf("%s\n", tunaObject.toMilitary());
System.out.printf("%s\n", tunaObject2.toMilitary());
System.out.printf("%s\n", tunaObject3.toMilitary());
System.out.printf("%s\n", tunaObject4.toMilitary());

}

}


The top code in >>62143638 outputs: 5:13:43

The bottom code outputs: 43:13:00
>>
PROCEDURE DoIt() : LONGREAL;
VAR
tmp: LONGREAL;
BEGIN
(* begin argument reduction *)
IF t < 2.4375 THEN
(* truncate 4(t+1/16) to integer for branching *)
k := Trunc(4.0 * (t + 0.0625));
CASE k OF
| 0, 1: (* t is in [0, 7/16] *)
IF t < small THEN
tmp := big + small; (* raise inexact flag *)
IF signx > 0.0 THEN
RETURN CopySign(t, signy)
ELSE
RETURN CopySign(PI - t, signy)
END;
END;
hi := 0.0; lo := 0.0;
| 2: (* t is in [7/16, 11/16] *)
hi := athfhi; lo := athflo;
z := x + x;
t := ((y + y) - x) / (z + y);
| 3, 4: (* t is in [11/16, 19/16] *)
hi := PIo4; lo := 0.0;
t := (y - x) / (x + y);
ELSE (* t is in [19/16, 39/16] *)
hi := at1fhi; lo := at1flo;
z := y - x; y := y + y + y; t := x + x;
t := ((z + z) - x) / (t + y);
END;
ELSE
hi := PIo2; lo := 0.0;

IF t <= big THEN
(* t is in [2.4375, big] *)
t := - x / y;
ELSE
(* t is in [big, INF] *)
tmp := big + small; (* raise inexact flag *)
t := 0.0;
END;
END;

(* compute atan(t) for t in [-.4375, .4375] *)
z := t * t;
z := t*(z*(a1+z*(a2+z*(a3+z*(a4+z*(a5+z*(a6+z*(a7+z*(a8+
z*(a9+z*(a10+z*a11)))))))))));
z := lo - z; z := z + t; z := z + hi;

IF signx > 0.0 THEN
RETURN CopySign(z, signy)
ELSE
RETURN CopySign(PI - z, signy)
END;
END DoIt;
>>
>>62143681

Looks comfy and stylish. Best decision I made for my ergonomics was stealing a few Aerons from one of my jobs.
>>
>>62144352
probably because of this in your second definition

 public void setSecond (int s){
hour = ((s >= 0 && s < 60) ? s : 0);
}
>>
>>62144321
Note that as you said most of the stuff you want probably already exists. First look if well-tested and featured programs are available somewhere. You can use Python to make them start/modify like you want. Then if you really need something new you can think about writing new.
>>
File: .png (3KB, 990x62px) Image search: [Google]
.png
3KB, 990x62px
I have a very poor impression of pycon now. I just wanted to know how AND why data scientists/astronomers use python (because they do, it's popular).
So I found a video: https://www.youtube.com/watch?v=W9dwGZ6yY0k
I'm 13 minutes in and he just said that the software they use to analyse 30TB of data per night is python, and some C++. But the majority is C++.

Why would anyone let this guy talk here? All he's doing is presenting telescopes as if the audience doesn't understand that they're cool tech that does a lot of processing. I just want to know why python is used. I don't see any reason for Python over any number of languages.
>>
>>62144458
I don't get it? Is it not exactly the same as the top one, or does the extra spacing stuff things up? In my experience with Java, spacing has never messed with the output.
>>
>>62144314
>So it will eventually end up in their search engine?
If there is no rebots.txt, then no, it will be ignored by google and other search engines
>>
>>62144549
shit anon its three lines where only one line is actually code, but just to spoonfeed you here your method is called "setSecond" and in it you're setting the value of your field called "hour", so what do you think the problem is
>>
>>62144554
*robots.txt i mean
>>
what the best way to write a regex that doesn't match x [^x] but must include y [y] ?within a wider context

can I do something like [^x|y]+ ?
>>
>>62144565
Excellent, I don't want my hobby stuff to be viewed by others.
>>
>>62143200

what are you trying to do? what seems to be the problem? and desu googling is most of a programmers job.
>>
>>62142051
You should probably integrate a rounded number, one that's rounded down to the nearest actual denomination.
>>
>>62144548
because python is a lot easier than c++ and other OOP languages
that's the only reason
>>
Post good jokes. I'll start:
>Commercial software written in Lisp
>>
>>62144694
https://franz.com/success/
>>
>>62142051
What's the point of multiplying or dividing two money amounts? What does that even mean?
>>
>>62143188
You can try project Lombok - https://projectlombok.org/features/GetterSetter
Or kotlin.
>>
>>62144726
>what are ratios/%
>>
>>62144731
Oh, I guess that makes sense... I was thinking in terms of money only.
>>
>>62144500
To paraphrase, for clarity, I could find repository of a program that I want to work with, clone it, see what makes it tick and then make changes to it?

Thank you for the hand holding. Figuring out where to jump in to development is an confusing entry barrier in and of itself.
>>
Is there a single GUI toolkit that won't make me want to kill myself?
>>
File: .png (165KB, 733x504px) Image search: [Google]
.png
165KB, 733x504px
>>62144684
>because python is a lot easier than c++ and other OOP languages
Python is a lot more complicated than tons of other languages and just because something is easier than C++ doesn't mean its good or good enough. It says nothing.
Why you'd need OOP for data science is beyond me. For any statistical work it tends to be very forced at best.
It's not an explanation. At best it's a motivation for the fit. Which I don't see. Virtually nobody used python before the mid 00's and it doesn't have the advantage of adoption at all.
Look at https://en.wikipedia.org/wiki/Timeline_of_programming_languages#2000s
and the 90s. There's no way Python is somehow more fit for scientists than a declarative language like haskell. Or a language that both the library authors and the users could use like D which doesn't have all the hassle of bindings. He even quoted a guy who's addressing the disparity between 'developers' using languages other than python while astronomers don't as a problem. But he's kinda sly and framed it as if everyone should move to Python.

He's also presenting advantages like pic related. This has nothing to do with python at all. It's such a silly talk.

I just wanted to know why they use python. I'm sorry your answer isn't sufficient. And I'm not even directing this at you, sorry. I'm just ranting.
It's just very frustrating to have a question and have a guy waste my time for 30 minutes while he's saying nothing to aid that.

The best he said was a point "Simplicity and dynamic nature". By dynamic nature he means that it's fit to exploratory design (which it isn't, it's quite terrible at that actually). Simplicity was just him pulling the "it's pseudocode but executable!" as an augment for it being an intuitive platform. Which just isn't true.

Worthless conf. Even if I can just buy all his claims he has said next to nothing about how python fits aside from being able to use CFFI.
>>
>>62144804
suicide.js
>>
>>62144804
>GUI toolkit that won't make me want to kill myself?
Depends on your goal. I use imgui and similar libraries. I haven't found one that does desktop environment looking windows with buttons.
>>
>>62144822
I'm absolutely certain that the reason I've given is the correct reason.
If you don't see how python is a thousand times simpler than Haskell, then I think that is the reason why you don't understand the answer I've given.
>>
C89, C90, C99, or C11?
>>
>>62144900
C11
>>
>>62144900
why not use the latest standatd?
>>
>>62144930
compatibility
>>
>>62144900
>C89, C90
These are the same thing.
Of course, you should always pick the latest one.

>>62144945
Compatibility with what? Don't let assfuck retards like microsoft use you from using the progress C has made over the last 20 years.
>>
>>62144900
GNU11 YOU FOOL
>>
>>62144635
instead of randomly including your failed patterns with a small bad explanation on what you want, how about you give samples of what you want to match and not match and go from there
>>
>>62144562
It turns out I'm massively retarded and have an eyesight problem. Maybe I'm not cut out for this programming thing.
>>
>>62144859
>If you don't see how python is a thousand times simpler than Haskell
I don't think you understand how fitted Haskell is to academia.
>>
>>62145029
why people here hate Haskell so much? is it because you need to think instead of copying code from other projects?
>>
>>62144694
They have some legacy stuff from the 80s still going go.
>Open Source software written in Lisp
is funnier.
>>
>>62145029
>how fitted Haskell is to academia.
that is neither here nor there
>>
>>62145014
I literally read it 5 times before I saw the error as well
Your brain just expects certain things to be correct and critical information gets skimmed over
It's normal, don't worry
>>
>>62144945
there were no breaking changes afaik
>>
Making a simple program that takes a text file and creates a new file with the same text and then calculates the cpu time and real world time to complete said task.
>>
>>62145270
sounds like a one liner in bash or python
>>
..tf
>>
>>62145014
The real problem is that you're watching thenewboston's tutorial, and he over-complicates the fuck out of things there. Find a different guide.
>>
Is it worth to learn Perl in current year?
>>
>>62145604
Only if you're going to support some legacy stuff, otherwise no.
>>
>>62145607
>Implying Perl6 isn't crazy cool
Sit son, I'd learn Perl just for its grammars
>>
>>62145080
Emacs
>>
>>62145651
Emacs is written in C though.
>>
>>62145670
Emac's runtime is larger than the VM and is written in LISP.
>>
>>62145670
The core is written in C but it is basically just an elisp interpreter.
>>
>>62145651
Ok, I rephrase my joke
>Open Source software written in Lisp since the 1980s
>>
>>62145702
maxima
>>
>>62145622
Why is there so much hype around Perl 6? Is there new revolutionary features in it?
>>
>>62145702
Also if you include scheme into lisp then there's App Inventor for Android
>>
>>62145726
>since the 1980s
>>
>>62145750
The grammars are pretty awesome. Its concurrency model is very well thought out. And the VM is insanely well optimized when it comes to strings.
There are probably other reasons I do not know about (I never wrote a single line of perl in my life).
>>
>>62145750
> Why is there so much hype around Perl 6?
Where?
>>
Is Pearl worth learning lads?
>>
>>62145851
Larry pls... Stop shilling your dead language.
>>
>>62145858
genuinely curious though.
>>
>>62145867
If you want to become sysadmin. It's mostly used for scripting on linux.
>>
>>62145750
It's actually very interesting.
It's like they got high off Haskell and Lisp and started to rewrite Perl from scratch. It has macros, something that is very close to Haskell style type signatures, currying, pattern matching, etc.

>>62145851
Sadly... I'm not so sure. It depends on what you are doing. When I was a Sysadmin, I much preferred Perl to Python for Linux scripting and automating.
>>
>>62145867
>>62145851
Perl really is a dead language.
All of its uses have been supplanted by things like memesnek.
It only exists in legacy applications these days.
>>
So I've made a PR on github and the owner requested some minor changes. Can I just amend my commits and force push them in the branch on github? Will the PR be updated automatically?

I'm asking because I've read it's not recommended to rewrite history with force push once you've published the brunch.
>>
>>62146031
why would you ever force push
>>
>>62146048
Because I don't want to make a separate commit just to fix a typo.
>>
>>62146031
force push works in PRs, I have done it once already, but it's best to avoid doing it like >>62146048 suggests
>>
>>62146058
no problem
make a small improvement or update and also fix the typo in one commit
then the commit message can be
>Implemented xyz
instead of
>fixed a typo
>>
>>62146058
>Because I don't want to make a separate commit just to fix a typo.
Don't worry about it. People typically don't mind those sorts of things.
>>
>>62146094
What if I made a typo while implementing this improvement? It looks like a slippery slope.
>>62146105
I was been asked to tidy up history in a branch before making a PR once because it was full of small typo-like commits.
>>
>>62143528
you need to do (quote (((hotdogs))) ), or '(((hotdogs))). This will make scheme read the (((hotdogs))) as an object, rather than an expression. Right now it's trying to call (quote hotdogs) as a function, because you're using the syntax (<function> <arg> ...), where in this case <function> = (quote hotdog), and there are no arguments

Btw the ' means "wrap the following thing in (quote ..)'
>>
>>62146142
>What if I made a typo while implementing this improvement? It looks like a slippery slope.
>I was been asked to tidy up history in a branch before making a PR once because it was full of small typo-like commits.
At that point, histroy-rewriting would be appropriate.
Typically, people will git rebase on personal copies of a repository. Once it hits 'master', then it shouldn't be messed with.
It would be fine to do it on your PR.
>>
>>62146237
Sometimes maintainers will squash your commits before merging your PR, but I guess they must just be lazy to make you do that instead
>>
def de_dupe(a_list):
proxlist={}
ret_dic=[]
for prox in a_list:
prox = prox.split(':')
proxlist.setdefault(prox[0], []).append(prox[1])
for items in proxlist.items():
ret_dic.append(items[0]+':'+items[1][0])
return ret_dic

de-dupe's proxy lists
for some reason they almost always include the same IPs with different ports
>>
>>62146425
>'s
>'
rip
>>
When learning your first programming language from scratch what is the order of things you should learn? Is there an accepted curriculum you could follow for all languages?
>>
>>62146453
Just read books and do all the exercises.
>>
>>62146453
pretty much, yeah
>hello world
>variables
>branching
>loops
>arrays/basic data structures around here somewhere
>functions
>>
File: 16427455.jpg (62KB, 960x864px) Image search: [Google]
16427455.jpg
62KB, 960x864px
How do I use lambdas?
#include <iostream>
using namespace std;

int main() {
cout << []() -> int { return 200; } << endl; // prints 1
}
>>
>>62146528
Can you just put the parens on the end of lambda in see plus plus to call?
>>
>>62146528
didn't you forget to call it?

cout << []() -> int { return 200; }() << endl;
>>
>>62146528
<<[]()->{}<<;
fucking sepples
>>
>>62146543
O yea
Thanks
>>
>>62146528
theyre just on the fly functions, desu.
>>
>>62146528
You forget to actually call it:
int main() {
cout << []{ return 200; }() << endl; // prints 1
}
>>
>>62146549
Comment are awful. You edited the code and the compiler doesn't even complain about this.
>>
>>62146528
#include <iostream>
using namespace std;

int main() {
cout << []() -> int { return 200; }() << endl; // works
}
>>
>>62146545
actually it's << []() -> {}() <<
>>
>>62146528
trailing types are absolute cancer
>>
File: 1503731985464.jpg (273KB, 1920x1440px) Image search: [Google]
1503731985464.jpg
273KB, 1920x1440px
>>62146624
>>
>>62146637
function pointer syntax is the grossest part of C
>>
>>62146637
https://cdecl.org
>>
I'm working on an interpreter for a language similar to brainfuck and I want to implement syscalls. How would you proceed, /g/?
I'm thinking about adding an instruction like syscall(arg_count, arg_type, arg, arg_type, arg, ...) with each argument being in its own cell but I feel like it would be a lot of work to manually write programs using this method.
>>
>>62146663
Pointers in general are handled badly. C was designed to be terse and easily parsed at a time when using your computer cost you money in printer paper, not to be easy to read.
>>
>>62143324
>people only bitch about oop because they're not smart enough to use it properly
no, people bitch about oop because nobody else is smart enough to use it properly.
the argument of "i don't need any libraries, i'll just write everything myself" is obviously lost very quickly on languages that can't do syscalls (effectively, without native libraries).
it's made clear that this is the case by java's lack of operator overloading, an abstraction it basically does have with strings (they're even optimized out if they're compile-time constants) but it lacks for users because in c++ the babbling retards use them so heavily that the code they excrete can become unreadable to literally anyone.
it's funny too, because operator overloading generally has a lot more ABSTRACTION capability than oop, which is really just first class functions for methods at best (using it as anything more is any easy method to do it The Wrong Way).
>>
>want to try to learn programming again
>realize I have no idea what I would actually make with it
>already hate web shit
what do
>>
>>62146683
You're right. C's type system is very inexpressive, there's no way to know if int* is null or not, if it's a single value or an array, etc. That's always irritated me. It's nice to write a function signature that perfectly explains out the interface to that function.

Still. It's terse.
>>
>>62146711
Make games. First stupid games where you have to guess a number, then clones of simple games such as pong, snake or tetris. Once you can do these games you're able to learn to make anything.
>>
>>62146723
Seriously, I don't know why people keep making new systems languages outright. All everyone actually wants is to write C with less shitty syntax and grammar. That shit would spread like wildfire.
>>
>>62146696
>OOP is just first class functions
Real (smalltalk) OOP is more than. First class classes are a thing. You wouldn't find that in C++ but when you have them OOP makes more sense.
General OOP (the kind you find in C++, that's the kind everyone actually writes) is generally for people who don't know anything else.
So it's easy to see why they defend it. Having absolutely no idea of what systems can be like except for their meager imperative code when they were learning and OOP certainly makes OOP seem like a very good option.
>>
>>62146736
what's a good source for how to make interfaces then? just terminal shit would be fine, but this part is what loses me
>>
>>62146754
There are some good things about Rust. Error handling and enums in general are comfy, for example.
>>
>>62143528
It has to do with evaluation, typing ((hotdogs)) at the REPL tells lisp to evaluate the call to the procedure hotdogs once (hotdogs) and then whatever that call returns evaluate it as a procedure call itself, I'll give an example of an environment where such a call is permissible/possible:

1 ]=> (define (hotdogs)  (lambda () (display "Hello, world")))

;Value: hotdogs

1 ]=> ((hotdogs))
Hello, world


So any list will be treated as a procedure call or a special form by lisp, unless you tell it not to, and say this is a list do not evaluate it as a procedure call, the way to do that is to quote it, the whole thing

1 ]=> '(((hotdogs)) (and) (pickle) relish)

;Value 13: (((hotdogs)) (and) (pickle) relish)
>>
>>62146754
Syntax is not the only thing wrong with C. Header files, forward declaration, shitty type system should all disappear if you bother creating another programming language.
>>
>>62146786
Printf is all you need. Don't bother adding fancy sutff like colors, black and white is fine.
>>
File: party.jpg (40KB, 600x684px) Image search: [Google]
party.jpg
40KB, 600x684px
>>62146795
>>
>>62146815
Please learn and use C before comparing it with Go shit
>>
>>62146815
It'd funny how Go feels closer to C than Rust even though Rust is definitively closer to C than Go will ever be.
>>
>>62146795
I was with you until
>shitty type system
>>
>>62146831
>shitty type system
Not that guy but what's OK about it?
>>
>>62146764
i can't honestly disagree, but the definition of oop really has changed, if you said the acronym to >99% of programmers today they would think of java (or at least c++).
it is a sad day, in many ways, because the day belongs not to the meek but another.
i still think people want forth, they just don't know it.
>>
File: QTWthpq.jpg (114KB, 1190x1698px) Image search: [Google]
QTWthpq.jpg
114KB, 1190x1698px
>>62146815
>he considers Go a valid alternative to C
Wew, lad.
>>
>>62146831
Well I won't blame you, even though I feel like any new languages should strive for something better I really like what it enables.
But it's the same reason I like dynamically, weakly typed languages. It lets me do disgusting and fun things that shouldn't be done in any real program.
>>
I'm reading the book "Expert C Programming: Deep C Secrets" and the author says that this is not a strictly confirming program and I don't know why.
#include <limits.h>
#include <stdio.h>

int main() { (void) printf("biggest in is %d", INT_MAX); return 0; }

It also says
>Furthermore, a conforming compiler must compile and execute a program in which all the limits are tested at once. A surprising thing is that these "required" limits are not actually constraints - so a compiler can choke on them without issuing an error message.
which I don't understand.
>>
>>62146849
No like C has proper generics either.
>>
>>62146875
>No like C has proper generics either.
>"proper"
Looks like you had to qualify that statement with weasel words.
It's basically a non statement without qualifying.
>>
>>62146878
Well, then Go has generics with interface{}.
>>
File: EVc3Nm0.png (427KB, 770x478px) Image search: [Google]
EVc3Nm0.png
427KB, 770x478px
>>62146875
The image wasn't my point in this case.
>>62146878
void* and interface{} is basically the same shitty way to do generic code.
>>
>>62146901
>if err != nil
better than exceptions
>>
>>62146901
>The image wasn't my point in this case.
posting it was funny decision then
>>
>>62146867
I don't fully understand the sentence, but it appears he's saying that you shouldn't rely upon the defined limits like INT_MAX because they may be inaccurate

though in practice, everyone does
>>
>>62146929
At least with exceptions you don't have to litter your code with `if err != nil` every other line, you only have to write error handling once. But yeah, both are unsafe shit and inferior to Haskell/Rust-style monadic error handling.
>>
What's the most alive BASIC nowadays?
>>
>>62146967
vb.net?
>>
>>62146967
easy
the flavor of BASIC found on TI graphing calculators
>>
>>62146867
>
int main()

I find it very silly that he'd write this kind of code in an example program for newbies ('experts').
>>
>>62146966
Hidden return values and hidden execution paths are far worse than boilerplate.
> But yeah, both are unsafe shit and inferior to Haskell/Rust-style monadic error handling.
Yep.
>>
>>62146975
>>62146977
something crossplatform maybe?
>>
>>62146987
tough one
BASIC doesn't really strike me as a cross-platform faimly of languages
I think your best bet actually would be vb.net because you can run it on all kinds of systems thanks to mono
>>
>>62146987
There are a lot of free basics, like, hm, FreeBasic, Gambas and such.
>>
>>62142173
>Speaks less than 100 words a day
>Thinks his life will get better after graduation
>too scared to ask for refunds
you got me
>>
>>62142173
nah
my hair looks fine...
>>
>>62141472

if SICP is too difficult for you, you can always go the HtDP route.

https://www.edx.org/course/how-code-simple-data-ubcx-htc1x
>>
>>62143197
x.thing

Is this bait>
>>
File: 1499912330155.gif (948KB, 200x200px) Image search: [Google]
1499912330155.gif
948KB, 200x200px
Daily reminder to program in Python
>>
>>62147256
ufcs
>>
>>62147372
I want to hurl. Parenthesis dropping is absolute hell.
>>
>>62147416
its really not, especially when chaining functions.
x.thing.thing2.thing3

is much cleaner and nicer than
x.thing().thing2().thing3()
>>
>>62147435
that just looks like a bunch of nested structs.
invoking a procedure, especially a function with side effects like writeln, should be explicit. It's not a data member.
>>
>>62147435
No, it's not, it's extremely confusing, I want to see the difference between calling a method and accessing a member.
>>
>>62147475
>between calling a method and accessing a member.
its the same thing for a single arg, although parenthesis can be there if you want.
>>
>>62147505
not if there are side effects
>>
>>62147505
> parenthesis can be there if you want.
It's nice, but who the fuck thought making them optional is a good idea?
>>
>>62146795
There's a whole science of type systems, and its relation to reliable software, you're an idiot anon.
For what it is C is just perfect, small compact and permitting modular architecture with means to both implement high level data structures and algorithms and to access low level hardware, to appreciate the elegance and minimalism of C take a look at the BSD implementation of the shell utilities, the regexp engine, it is a thing of beauty, truly.
If I ware to choose just two languages to take with me to a deserted Island I'd take C with a lisp that can communicate with it, if just one is permissible then C it is, and I'll implement lisp on top of that.
>>
>>62147435
in racket
(send (send (send object method <arg ...>) method <arg ...>) method <arg...>)

can be rewritten as
(send* object 
method <arg ...>
method <arg ...>
method <arg ...>)


i like racket.
>>
>>62147511
nani?
Parentese dropping is only for single args.
Or else you'd need (x,y).thing
>>62147527
like i said, its nice if theres only a single arg. Implicit use through context makes sense once you start actually using it. But everything is heresy if its foreign.
>>
>>62147530
> If I ware to choose just two languages to take with me to a deserted Island I'd take C with a lisp that can communicate with it, if just one is permissible then C it is, and I'll implement lisp on top of that.
Go home, rms, you're high on feet fungi.
>>
crystal is a good language it's like c++ but minus the way too many ways to do the same thing and plus sophisticated type inference that makes it feel like you're using a dynamic language and simplistic ruby style syntax that lends itself to embedded dsls
>>
>>62147543
Yeah functional style stuff like that is really nice.
>>
>>62147564
>makes it feel like you're using a dynamic language
Shame.
>>
>>62146980
Is it windows or autism anon.
>>
>>62147558
he has a point though, a lisp dialect is the easiest kind of language to write and c is the most performant language to write it in
>>
>>62147564
>a language with GC
>it's like c++ guys
This meme has to stop.
>>62147543
>>62147574
It's not "functional" or even new, it's basically `;` from Smalltalk-80.
>>
>>62147580
it doesn't have to though because unlike in a dynamic language you can always be explicit with types if you want to and it won't slow anything down because checking is done at compile time
>>
>>62147590
I agree on Lisp being one of the easiest to implement and C being the most performant, but neither of these make means the language in question is any good: brainfuck is trivial to implement and assembler theoretically outperforms C, but I wouldn't use either for a non-trivial project.
>>
>>62147613
>This meme has to stop.
it's true though
it's an object oriented imperative language that's implemented in C and compiles to native code
C++ is also an object oriented imperative language that's implemented in C and compiles to native code and there aren't many others in common use to speak of
>>
>>62147653
yeah but Lisp is also trivial to read, write, and understand, whereas brainfuck fuck ur brain
>>
File: mxpuuyne.png (241KB, 346x413px) Image search: [Google]
mxpuuyne.png
241KB, 346x413px
Currently returning to my coding endeavors. I have a small experience with C, C++ and Python. I will keep exercising theses languages as well as learning Java, which IDE should I get for my Uni projects?
>>
>>62147682
No IDE while you're learning.
>>
>>62147658
GC is much more important characteristic of a language than the PL its compiler is implemented in or the target machine it compiles to. This way Crystal is much closer to D or Java than to C++.
>>62147672
>yeah but Lisp is also trivial to read, write, and understand
Respectfully disagree x 1
>>
>>62147713
should I just get visual code and run the codes using plugins?
>>
>>62147720
>This way Crystal is much closer to D or Java than to C++.
yeah but D is barely hanging onto notoriety by a thread despite being a good language and Java compiles to virtual machine bytecode so it's basically an overpowered scripting language
>>
File: bmg.png (65KB, 645x366px) Image search: [Google]
bmg.png
65KB, 645x366px
>>62147759
> Java compiles to virtual machine bytecode so it's basically an overpowered scripting language
I bet Java outperforms whatever native code Crycal compiler generates, especially if you consider that the main thing that holds both of them back is GC, something Java folks have been improving for 20 years.
>>
New thread:

>>62147863
>>62147863
>>62147863
>>
File: zez.png (108KB, 1920x1080px) Image search: [Google]
zez.png
108KB, 1920x1080px
>>62147803
>I bet Java outperforms whatever native code Crycal compiler generates
Actually Crystal is much faster than Java. It's faster than Go, and Go is faster than Java, so there you go. Granted, pictured here is only a single design problem being tackled, and the graph is being shown from a biased source (the Crystal project itself), but if you search for yourself "is go faster than java" you'll find the general consensus is that it is, and if you search for yourself "is crystal faster than go" you'll find the general consensus is that it is. (I just did this myself just now to make sure.) However, if you search "is crystal as fast as c," which it claims to be, you'll find it usually isn't, actually.
Thread posts: 314
Thread images: 36


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