[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: 322
Thread images: 25

File: fsharp256.png (3KB, 256x256px) Image search: [Google]
fsharp256.png
3KB, 256x256px
/dpt/ - Daily Programming Thread
F# edition

What are you working on, /g/?
Previous: >>57050025
>>
>>57055624
Thanks, mate.
>>
What's the best programming language and why is it C++?
>>
>>57055656
Python <=|:^)
>>
>>57055656
PHP of course
>>
>>57055666
t. pajeet

enjoy your whitespaces being semantic elements

>>57055674
I said programming language, not script crap you fucking idiot
>>
>>57055686
Scripting langugaes are programming langugaes anon. You need to go back to school.
>>
http://en.cppreference.com/w/cpp/language/reinterpret_cast
>When a pointer or reference to object whose dynamic type is DynamicType is reinterpret_cast (or C-style cast) to a pointer or reference to object of a different type AliasedType, the cast always succeeds, but the resulting pointer or reference may only be used to access the object if one of the following is true:
>...

http://en.cppreference.com/w/cpp/language/type#Dynamic_type
>If some glvalue expression refers to a polymorphic object, the type of its most derived object is known as the dynamic type.

http://en.cppreference.com/w/cpp/language/object
>Objects of class type that declare or inherit at least one virtual function are polymorphic objects.

I understand this to mean that instances of ordinary trivial structs are not polymorhic objects, which means that they do not have a dynamic type.
Does this mean that i can cast pointers between trivial structs without violating the strict aliasing rule?
>>
File: 1476217413290.jpg (278KB, 1200x675px)
1476217413290.jpg
278KB, 1200x675px
>>57055686
Don't compare me to those java using pooskins.
>>
>>57055705
Those aren't actually over head electricity cables. It's a enterprise java programmer mapping out his class dependencies.
>>
File: 1476283799012.png (617KB, 1280x800px) Image search: [Google]
1476283799012.png
617KB, 1280x800px
>>57055714
Kek
>>
>>57055706
>You can reinterpret cast any pointer to any other kind of pointer. But that is undefined behavior.
Yes, but i'm trying to figure out a way (if there is a way) to interpret one struct as another struct WITHOUT invoking undefined behaviour.
>>
>>57055623
>

Kh7 e4
Kh6 e3
Kh5 e2
Kh4 e1Q
>>
>>57055631
Reading "Programming In Scala 3rd Edition" as I'm applying to a Scala job soon.
I really like Scala since it gives me some nice syntactic sugar that I felt was missing in C#.

I really never got into F# after having used Haskell for a while.
But it looks comfy from what I've seen.
>>
>>57055737

Just so you know, undefined behavior doesn't mean "everything's broken, nothing works". It just means that... well... there is no possible way to convert any two arbitrary structs in a way that will be well-defined on every platform.
>>
>>57055852
>I really like Scala since it gives me some nice syntactic sugar that I felt was missing in C#.
You've made a terrible mistake
https://www.youtube.com/watch?v=uiJycy6dFSQ

F# is basically the not-completely-fucking-broken version of Scala.
>>
>>57055852
>since it gives me some nice syntactic sugar that I felt was missing in C#
Like what?

I've never really used Scala.
>>
>>57055898
Monads in the category of third order functors over abelian groups.
>>
>>57055910
Oh.

Looks like I have no need for Scala then.
>>
>>57055898
Pattern matching, actual tuples, case classes (automatically creating getters and setters), curring of functions.
C# is definitely moving in this direction but it will take a couple of released before it's completely there.

I'd prefer Scala worked on .NET now instead of jvm because of all those dotnet core goodies lately.
>>
>>57055918
Why not switch to F# then? it's got all that shit and is a much better language than scala regardless.
>>
>>57055875
I was told undefined behavior would render my entire program meaningless and cause demons to fly out of my nose.
>>
>>57055927
I'm applying for a developer position right now where they need C#, Go and Scala devs.
>>
>>57055933
I don't like this meme. I find this video much more educational.

https://www.youtube.com/watch?v=443B6f_4n6k
>>
>>57055927
>>57055935
F# might be a better language but in the end I think MS would rather just put FP features into C#.
>>
>>57055941
>but in the end I think MS would rather just put FP features into C#.
??

F# already has all those features. C# has been slowly picking features out of F# to use since 2006.

>>57055935
Learn F# and convince them that Scala is shit. Go is a bit of a meme language too. I would have my doubts about how intelligent everyone there is. I'll bet there's a manager or lead developer who gets excited about every new meme technology that comes out and tell everyone everything must be rewritten in Go/Scala etc.
>>
>>57055933

Any C or C++ program of sufficient size will inevitably involve undefined behavior. The question to ask is how well defined is it on the platforms you want to support.
>>
>>57055958
>F# already has all those features. C# has been slowly picking features out of F# to use since 2006.
Yes and now that dotnet has been open sourced they are coming into C# faster it seems.

>Learn F# and convince them that Scala is shit. Go is a bit of a meme language too. I would have my doubts about how intelligent everyone there is. I'll bet there's a manager or lead developer who gets excited about every new meme technology that comes out and tell everyone everything must be rewritten in Go/Scala etc.
I'm gonna work on something that already exists and I don't want to take responsibility if anything fucks up.
>>
>>57055958
Alright, at this point you're just being autistic.

>Learn F# and convince them that Scala is shit.
Yep, that's going to go well.

>So...you don't know Scala? That's the position we're hiring for.

>B-but I've just explained to you thoroughly that F# is better! You must completely refactor any major Scala code-bases to use F# instead and hire me!
>>
>>57055978
>Yes and now that dotnet has been open sourced they are coming into C# faster it seems.
that makes no sense. C# has been an open spec since 2001.

Also all the features C# took from F# don't work nearly as well as they do in F#.

>So...you don't know Scala? That's the position we're hiring for.
I mean after you've become a productive and trusted member of the Scala team. Obviously I'm not being entirely serious anon.
>>
>>57055958
>Learn F# and convince them that Scala is shit. Go is a bit of a meme language too.
how to spot a neet
>>
>>57055998
It's true actually. I'm only unemployed due to illness though. I do mobile dev usually in non-meme langugaes.
>>
>>57055993
>Also all the features C# took from F# don't work nearly as well as they do in F#.
That doesn't really matter. People and companies want FP features in C# rather than switching to F# as C# already works for them.
>>
>>57055993
>that makes no sense. C# has been an open spec since 2001.

Difference between open specification and open sourced. Right now, the official Microsoft .NET runtime and C# compiler are both free as in freedom. Implementing new features, performance improvements, and bugfixes may be much easier now that Microsoft has an army of unpaid Linux hackers combing through their codebase.
>>
>>57055973
Not only the platform but also the particular optimizations any given compiler performs on any given optimization level. This means i'll pretty much have to analyze the entire assembly code any program to be able to reason about a programs behaviour, which makes C/C++ virtually worthless.

This must be why every EA game randomly crashes.
>>
>>57056020
>
>>
>>57055993
>I mean after you've become a productive and trusted member of the Scala team. Obviously I'm not being entirely serious anon.
Scala isn't a shitty language, and it's not deprecated either.
I might consider F# if they were replacing a 50 year old cobol application but not an application that's maintainable and working well.
>>
>>57056020

