You should use get_sub_field() to get the value into a variable, this way:
<?php
$style = "";
$code_snippet = get_sub_field('code-snippet');
if(empty($code_snippet)){
$style = 'style="display:none;"';
}
?>
<div class="content-code" <?php echo $style;?>>
<article>
<pre>
<?php echo $code_snippet; ?>
</pre>
</article>
</div>