EA games randomly crash because EA developers are shit. Not necessarily due to the undefined behavior in the language they are using.
>>
>>57056011
>People and companies want FP features in C# rather than switching to F# as C# already works for them.
I completely agree. But if a company is seriously considering something memely like Scala, they might as well use F# instead.

>Difference between open specification and open sourced.
not in terms of adding language features. The C# language spec in completely controlled by MS. Features are only added by MS. The compiler may be open course, but they cannot add new language features. This is why mono made their own C# compiler but could not add language features.

F#, in contrast, is all hosted on GitHub and they routinely accept langugae features as pull request from the community. C# doesn't do this.
>>
>>57055736
Oh my god. Is that real? Please tell me it's real.
>>
>>57056041
the games are probably buggy because they have to crank out a new one every year and "crashes somewhat less" is not something you can tout on the box
>>
>>57056055
It's real anon
>>
>>57056052
Microsoft implements C# features by what people votes. Like Unity3D does.

And I think a reason they chose Scala might because they have a lot of in-house Java libraries they wanted to keep using.
Or they have some other reason. I don't really know.
>>
>>57056075
>Microsoft implements C# features by what people votes.
I know. That's not the same as letting people directly submit pull requests, or even have long discussion threads with the MS developers about what should be added. C# certainly listen to what developers say they want, but it's not as open as F# in terms of development of the langugae spec.
>>
>>57056040
>Scala isn't a shitty language
yes it is. It's an abomination.
https://www.youtube.com/watch?v=uiJycy6dFSQ

posted the wrong link before, woops
>>
>>57056089
But Microsoft are still adding those features I want. I don't really care about them listening to the community now that people can fork dotnet.
>>
>>57056052
>>57056089
Couldn't you literally just take the entirety of C#'s compiler source, rename it as something else, and add your own features?

It's MIT-licensed, which pretty much means you can do anything with it except blame the creator for problems.
>>
>>57056095
>But Microsoft are still adding those features I want.
I was just responding to your point about C# being open. The langugae spec is not particular open apart from the fact that anyone can implement the spec, but that's it.

>I don't really care about them listening to the community now that people can fork dotnet.
People can't fork .NET and add new features. That's illegal under the licensing, they can be sued. This applies to everything, the compilers, the run time etc.
>>
>>57056101
>Couldn't you literally just take the entirety of C#'s compiler source, rename it as something else, and add your own features?
No, you'd be sued for patent violation, and maybe some other legal shit. The code itself is MIT, but your not legally protected if you start changing the type of code it can run.

You can't just copy the .NET run time and compiler, add some runtime and langugae features and then make it so it can't run normal IL output from official MS compilers and then start selling it commercially as a competitor to .NET.
>>
>>57056110

>people can't fork .NET and add new features
It's licensed under a combination of MIT and Apache 2 licenses. Yes, they can fork .NET, and they can modify it, and they can redistribute it all they damn well please. In fact, they can even go so far as to re-license it as GPLv3 software if they so wish to.

And no, I'm not talking about Mono. The official, Microsoft .NET runtime, including the Framework Class Library and CoreCLR, as well as the C# compiler, are all free as in freedom. Have you been living under a rock this past year or so?

>>57056128

>You can't just copy the .NET run time and compiler, add some runtime and langugae features and then make it so it can't run normal IL output from official MS compilers and then start selling it commercially as a competitor to .NET.

That is literally what the MIT license allows you to do. It is an explicit permission to use, modify, and redistribute verbatim, as long as Microsoft is given credit for having made the .NET runtime with which you based your software. Patent or no patent, you have their explicit written consent to do so.
>>
>>57056110
>People can't fork .NET and add new features. That's illegal under the licensing, they can be sued. This applies to everything, the compilers, the run time etc.

I think you have a bit of a misunderstanding of some of the facts.

The .NET Framework is not open-source. Of course you can't fork it.

C#'s compiler, Roslyn, is open-source and MIT-licensed. You could copy all of the code, modify it as you please, and re-sell a compiled version of it as another product/language and make money from it. You could also make this project open-source and make money off of the support. Your only restriction is to keep the original license with substantial portions of the code.

This goes for the Mono .NET implementation, .NET Core, and I believe most of Xamarin's components as well, as they are all under the MIT license.
>>
>>57056150
>It's licensed under a combination of MIT and Apache 2 licenses. Yes, they can fork .NET, and they can modify it
You're not hearing me. They can modify it, but they can't change the langugae spec or the IL spec. That will violate the terms under which the IL and C# spec are made available for anyone to use. Anyone can write a C# compiler from scratch if they want, they can't write a C#++ compiler because they can be sued by Microsoft. it has nothing to do source code licences. Much like you can' just code your own H264 codec and start distributing it for free. Your source code may be MIT, but you're still violating patents at the very least.
>>
>>57056151
>modify it as you please
Like i said, no you can't. There are restrictions not related to the source code licence.

see >>57056179
>>
File: lua.gif (5KB, 256x255px)
lua.gif
5KB, 256x255px
>>57055631
Why did you fags never tell me about Lua?

It's based.

Programming in Lua 4th Edition comes in the mail today. It's gonna be sweet.

Tell me what you know about Lua. I am going to be using it to make Minetest mods on Windows, Linux, and OS X.
>>
>>57055705
Is that picture from Cuba? I heard that in Cuba there is next to no internet infrastructure but that the political climate is allowing for people to build network wide networks with Ethernet cables.
>>
>>57056179
>>57056189
Of course you can't change the official C# language spec, or call it C#.

You'd be creating another language to compete with C#, based on the source code of C# and its components.

Nothing illegal about that as long as you leave any copyright notices and licenses where they are and add your own.
>>
>>57056207
>based on the source code of C# and its components.
so long as it does not resemble C# sufficiently, that's fine, But you can't just take the C# compiler and start adding features to the langugae.

MS grant patent immunity to anyone implementing a C# compiler, but you are only covered if you are implementing the exact C# spec. Same goes for IL run time and other shit I'm sure.
>>
>>57056201
It basically is what it is. Not much useful for general purpose programming, great for embedded plugin/script systems, I wish the standard library had a few more functions related to tables and strings though rather having to reinvent the wheel every time.
My only other gripe with it is lack of continue statement.
>>
>>57056238
I think you're assuming different things than I.

Problem: C# doesn't have some features I want.

My solution is to take everything, keep copyrights and licenses where they should stay, and create a new language, language spec, and modify all the source to C# and it's components to your hearts content.

Of course you can't modify anything about C# and pass it off as C#; Microsoft owns that.

But you're more than welcome to create your own C#-like language using all of the source code Microsoft has publicly released and modify and resell it as you wish without claiming it is C#, or is related to C# or Microsoft or any of their property.
>>
>>57056258
>But you're more than welcome to create your own C#-like language using all of the source code Microsoft has publicly released and modify and resell it as you wish without claiming it is C#, or is related to C# or Microsoft or any of their property.
Yes, for the 4rth time, that is exactly what is not true. MS will be open to sue you for patent violation, and maybe other stuff for all I know. MS certainly do not what people endlessly forking C#, that is precisely why the C# spec has such a narrow open licence.

It has nothing to do with you calling the language C# or not or anything like that. I'm not sure where the legal boundaries are, but certainly MS claim to have patents concerning the C# spec and will sue anyone implementing a C# like langugae that violates them, unless i conforms exactly to the official C# spec.
>>
>>57056258
What's the difference between the Apache license and the MIT license?
>>
>>57056330
Apache v2 gives patent grants
>>
>>57056349
You're not >>57056258
>>
File: WHAT.jpg (18KB, 328x315px)
WHAT.jpg
18KB, 328x315px
>>57055656

>mfw I get a 6mb compiler error.

It's amazing to me that people shill for cpp ante domino 2016
>>
>>57056361
>terminal backbuffer set to a few thousands
>c++ spits out an error that I cannot even scroll up to the start of
>have to redirect the output

fucking hell
it's 2016, when will they fix these retarded errors
>>
>>57056361
>6mb
babby's first fizzbuzz
>>
File: praisestallman.png (372KB, 1292x1282px) Image search: [Google]
praisestallman.png
372KB, 1292x1282px
>>57056359
s-sorry
>>
>>57056384
Where are the servers supposed to get air from?
>>
File: sproll.png (6KB, 377x330px)
sproll.png
6KB, 377x330px
>>57056374

>Not coding fizzbuzz with cpp error messages
>>
>year 1 CS
>shit tier school
>lectures are women
>class mates are Prajeet
>Java Lecturer: " garbage collection is for old, dead languages"
>Math Lecturer:" No idea what modulo in programming is"
> Course Director: Linked in page shows NO IT qualification whatsoever

I've made a huge mistake
>>
>>57056443
>>Java Lecturer: " garbage collection is for old, dead languages"
Does he post here?
>>
>>57056443
>>Java Lecturer: " garbage collection is for old, dead languages"
... what?
>>
>>57056453
>SHE
Too busy spending those big bucks on shoes
>>
I've optimized my kNN and am now doing a test run. Looks good so far.
Next: PCA

>>57055933
kek

>>57055736
I'd actually love to test one.
>>
File: anal beads.png (17KB, 847x171px) Image search: [Google]
anal beads.png
17KB, 847x171px
Well, it's like someone who was 800 pounds making it down to 300 pounds.

Still quite fat, but at least they've made some serious progress.
>>
>>57056498

>it uninstalls cleanly
Pretty important feature
>>
>>57056498
Windows really is a meme.
>>
>>57056498
that's actually good.

>>57056507
unironically.
>>
>>57055631

Currently working on some lab software in C#

I usually write functional code, so I'm very unsure how to go about writing object oriented C#, I'm also very unsure about syntax.

In FP I'd do a lot of partial applications etc, and from what I've gathered C# encourages exposing functionality through higher order functions (that is closures) but I'm not really sure how it all comes together in practice...
>>
So I programmed this fizz buzz program that supposedly only very few people can solve. Is my code correct?
#include <type_traits>
#include <limits>
#include <iterator>
#include <algorithm>
#include <string>
#include <iostream>

template< typename T >
using integral_iterator_base_t = std::enable_if_t< std::numeric_limits< T >::is_integer, std::iterator< std::random_access_iterator_tag, T, std::ptrdiff_t, T, T > >;
template< typename T >
class integral_iterator_t : public integral_iterator_base_t< T >
{
using base_t = integral_iterator_base_t<T>;
typename base_t::value_type m_value;

public:
integral_iterator_t() = default;
integral_iterator_t( decltype( m_value ) const& value ) : m_value{ value } {}
operator auto const& () const { return m_value; }
operator auto& () { return m_value; }
typename base_t::reference operator* () const { return *this; }
};

int main()
{
using uint_iterator_t = integral_iterator_t< unsigned >;
std::transform( uint_iterator_t{ 1 }, uint_iterator_t{ 35 }, std::ostream_iterator< std::string >{ std::cout, ", " },
[]( auto const& value )
{
static std::string lut[] = { {}, "Fizz", "Buzz", lut[ 1 ] + lut[ 2 ] };
lut[ 0 ] = std::to_string( value );
return lut[ !( value % 3 ) + ( !( value % 5 ) << 1) ];
} );
}
>>
>>57056622
I think you'd be surprised at how functional you can get, or at least simulate, with C#.

Can you give an example of a task you're doing? I'd be happy to throw out some code examples if you give some input/output scenarios.
>>
Coming from a mainly software background, this is one of my first times I've touched verilog or anything hardware related.
How is my ALU code?

module alu(
input [3:0] op,
input [7:0] a,
input [7:0] b,
output [7:0] out,
output zo,
output so,
output co,
output oo
);

reg [8:0] c;

always @(*) begin
case (op)
4'd0: c = a + b;
4'd1: c = a - b;
4'd2: c = a * b;
4'd3: c = a / b;
default: c = 9'bz;
endcase
end

assign out = c[7:0];
assign zo = c[7:0] == 8'd0;
assign so = c[7];
assign co = c[8];
assign oo = (a[7] == b[7] && c[7] != a[7]);

endmodule
>>
>>57056206
>network-wide networks
tell me more
>>
Are mods autistic? What do they gain from deleting banter. This isn't a workplace
>>
>>57056660

Atm it's simple stuff, for instance I have a form class and some data acquisitions, and I want to update some panels in the form whenever I get more waveform data. Typically I'd just use a list of functions for each panel as a constructor argument for the data acquisition object and call those when I got new data, but I'm not really sure how to. It's pretty basic and there are docs out there, but i'm not sure if it's the best way to do it in C# and OOP in general.
>>
>>57056742
Don't worry about using "OOP" design patterns on what appears to be a small project.

Use objects as an organizational tool to make the code make sense.

It's hard to really give you some better advice without digging into your actual problems and showing you working code.

The best advice I can give is to do some basic things in console applications first to get a grasp on what the language can do, and learn the shit out of LINQ. Once you know what all the method and class attributes mean (private/public, static, return types, extension methods using "this", etc.), the rest is just writing code as you would in any other language you might be used to.
>>
>>57056770

This thing might grow in complexity, and even though I much prefer functional code I don't think that's a good excuse to not have a better grasp on how to write OOP, especially considering I love scala which uses both approaches in tandem.

I haven't put the code out yet, but I probably will as soon as it's in a functional state.

Writing this out made me realize what I should look for is handling and transforming data streams with C# since that's essentially what I'm doing.
>>
>learning C++
>check youtube
>no video without a strong indian accent
goddamn it
>>
>>57056882
Is there any language that Pajeet hasn't touched?
>>
>>57056882
>learning a language from a fucking youtube video
Why are people doing this to themselves?
>>
>>57056882
Step 1: Download the standard
Step 2: Read in Bjarne's voice.
>>
>>57056882
> 1 billion population
> massive tech sector
> desire to share knowledge part of culture
> want to earn that Ruppee

Indians know whats up, they are the best of all Prajeetistanis
>>
File: Based Bjarne.jpg (53KB, 502x359px) Image search: [Google]
Based Bjarne.jpg
53KB, 502x359px
>>57056919

I fucking cream to that accent
>>
File: cunning.jpg (54KB, 700x506px) Image search: [Google]
cunning.jpg
54KB, 700x506px
>>57056882

Really makes you think
>>
File: MYKaGYn.gif (42KB, 310x294px) Image search: [Google]
MYKaGYn.gif
42KB, 310x294px
>>57056094
Damn, look at that lordosis.
>>
Name a CS book that will make me think. Please no babby tier like SICP.
>>
>>57057032
>tfw two smart too think
>>
>>57056911
>learning from a fucking youtube video
It's helpful, why not?
>>
File: scarlet book.jpg (11KB, 260x325px)
scarlet book.jpg
11KB, 260x325px
>>57057032

It made me think at least.
>>
>>57057058
Books are simply more convenient.
>>
>>57057058
>>57057169
Also, people who are smart enough to teach things well are going to be more inclined to write than record. Youtube is for Mount Stupid climbers.
>>
>>57057169
Nah I disagree, vid is similar (though not as good) as having someone explain a concept to you
>>57057185
Silly to look down on extra resources for learning to be honest
>>
File: anal beads.png (40KB, 1131x523px) Image search: [Google]
anal beads.png
40KB, 1131x523px
>>57055631

Switching on types and inline functions in C# 7.0:
public static void Attack(this IWeapon weapon, IEnemy enemy)
{
switch (weapon)
{
case Sword sword when sword.Durability > 0:
enemy.Health -= sword.Damage;
sword.Durability--;
break;
case Bow bow when bow.Arrows > 0:
enemy.Health -= bow.Damage;
bow.Arrows--;
break;
}
}


var goblin = new Goblin();
var caveTroll = new CaveTroll();

var aliveEnemies = new List<IEnemy>() { goblin, caveTroll };

void enemyReport(List<IEnemy> e) =>
WriteLine($"The following enemies are present: \n{string.Join("\n", e.Where(x => x.Health > 0).Select(x => $"{x.Name}: {x.Health} health remaining"))}\n");

enemyReport(aliveEnemies);


Pardon the contrived example, but mite b kool.
>>
>>57057258
>breaking the Liskov substitution principle
>>
>>57057275
Maybe I'm failing to understand, but you can use a sword or a bow anywhere that accepts something that implements
IWeapon
.

Isn't that the point of interfaces?
>>
>phone interview was supposed to start 15 minutes ago

any minute now...
>>
>>57057292
While it's not an egregious violation since there won't be a crash, just nothing happening, it kind of defeats the point of subtype polymorphism when you need to modify the function to implement a new weapon type.
>>
>>57057258
I would make attack a virtual method on weapon tbqh, this is gonna turn into spaghetti central if there's too many weapon types. It's a cool language feature though.
>>
>>57057316
You'd have to do that somewhere anyway.

Consider adding a type of weapons that use gas, or some other type of fuel or resource.

You could certainly treat "durability", "arrows", and "fuel" all as an
IResource
, and handle that within the weapon, but you're modifying code somewhere anyway, right?

I could be wrong, but it's just whether you're modifying the code in the Attack method or within the resource of the weapon itself when it "attacks".
>>
>25 minutes

any minute now...
>>
>>57057360
Well, the first thing to do is to make each attack a method of the weapon instead of switching on the type and doing it in that function. Then you don't even need that function.

The second thing is, yes, to realize that the attacks are the same besides the name of the "resource", and to apply some more code reuse if you anticipate or notice that pattern continuing.
>>
>>57057360
Or you could do things my way and automatically generate weapons using genetic algorithms
If you keep your code simple you don't need OOP.
>>
Features that make me trash a language:

Switch with implicit fallthrough.
>>
>>57057371
I've had this happen before, and they did call quite a bit late. Got the job.

It's not rude to call the office and confirm the meeting. They should understand your time is valuable as a professional courtesy, so it shouldn't ruffle any features.

>>57057385
>>57057326
I'm trying to get a bit more object design practices under my belt, so I appreciate the feedback.

Would it be reasonable to then start doing subclasses of a weapon type, like:
class Sword : IWeapon
{
public int Damage { get; set; }
public int Durability { get; set; }
}

class Rapier : Sword
{
public Rapier()
{
Damage = 12;
Durability = 80;
}
}

class Falchion : Sword
{
public Falchion()
{
Damage = 9;
Durability = 130;
}
}


If I put the Attack() method on the weapon type, I'd have to repeat that code for each weapon type, rather than have one attack method that contains the various ways attacks are handled. From an organizational standpoint, I'd think it would be easier to handle all Attacks in the same place.

I'm just spitballing, feel free to call me a faggot.
>>
>>57057437
I understand that this is a simple example, but in practice you do not want to make a new subclass just to change some values. That is what constructors are for.
>>
>>57057443
>Thats what mapped keys are for
FTFY
>>
>>57057443
Ostensibly, in a game like Dark Souls, a subclass of a type of a weapon has many, many other attributes and effects that are unique to that weapon.

I would imagine you'd be better off not having a "Sword" masterclass at that point.
>>
>>57057437
>>57057443
Also,
>If I put the Attack() method on the weapon type, I'd have to repeat that code for each weapon type, rather than have one attack method that contains the various ways attacks are handled.
There are lots of ways to deal with code reuse. Inheritance would be the idiomatic way in this case but it's not the only way.

>>57057452
Well the code example you posted is not Dark Souls.
>>
Why do C programmers use macro instead of const variables?

#define MAX_THINGS 42

//v.s.

static const int MAX_THINGS;
>>
>>57057481
>What is the compiler preprocessor
>>
>>57057481

apathy
>>
>>57057481
For good reasons.
>>
>>57057538
Literally a meme
>>
let function() = System.Console.ReadLine()
let value = System.Console.ReadLine()

fucking stupid. fucking F#
>>
>>57057552
What's so hard about that?
>>
>>57057565

My personal and totally biased opinion is that declaring functions and declaring values shouldn't be nearly identical. It's hard to fuck up I know but it just triggers me.
>>
>>57057585
The point of FP is that there is no hard division between "value" and "function". A function is just a value with arity.
>>
>>57057585
Functions ARE values digga.
>>
>>57057601
>>57057603

Shit nigga I know what they are. I just think it's ugly.

Anyway they aren't directly interchangable
>>
>>57057631
It makes a lot more sense if you have currying and also ideally purity (no observable side effects).
>>
>>57057647

Yes but they could have replaced let with func or whatever.
>>
    O_CLOEXEC (since Linux 2.6.23)
Enable the close-on-exec flag for the new file descriptor.
Specifying this flag permits a program to avoid additional
fcntl(2) F_SETFD operations to set the FD_CLOEXEC flag.


What did they mean by this?
>>
>>57057655
Why?
let function() = x

is saying that function() gives you x. That is, function is a function that returns x when called with no arguments.

The only gotcha is that side effects happen right away for the value binding and at call time for function binding.
>>
>>57057676

As I said. It's just personal opinions about aesthetics. In a language with types having such an importance I'd have just liked it a bit more explicit in the declaration.
>>
>>57057663
>man 2 fcntl
>>
>>57057715
How do you feel about how C# does them now, compared to F#?

// function declarations
void voidFunction() => WriteLine("Something");
int intFunction(int x) => x * 10;

var intVariable = 10;

voidFunction();
int ayy = intFunction(69);
int lmao = intVariable;
>>
>>57057800
Literally a less verbose way to do exactly the same thing

>So many functions
>>
>>57057663

fd = open("somefile", "rw+" , O_CLOEXEC)
fork()

/* parent */
fd.write() // succeeds, fd is still valid

/* child */
fd.write() // fails, fd is closed
>>
>>57057800

I must admit I've never touched it.

C# needs you to make type declarations?
>>
>>57057800
I think the difference is functionality.

C# has you specify a return type for the function, and no useless "let" word is necessary.

I'd prefer a little bit of explicit type safety to just typing "let".
>>
>>57057839
>C# needs you to make type declarations?
Of course.

C# is a type-safe language.
>>
>>57057842

Type declarations gets in the way of generic functions.

let add a b = a + b

is boring if it only works for ints.

>>57057854

>of course.

It's not a matter of course though.
>>
>>57056655
you have a future in enterprise software
>>
>>57055656
>What's the best programming language
Go

>why is it C++?
uh.. ok?
>>
how evil is palantir exactly
>>
I love C.
>>
>>57057870
>if it only works for ints
It doesn't have to only work for ints.

Type safety is a good thing, and you could make a method that would accept any of the numeric types, as long as they have behavior defined for what "adding" does.
>>
>>57056206
>Is that picture from Cuba?
there are some words written in portuguese there. you can guess from that. retard
>>
Should I do a raycaster, or a huffman coder as the intro to programing 1 big project?
>>
>>57056498
they probably moved a lot of shit to the cloudâ„¢
>>
>>57057920
Neither. I'm already getting bored just by reading that.
>>
>>57057914

But that function already does that
>>
>>57057938
Very edgy
>>
File: cplus.jpg (36KB, 433x455px) Image search: [Google]
cplus.jpg
36KB, 433x455px
I need few C++ projects on my private repo for jobs interview

any ideas of nice C++ project that would look good?
>>
>>57057920
>huffman coder
>big project

Are you memeing or did I read that wrong?
>>
>>57058057
fizz buzz for sure
>>
File: anal beads.png (6KB, 463x125px)
anal beads.png
6KB, 463x125px
>>57057870
Something like this?
dynamic genericAdd(dynamic x, dynamic y) => x + y;
>>
>>57058086

The last line disturbs me but yes.
I was a bit curious about C#. The language seems a bit messy though. Does it get better as you get used to it?

Also, how much of a corporate slave are you compared to a java coder
>>
>>57058057
make me an add to cart bot that I can use to purchase things instantly
>>
>>57058128
That's would be cool. What about an AI that browse internet for you?
>>
>>57058125
The thing to remember with C# is that the language itself with the .NET Framework has a really massive set of features and syntax sugars out of the box.

It's only as messy as you make it, and many common things can be abstracted away with something like a personal "toolbox".

I've got a library that I constantly add to that contains many syntax sugar methods that I use daily.

C# can look almost like C, or it can look like some functional languages.

C# is type-safe, but you can tell type safety to fuck off, as I've just shown.

C# is memory-safe and has a GC, but you can manage your memory yourself if you want with the unsafe keyword.

It's pretty much whatever you want it to be.

My job is fucking awesome, and I get to design things how I see fit and take days off constantly and whenever I want, as long as I'm meeting deliverable goals. Being a corporate slave has nothing to do with the language; it has everything to do with the company you work for.

You can be a corporate slave writing some trendy hipster language, and you could be a rapid-prototype creative dev with the most ENTERPRISE of languages.
>>
>>57058062
Relative to the other projects during the semester.
It should:
Encode any binary file
Decode from the generated code table
Direction is given as commandline flag
>>
File: anal beads.png (9KB, 691x145px) Image search: [Google]
anal beads.png
9KB, 691x145px
>>57058086
This combined with operator overloads mite b kool

pic related
>>
>>57058229
How does this work?
>>
>tfw finally got fizz buzz to print to console
Feelsgoodman
>>
>>57058229
>>57058246
Rapier and Falchion are both "Swords", the Sword base class has behavior defined for the + operator:
public static string operator +(Sword one, Sword two)
{
return $"{one.Name} duct-taped to a {two.Name}";
}
>>
>>57058182
>tell type safety to fuck off, as I've just shown.

Well I wouldn't want that. It's just that my nephew was bothering me about making a (very small) game with him and I figured either unity engine or killing myself on rpgmaker
>>
>>57058267
Yes but how does it work.
>>
>>57058309

the sword class' Name method returns a string?
>>
>>57058320
Never mind I'll just read the spec.
>>
>>57057800
Is this C# 7.0? Looks nice

I hate the fun keyword in F#. It makes lambdas really verbose.
>>
>>57058182
>but you can manage your memory yourself if you want with the unsafe keyword.
really? How? I thought unsafe was just for pointers and turning off array bound checking.
>>
File: dook.jpg (7KB, 258x195px)
dook.jpg
7KB, 258x195px
>mfw after thoroughly reviewing the whole codebase I realized that using OOP (inheritance and all) in 2-3 carefully chose places would significantly cut down code complexity and make it easier to add/fix things in the future

I guess I went too far with composition and with avoiding OOP. It's just a tool, it has its uses.
>>
>>57056369
>>57056361

Stop using gcc, try clang for much better errors
>>
How do you return more than two values from a function in Java?
>>
>>57058603
Yep, inheritance is in fact useful sometimes. It's just something you have to use very selectively. Most OOP langugaes encourage programmers to use it for everything.

What scenarios did you find inheritance would help out of interest?
>>
>>57058627
define a wrapper class for the return values and return an instance of that class.
>>
>>57056923
>t. Pajeet
>>
>>57058645
Is this the power of OOP?
>>
>>57058603
>It's just a tool, it has its uses.
Just like every paradigm or language (except vb, vb is hell)
This board is just full of autists
>>
>>57058627
Return an array, map, etc
>>
>>57058627
create a class that can store two values and return an instance of that class.
>>
>>57058309
I went to lunch, mobile post time.

The + operator is defined now to operate on two swords, and return a string, which WriteLine gladly accepts. Swords have a name property.

The operator function returns an interpolated string that reads the names of the two swords and formats them into a string.

Maybe I'm not certain as to what you mean by how it works.

>>57058458
Yeah, you can use it in the preview build now
>>
>>57058659
It's the power of the living nightmare that is Java.
>>
>>57058659
You can treat the class like a record/struct in other languages, I can't imagine whatever extra overhead you get from it being a class rather than the more minimal struct is any worse than using Java period, but this in indeed the Power of OOPâ„¢
>>
>>57058707
>be Java programmer
>want to create a new record

>create new file with the name of the record
>declare the namespace at top of file
>declare the class, repeating the name of the file for the class name
>declare all the public fields you want for your "record"
>maybe add a constructor for setting the fields
>just for good measure, go full enterprise and make a getter and setter methods for each field and make each field private
>check the 80 lines of code you wrote for a "record" with 3 fields to make sure you didn't make any mistakes
>realise this is your life now
>kill self
>>
>>57058793
Can't believe when I was a 12yo developer enthusiast I used to do this.
This explain why my life is so shit tho
>>
std::ifstream::ignore is too slow. how do i ignore large chunks of data faster?
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
any C fags here that can tell me how bad I am? I'm used to c# and feel like i'm misunderstanding something.

My aim is having a menu display with different options to execute. The parent process will create a child and then go on wait. The child will run the actual Function. Then the parent just loops and shows the menu again until 5 is the input.

a rough snippet of my spaghetti:
while(1)
{
ShowMenu();
userInput = getchar();
if(userInput == '5') {exit(0);}
pid = fork();

if(pid == isChild)
{
Function(userInput);
exit(0);
}
else
{
wait();
}
}


everything works fine for the first execution, but it's not looping right. on the second loop it will print the menu, then skip the getchar(); line and the if input='5' line and just run the rest of it like normal without an input. Then it loops the third time and it works perfectly.
>>
>>57058821
while(1) { ...}


no no no, do this:

for (;;){ .. }
>>
>>57058843
even though the goal is to loop infinitely until a certain input is given?
>>
>>57058843
based go programmer
>>
>>57058818
I think a lot of people think it's a great idea when they are learning programming, because everyone tells them this is a great way of doing things
>everythig is encabsuladed : DDDD. Jaba is besd language : DDDDD

Then after while you think about and realise it's shit, and most developers are idiots.
>>
>>57058821
add
 printf("Char: %c\n", userInput);
after getChar() and you will know
>>
>>57058821
>
pid == isChild

I do not even.
>>
>>57058645
>>57058695
>>57058793
glad those days are coming to an end for C#. tuple literals/deconstruction are great. also record types

>>57058707
i still can't believe Java doesn't have user-definable value types
>>
>>57058866
It does the same thing but the latter saves kittens
>>
>>57058882
the first loop returns correctly, the second loop doesn't even let me give input and is blank, the third loop then runs correctly.

That code snippet has all of my debug printf's removed.
>>
>>57058875
Basically this. I'm glad I started C before my brain was filled with nonsense.
>>
>>57058888
sorry, mate. I did that for easier readability on here rather than leaving it at == 0
>>
>>57058899
>glad those days are coming to an end for C#. tuple literals/deconstruction are great. also record types
Yep. It always feels good to be a C# dev. Probably the best designed general purpose langugae that you can actually get easy work with.
>>
>>57057481
Const variables aren't statically known, and are possible to change with the right cast. You can't use const variables to define array lengths.

Enums don't have these problems, but you don't have any control over their type (it's always int), so you can't use them for, say, bitmasks of known widths.

Sometimes macros are the only available choice.
>>
>>57058899
>i still can't believe Java doesn't have user-definable value types
probably never will. I think it's because of Java's backwards compatibility strategy. They can't support something not already supported by the JVM bytecode spec.
>>
>>57057552
They SHOULD be the same thing.
Side effects were a mistake.
>>
>>57058946
>and are possible to change with the right cast.
>
>>
>>57057552
What's stupid? What are you trying to so?
let function() = System.Console.ReadLine()
let value = System.Console.ReadLine

are equivilant
>>
Inspired to try the question that Pajeet was given in
>>57015239

Does my answer seem retarded?

def draw_triangle(n):
line = 0
i = 1
z = n
while line <= n:
print("")
while z < n:
if i < 10:
print(str(i)+" "),
i = i + 1
elif i > 9:
print(i),
i = i + 1
z = z + 1
line = line + 1
z = z - line
>>
>>57058868
>(;;)
that's not Go
>>
>>57058905
Gdb is your friend, friend
>>
>>57058924
yeah, i thought maybe it would stagnate or something by now but it just keeps getting better. i like that a lot of the newer features help cut down on verbosity/boilerplate, which has been one of my only gripes with the language over the years

>>57058952
that's a shame. kind of a lost cause anyway though, given that C# exists. that's far from the only gap Java would have to close in order to even remotely be able to compete
>>
>>57059105
true. also in go you can just write for { stuff }
>>
>>57059116
Yep. It would be nice if if there was some friendly competition between Java and C#. Instead C# is like the pro athlete, and Java is just some fat retarded asshole with no interest in the concept of self improvement whatsoever.
>>
>>57059171
shut up faggot Java is the best language still

just look at all the jobs
>>
>>57055891
Holy shit, he's having a meltdown. I may actually avoid Scala now.
>>
>tfw I can't get past the first interview because I got fired from my last job after 3 months

kill... me...
>>
F# is lame
>>
>>57059255
>I got fired from my last job after 3 months
Fired or laid off?

The fuck did you do?
>>
>>57059240
>muh jobs
>>
>>57059240
Thy only reason you could find more jobs in Java is because average fags are retarded and give their money to the wrong corps
>>
>>57059267
I just argued with R&D too much
>>
>>57059240
>just look at all the jobs
There are other metrics to measure to measure the technical merits of langugae besides "jobs".

>>57059241
Everyone should avoid Scala. Terrible langugaes should be allowed to die.
>>
>>57059308
lol, don't argue with people anon. No one wants to hire someone who's just going to shit on everything. If you're a junior keep your mouth shut and do what people ask you to do as best you can.
>>
Getting into programming and I wanna start with Java, any required reading before just jumping and trying to learn syntax and make little programs?
>>
>>57059042

This is what I came up with. I hope I'm not a Pajeet
def numTriangle(n):
num = 0
for i in range(1,n + 1):
string = ""
for j in range(0,i):
num += 1
string += str(num) + " "
print(string)
>>
>>57059336
too fucking late. now I'm unhirable
>>
>>57059308
>I just argued with R&D too much
What do you mean?

Why would you argue? Did you set the expectation upon being hired that your word carries meaning?

When I got hired where I am now, I explicitly told them that they should expect me to tell them the "what and why" of anything I disagreed with.

Now, if I joined a company at a junior role without much experience, and immediately starting being a doomsayer, yes, I'd expect to not make it past the 3 month probationary period.
>>
>>57059369
just pretend you never had that last job, or you resigned or whatever. Have a good GitHub portfolio and you should get something.
>>
>>57059353
if you're free to choose a language i really recommend considering C# instead of Java. it's very similar early on when you're covering the basics, but the more you learn, the more glad you'd be that you went with it
>>
>>57059353
Why would you choose to learn Java if it's not required by a class or a particular job?
>>
>>57059353
c# is literally java+++
>>
>>57059426

I can do that, ideally I want to meet that line between ease of entry and in-demand language. I'd like to make either software or games, and whatever helps me break into the field easier is probably what I'll end up going after, but I know almost next to nothing about programming.

As a followup how long should I expect to study before I can start to apply for entry level type jobs or the 40-50K/yr type jobs?
>>
File: 1.png (1KB, 972x431px) Image search: [Google]
1.png
1KB, 972x431px
I'm selling a license key to a guy, and he is offering 90 dollars for it.

how do make the exchange, that is, how do he tranfer the money to me and i give him the licese key?

how does this things work?

thanks guys, sorry for the off topic
>>
>>57059454

Go here:
>>57053795
>>
>>57059454
we are programmers what makes you think we know how to successfully make transactions with people
>>
>>57059357

I'm still a total Pajeet when it comes to this stuff, is there any reason for using in range rather than while?

I find that I see in range a lot more than while.
>>
What's the best way to run C# on linux?
>>
>>57059454
You send him the key after he pays you.

It's that simple.

>>>/g/sqt
>>
>>57059492
not at all
>>
>>57059492
.net core
mono
vala
>>
>>57059492
Monodevelop for an IDE.

You can also use VSCode for a text editor with built-in IntelliSense.

As far as running it, either Mono or .NET Core, depending on what you're doing/targeting.
>>
File: 1399054610049.jpg (81KB, 451x392px) Image search: [Google]
1399054610049.jpg
81KB, 451x392px
>>57059492
>i want windows programming
>on linux
>>
>>57059492
virtual machine running windows
>>
>>57059498
>>57059548
Wrong.

Mono & .NET CORE
>>
>>57059454
We are too autistic for that
>>
>>57059581
Wrong.
>>
>>57059492
I use dotnet core for asp.net on Linux and it runs really well.
If you want wpf then you can only run it on windows unless you develop through wine.
>>
Replying to no one in particular:

While C# runs like a champ on Linux/mobile/OSX, etc, honestly the best dev experience for it is in Visual Studio.

You can get by with Monodevelop and VSCode, but you'll be missing out.

Until they actually do a full port of VS to Linux, I wouldn't consider C# as your main language if you're opposed to standing up a Windows VM for development.
>>
Can I borrow your neural computing time guys? I'm trying to code a simple server using epoll but it doesn't work

#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h> // socket, bind, listen, accept
#include <netinet/in.h> // sockaddr, sockaddr_in
#include <arpa/inet.h> // htons
#include <sys/epoll.h> // epoll_event, epoll_create1, epoll_wait, epoll_ctl
#include <unistd.h> // read

#define CHECK(x); if (x == -1) {perror(#x); exit(1);}

#define MAX_EVENTS 64
#define BACKLOG 128
static int listen_fd, client_fd, epoll_fd, n, n_ready;
static struct sockaddr_in server_address, client_address;
static socklen_t socket_length = sizeof(struct sockaddr_in);
static struct epoll_event event, events[MAX_EVENTS];

static void init(const int port) {
listen_fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
CHECK(listen_fd);
server_address = (struct sockaddr_in) {AF_INET, htons(port), {0}};
CHECK(bind(listen_fd, (struct sockaddr*) &server_address, sizeof(struct sockaddr)));
CHECK(listen(listen_fd, BACKLOG));
CHECK((epoll_fd = epoll_create1(0)));
event.events = EPOLLIN;
event.data.fd = listen_fd;
CHECK(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, listen_fd, &event));
for (;;) {
printf("Will be executed once");
n_ready = epoll_wait(epoll_fd, events, MAX_EVENTS, -1); // What's wrong here?
printf("%d\n", n_ready);
printf("Will never be executed");
for (n = 0; n < n_ready; ++n) {
if (events[n].data.fd == listen_fd) {
client_fd = accept(listen_fd, (struct sockaddr*) &client_address, &socket_length);
event.events = EPOLLIN | EPOLLET;
event.data.fd = client_fd;
epoll_ctl(epoll_fd, EPOLL_CTL_ADD, client_fd, &event);
} else {
do_something(events[n].data.fd);
}
}
}
}
>>
>>57059621
*epoll_wait does not return even when a client is connecting*
>>
>>57059621
>this C code
so this is why people thought OOP was a good idea
>>
>>57059640
It's just for testing purpose
>>
>>57058875
Scala generates all that stuff by default if you make a case class rather than a class.
>>
>>57059614
I use Visual Studio on my job and I actually prefer Visual Studio Code.
If only my job's source code worked on dotnet core rather than legacy dotnet.
>>
>>57059751
.NET Standard soon, friend.
>>
>>57059751
For when you want your text editor to use more ram than your browser.
>>
>>57058793
in haskell this is just

data Rec = Con { x :: a, y :: b, z :: c }
>>
>>57059621
man 2 bind
>>
>>57055656
It's C++

Godtier taste
>>
>>57059765
Visual Studio Code doesn't use that much memory. Maybe 200MB when I have all the tabs I need open.
Visual Studio uses a lot more than my browser (~800MB) just from 4 tabs though.
>>
>>57059621
>>57059776
Nevermind found the problem
static socklen_t socket_length = sizeof(client_address); // insead of struct sockaddr_in
>>
Some of you may think this should go in the stupid questions thread but:

I have a choice. Either learn Unity and Game Development, or learn Swift and iOS App Development.

Which route should I go with?
>>
>>57059788
socklen_t is a meme
>>57059784
>200M
wew
>>
>>57059792
Unity/Game Dev if you care about the actual work.

Swift/iOS if you just want to make money.
>>
>>57059792
Whichever you have a stronger stake in. Do you have a game idea fully fleshed out and just need to implement it? C#. Have an app idea ready? Swift.

Making things just for money is for losers and a sure-fire way to burn out/ditch a project because [x] didn't go right.
>>
>>57059803
>socklen_t
What should I use instead?
>>
>>57059809
Thanks. I'd at some point want to get to do both.

I have a good course for iOS now, with a good course for game dev "coming soon".

I have a shitty course right now for GameDev, so could get a start with that.

>>57059839
I have neither a game idea or an app idea. I know I would like to learn to do one of them, for both my own enjoyment and side-money (I doubt I'll ever get to a stage where I'm making huge bank on these).
>>
>>57059841
int
>>
>>57056016
They are free as in freedom as much as Mac OS X is.
>>
>>57059492

I mean... you CAN run it. Developing C# without Visual Studio sucks ass, IMO. VS just does everything for you, almost too easy.
>>
File: oh shit, I'm sorry.jpg (90KB, 884x645px) Image search: [Google]
oh shit, I'm sorry.jpg
90KB, 884x645px
>>57059792
>>>>>>Swift
dude go for game dev to start out with. It will solidify your programming concepts by having you actually apply them for a tangible and interactive end result.
>>
>>57059869
>Developing C# without Visual Studio sucks ass,
why
>>
>>57059474
Don't believe what ever bullshit he tells you.
While loops are perfectly fine.
>>
>>57056675
Personal project or class? If personal project remove the multiply and divide.
>>
>>57059474
It's more "pythonic" although I'm not an expert on that. Mainly using range is a lot easier and cleaner than using while in python, and it produces code that's easier to understand a lot of the time. Notice how much shorter my code is than yours. Now, there might be some overhead associated with using range, but c'mon, it's python.
>>
File: Flintstones_family.jpg (48KB, 245x240px) Image search: [Google]
Flintstones_family.jpg
48KB, 245x240px
>>57059906
I know who you are. Fuck you.
>>
>>57059891
Not that anon, but it's primarily due to the surrounding toolsets, and not necessarily the language itself.

For example, it's basically impossible to do Xamarin dev on Linux. It's built-in to Visual Studio with GUI designers, virtual machines, etc. Even OSX has a Xamarin Studio.

For GUI dev, you've got things like WPF and UWP. While these are of course Windows-only anyway, discounting first-class windows GUI frameworks is just silly if you're intending to produce good software for any platform.

The tool itself has lots of things built-in that Just Werkâ„¢ that you'd have to dig around for a plugin on a text editor.

Finally, the debugging and performance profiling in VS2015 is pretty fantastic. You can record events and snapshot RAM/CPU usage, and the various interactive debug windows really help with examining complex nested data structures when you hit breakpoints.
>>
should I remove my last job from my resume if I got fired after three months? If I do I'll have a five-month gap between my graduation and hiring with no personal project to fill the gap
>>
>>57059967
Yes.

Every single time that 3-month stint comes up, you're going to have a very hard to justifying it.

Any potential employer is going to look at it and see you as a risky hire.
>>
>>57059450

>ideally I want to meet that line between ease of entry and in-demand language
that's what's great about C#. it's a great first language because it's safe and easy to use when you want it to be, but it's also powerful when you need it to be. low floor but a high ceiling. and it's actually hugely popular in the industry right now; a ton of companies use it for tools/testing/automation often even when their actual product or service frontent/backend is in an entirely different language, so there's a lot of work out there for a decent C# developer

>I'd like to make either software or games
i learned C# primarily through teaching myself to develop games. i think it's a pretty good way to learn actually because games are a lot more fun than GUIs or test tools and you get to see a really tangible product of your efforts. it's challenging, but that makes it more rewarding, which makes it easier to stick with it and stay motivated

>how long should I expect to study before I can start to apply for entry level type jobs or the 40-50K/yr type jobs?
it depends pretty heavily on how much time you spend on it. if you're really proactive you can get to being pretty decent in a matter of months. getting to the point of legit proficiency/expertise takes a lot longer, but the thing is, to be honest, you don't have to be that good to get a job in it. if you don't tank an interview, and especially if you have a published project or something solid on github or even just a good history of contributions, there's a lot of entry-level jobs you could land
>>
>first CS lab at uni
>teacher: you're all going to be using visual studio. no exceptions.
>>
>>57059974
I've been lying and saying that I left because the company culture was extremely inter-competative becuase I barely have any experience and I was really worried about the 5-month gap
>>
>>57059450
>learned C# on a basic level
>got hired to entry level position on probational conditions, starting $38k
>less than a year later making $46k
>job is comfy

I could have done worse, especially considering I live in a low cost-of-living area. Rent is less than $600/month here.
>>
Currently doing Cholesky method in C.
>>
>>57059940
you forgot to strip your exif. I know exactly where you are, Bedrock. You fucking modern stone age family.
>>
>>57060030
4chan strips exif on all boards except /po/, ya silly goose.
>>
>>57059997
Why did you get fired after 3 months?
>>
>>57060049
Read the fucking thread, faggot.
>>
>>57060049
I fucked up. that's all there is to say
>>
>>57060049
Couldn't stop everyone's dick
>>
>>57060053
You are smart. I can tell.
>>
>>57060049
he was a dumb cunt and fought with his companies r&d
>>
the point is, I'm fucked now and I don't know what's best
>a 5-month gap when I have next to no experience
>admitting I got fired because I didn't know what I was doing
>making up some bullshit about "company culture"
>>
Best languages to learn for a guy interested mechanical engineering and comp sci?
>>
https://commandcenter.blogspot.com/2006/06/i-cant-find-this-on-web-so-here.html

stallman btfo
>>
>>57060113
how about you first stop lying and tell the truth ya dumb bitch.

-30 points for being a dumb shit
+5 points for admitting you were a dumb shit and showing regret

the rest of the points will have to come from a portfolio to outweigh your anger issues.
>>
>>57060113
Way to scuttle your career, anon. Enjoy
>>
>>57060123
>I asked if Stallman really believed
that people needed instructions on how to make signs. I was told
that among MIT undergraduates a bizarre form of political correctness
had developed, putting Stallman in charge of a pack of eager
misguided nerds who in a healthier environment would probably
be protesting the killing of rats in biology class.

>MIT students
>>
File: fucking what.png (7KB, 471x177px) Image search: [Google]
fucking what.png
7KB, 471x177px
>>57060123
>>57060188
>every line on that page is a separate HTML element

reeeeeee
>>
>>57059734
Scala is not the same langugae as Java.

Also, Scala is a huge heap of shit.
>>
>>57055656
Why, HTML of course :), although CSS is almost as good.
>>
>>57060215
>scala is not the same as java

>also here's what they have in common

???
>>
File: Capture.png (196KB, 1920x1080px) Image search: [Google]
Capture.png
196KB, 1920x1080px
>>57060209
jesus christ i thought you were jesting
>>
>>57060247
Holy shit, kill yourself "triwa" from Indiana.
>>
>>57060123
In Rob Pike's ideal world every linux user would be paying AT&T for using X. What a beautiful, beautiful thing that would be.
>>
>>57060247
>Ghost Stories (Dub)
>(Dub)
>DUB

my autism is activated
>>
>>57060267
>>57060286
',:^)
>>
>>57060286
you should watch the adv dub, it is mildly humorous
>>
>>57060281
stallman get out
>>
So i want to write a console application, it will take a certain input and run a sort of unique program for that input. For example (this is not the thing i wanna do but its similiar to the idea), a console app that would take something like the name of a game e.g. pong, space invaders, and then run the "pong" subprogram. But in my case there will be a lot of subprograms, how would i do this without loading it all into the program at once, is this the type of thing you use multithreading for?
>>
/!\ A L E R T /!\

New thread

>>57060394
>>57060394 >>57060394
>>57060394 >>57060394 >>57060394
>>57060394 >>57060394
>>57060394

/!\ A L E R T /!\
>>
>>57060371
can use a seperate file as an index
>>
>>57060397
>page 1
>new thread
full retard
>>
>>57060407
>+300
>>
Is this the right place where I can ask you guys why my coding is wrong, I've just started coding and I can't seem to figure out how to fix the problem.
>>
>>57060432
post code
>>
>>57060407
It's fine as long as we're at 310+
>>
>>57060123
>stallman btfo
how? I don't read it like that

also... the article feels like he loves to brag about himself. is pike egocentric or something?
>>
>>57060484
Okay, so for this exercise i have to encrypt a text file. The code has to know how which character there is and if the same character comes after, it has to say the letter+number of occurrences. So banana will stay banana but sleep becomes sle2p. But all it does is put 1-s after every character.
 invoer = open(original, "r") 
uitvoer = open(doelfile, "w")

kar = invoer.read(1)
i = 1
while kar:
for line in invoer:
for kar in line:
prevkar = kar
kar = invoer.read(1)
if kar == prevkar:
i += 1


if kar != prevkar:
i = 1

uitvoer.write(prevkar+str(i))
kar = invoer.read(1)
>>
>>57060547
we're in >>57060394
>>
>>57060237
yes, those are two perfectly reasoning things to point out consecutively.
>>
>>57060209
>>57060247
Each line isn't a separate HTML element. There are break tags between each line.

This kind of makes sense because that is how the email will have been written---with line breaks between each line (hard wrapping), which is standard email convention, to preserve the exact wrapping and alignment used by the person writing the email.

However using hard wrapping with a proportional font is pretty stupid so it would make more sense if they put it all in a <pre>, or just reformatted it into paragraphs, split by the double line breaks.
>>
>>57056151

>The .NET Framework is not open source
https://github.com/dotnet/coreclr
https://github.com/dotnet/corefx/

OH LOOK, IT'S THE .NET FRAMEWORK SOURCE CODE. AND IT'S MIT LICENSED
Thread posts: 322
Thread images: 25


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